Private
Public Access
2
0

mraa: add mraa_get_platform_name

getPlatformName for c++/swig API
Closes #35

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
This commit is contained in:
Thomas Ingleby
2014-11-26 15:15:55 +00:00
parent 0289c63c4c
commit d1185efc0a
8 changed files with 55 additions and 0 deletions

View File

@@ -30,6 +30,7 @@
#include "common.h"
#include "intel_edison_fab_c.h"
#define PLATFORM_NAME "Intel Edison"
#define SYSFS_CLASS_GPIO "/sys/class/gpio"
#define SYSFS_PINMODE_PATH "/sys/kernel/debug/gpio_debug/gpio"
#define MAX_SIZE 64
@@ -972,6 +973,10 @@ mraa_intel_edison_fab_c()
if (b == NULL)
return NULL;
b->platform_name_length = strlen(PLATFORM_NAME) + 1;
b->platform_name = (char*) malloc(sizeof(char) * b->platform_name_length);
strncpy(b->platform_name, PLATFORM_NAME, b->platform_name_length);
// This seciton will also check if the arduino board is there
tristate = mraa_gpio_init_raw(214);
if (tristate == NULL) {