Add mraa_get_pin_name to get the real world name of the pin.
Signed-off-by: Michael Ring <mail@michael-ring.org>
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
*/
unsigned int mraa_get_pin_count();
+/**
+* Get name of pin, board must be initialised.
+*
+* @param pin number
+*
+* @return char* of pin name
+*/
+char* mraa_get_pin_name(int pin);
+
#ifdef __cplusplus
}
#endif
}
/**
+* Get name of pin, board must be initialised.
+*
+* @param pin number
+*
+* @return char* of pin name
+*/
+inline std::string getPinName(int pin)
+{
+ std::string ret_val(mraa_get_pin_name(pin));
+ return ret_val;
+}
+
+/**
* Sets the log level to use from 0-7 where 7 is very verbose. These are the
* syslog log levels, see syslog(3) for more information on the levels.
*
}
char*
+mraa_get_pin_name(int pin)
+{
+ if (plat == NULL) {
+ return NULL;
+ }
+ if (pin > (plat->phy_pin_count -1) || pin < 0)
+ return NULL;
+ return (char*) plat->pins[pin].name;
+}
+
+char*
mraa_file_unglob(char *filename) {
glob_t results;
char *res = NULL;