Brendan Le Foll
a5d13670f4
mraa.c: Fix buffer overfow in mraa_find_i2c_bus
...
All files in sysfs are 4K minimum so allocate a 4k buffer to hold the result -
even if it'll never be that big
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-07-15 13:50:29 +01:00
Brendan Le Foll
df0dbb0c73
mraa: add internal mraa_find_i2c_bus function
...
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-07-10 11:11:41 +01:00
Brendan Le Foll
184a71aaa1
intel_de3815: avoid double free in case of error
...
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-07-08 10:34:32 +01:00
Brendan Le Foll
7f34a5c9cf
intel_de3815.c: Add error handling to seeks and avoid reading past buffer size
...
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-07-08 10:34:32 +01:00
Brendan Le Foll
f9dd4c06de
intel_de3815.c: check i2c device fd
...
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-07-08 09:39:52 +01:00
Brendan Le Foll
5131349c4d
intel_de3815.c: go up to i2c-8 to find designware i2c adapter
...
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-07-08 09:39:30 +01:00
Brendan Le Foll
12620cee0e
intel_minnow_max.c: Use MAX_LENGTH for strn commands
...
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-07-06 13:41:39 +01:00
Brendan Le Foll
af41d56597
intel_minnow_max.c: Fix SPI CLK having uninitialised mux total
...
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-07-06 11:48:44 +01:00
Brendan Le Foll
c5b0d7a1d1
python/mraa.i: Fix memory leak on python Spi::write and I2c::write
...
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-07-02 19:17:53 +01:00
Brendan Le Foll
4698d18fa1
mraajs.i: Fix memory leak on javascript Spi::write
...
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-07-02 19:06:59 +01:00
Brendan Le Foll
76a34afe84
mraa.c: Fix readlink call not terminating its buffer
...
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-07-01 10:59:03 +01:00
Brendan Le Foll
8a95972774
intel_edison_fab_c.c: check fstat return value
...
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-07-01 10:59:03 +01:00
Brendan Le Foll
f080a74497
gpio: all gpio enums prefixed with _mraa
...
Enum C types for gpio where not all prefixed with mraa correctly, now fixed
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-07-01 10:59:03 +01:00
Thomas Ingleby
5ccd7a675f
x86: de3815: detect correct i2c-dev
...
Will search for the designware i2c devices
Closes #198
Closes #203
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com >
2015-06-30 14:52:55 +01:00
Jon Trulson
b8b5c935a2
pwm: mraa_pwm_write() should accept 1.0 as a valid percentage
...
Signed-off-by: Jon Trulson <jtrulson@ics.com >
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com >
2015-06-30 00:40:52 +01:00
Thomas Ingleby
1ef71bb370
x86: Galileo Gen 2: add ftdi header serial
...
Closes #138
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com >
2015-06-29 20:09:45 +01:00
Thomas Ingleby
fd50ea087b
uart: fix issue where a index is checked before set
...
Related to #152
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com >
2015-06-29 19:51:34 +01:00
Thomas Ingleby
79d1acd17f
x86: edison: add check in init_pre uart hook
...
If none 0 index passed, will log error.
Related to #152
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com >
2015-06-29 19:49:55 +01:00
Alex Tereschenko
ea31104db0
intel_edison_fab_c.c: added spi_lsbmode_replace to return proper status
...
Edison SPI driver doesn't support LSB_FIRST mode, we will now return
_FEATURE_NOT_SUPPORTED instead of _INVALID_RESOURCE
for attempts to enable it.
Closes #22 .
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com >
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-06-22 19:26:30 +01:00
Alex Tereschenko
c9cfcb2cae
intel_galileo_rev_d.c: added spi_lsbmode_replace to return correct status.
...
Galileo Gen1 doesn't support LSB_FIRST mode, so let's
return MRAA_ERROR_FEATURE_NOT_SUPPORTED instead of <...>_INVALID_RESOURCE.
Closes #178 .
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com >
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-06-15 09:56:49 +01:00
Alex Tereschenko
5adc951f57
spi.c: introduced a _replace hook for spi_lsbmode()
...
This could be generally useful and more specifically is a
prerequisite for issue #178 .
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com >
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-06-15 09:55:54 +01:00
Alex Tereschenko
44047e746f
spi.c: moved struct _spi declaration into mraa_internal_types.h
...
The declaration seems to be misplaced compared to all other similar structs.
It's also a prerequisite for introducing the _replace hook for spi_lsbmode(),
per issue #178 .
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com >
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-06-15 09:55:54 +01:00
Brendan Le Foll
2cb32f791c
binding.gyp.cmake: fix compilation when not setting target_arch
...
NPM package now only builds x86 builds, but for npm those are the only ones
that have ever worked due to a rework of the cmake code generating the
binding.gyp file is required
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-06-03 14:51:13 +01:00
Brendan Le Foll
b4655b250b
uart.c: Fix some wrong return checks
...
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-06-02 08:42:37 +01:00
Brendan Le Foll
21355d4bb5
mraajs.i: Use 0x032870 as SWIG_V8_VERSION to distinguish node.js 0.12.x
...
This fixes compilation with node.js 0.12.4
Closes #211
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-06-01 17:37:35 +01:00
Brendan Le Foll
d4968b6b81
doxygen2jsdoc: add custom typemap file
...
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-06-01 15:24:23 +01:00
Brendan Le Foll
d6b33a9cbf
cmake: add yuidoc documentation generation
...
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-06-01 15:16:42 +01:00
Jon Trulson
b142f3fdda
uart: fix missing inversion that will clear all other flags
...
Signed-off-by: Jon Trulson <jtrulson@ics.com >
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-06-01 11:20:18 +01:00
Brendan Le Foll
e0ce5454bd
uart: move string funcs to {read,write}Str
...
This commit adds raw binary read/write functions using the same typemaps as I2c
functions
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-06-01 10:58:11 +01:00
Brendan Le Foll
236a8e9586
uart: make mraa_uart_get_dev_path return const char*
...
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-06-01 10:54:40 +01:00
Brendan Le Foll
347fd449f9
uart: Make C API use const where appropriate
...
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-06-01 09:36:00 +01:00
Thomas Ingleby
b982160ec5
uart: update C API
...
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com >
2015-05-28 23:31:12 +01:00
Brendan Le Foll
19cad5cf24
uart: bunch of small changes to make C api work
...
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-05-28 23:31:11 +01:00
Brendan Le Foll
b02f8b4d50
uart.c: add missing return values
...
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-05-28 23:31:11 +01:00
Thomas Ingleby
4d86860e0c
uart: remove un-needed includes from uart.h
...
No need for many included
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com >
2015-05-28 23:31:11 +01:00
Thomas Ingleby
7e47b05c8f
uart: move internal static function to top of file
...
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com >
2015-05-28 23:31:11 +01:00
Brendan Le Foll
0a516ef3bf
uart: make initial dump of uart module
...
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-05-28 23:31:11 +01:00
Jon Trulson
88f3052d99
uart: use an unsigned int for baud rate rather than speed_t
...
uart.c contains a static conversion function that will translate known
baud rates into their speed_t counter parts. If an unsupported baud
rate is selected, a diagnostic will be emitted via syslog and a
default of B9600 will be chosen.
Signed-off-by: Jon Trulson <jtrulson@ics.com >
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-05-28 23:31:11 +01:00
Jon Trulson
c30457e434
uart: add capability to check if data can be read from device
...
Signed-off-by: Jon Trulson <jtrulson@ics.com >
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-05-28 23:31:11 +01:00
Jon Trulson
cf14939cca
uart: add uart device read and write functionality
...
Signed-off-by: Jon Trulson <jtrulson@ics.com >
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-05-28 23:31:11 +01:00
Jon Trulson
6d269eeabd
uart: add uart device open and close functionality
...
Signed-off-by: Jon Trulson <jtrulson@ics.com >
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-05-28 23:31:11 +01:00
Jon Trulson
bdadbb8b01
uart: add fd (file descriptor) to uart context
...
Signed-off-by: Jon Trulson <jtrulson@ics.com >
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-05-28 23:31:11 +01:00
Brendan Le Foll
55533ed8c1
mraajs.i: add buffer checks to python write() typemaps in Spi & I2c
...
Previously anything passed to an I2c::write() or Spi::write() function in
node.js that wasn't a node::Buffer or an object would likely cause a segfault
later on during future calls. This change calls node::Buffer::HasInstance(obj)
to make sure the buffer is valid prior to grabbing it's data
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-05-20 11:16:18 +01:00
Paul Barrette
f6e87f63e0
raspberry_pi.c: update platform check for the PI 2 Version B
...
The latest Raspberry Pi 2 revision string is missing from the discovery
function mraa_raspberry_pi() and results in incorrect pin mapping defaulting to
PI_B Rev 1.
Signed-off-by: Paul Barrette <paul.barrette@windriver.com >
Signed-off-by: Paul Barrette <paulbarrette@gmail.com >
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-04-27 10:48:24 +01:00
Brendan Le Foll
2679a916be
gpio.c: mraa_gpio_get_* now return -1 in error cases
...
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-04-24 16:07:17 +01:00
Alexander Komarov
4302f0d0c3
java: Added Java SWIG binding creation
...
%init directive is not supported in java so move %init to js/py interface files
Signed-off-by: Alexander Komarov <alexander.komarov@intel.com >
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-04-24 12:12:11 +01:00
Michael Ring
0d15d3a38c
banana.c: Fixed Pin assignment for Banana Pi and wrong names for SPI devices
...
Signed-off-by: Michael Ring <michael.ring@swisscom.com >
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-04-08 22:19:14 +01:00
Michael Ring
095ff894a7
mraa.c: Remove mraa_init() from mraa_pin_mode_test
...
If platform is not initalised at this stage then there is no need to attempt
again
Signed-off-by: Michael Ring <mail@michael-ring.org >
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-04-08 22:19:14 +01:00
Michael Ring
56ba08a98f
banana: Add bananapi support
...
Signed-off-by: Michael Ring <mail@michael-ring.org >
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-04-08 22:19:14 +01:00
Michael Ring
bff7b558eb
mraa.c: Add _contains helper functions
...
Signed-off-by: Michael Ring <mail@michael-ring.org >
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-04-08 22:19:14 +01:00