mraa: add mraa_remove_subplatform call
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
19
src/mraa.c
19
src/mraa.c
@@ -982,6 +982,9 @@ mraa_add_subplatform(mraa_platform_t subplatformtype, const char* uart_dev)
|
||||
{
|
||||
#if defined(FIRMATA)
|
||||
if (subplatformtype == MRAA_GENERIC_FIRMATA) {
|
||||
if (plat->sub_platform != NULL) {
|
||||
return MRAA_ERROR_INVALID_PARAMETER;
|
||||
}
|
||||
if (mraa_firmata_platform(plat, uart_dev) == MRAA_GENERIC_FIRMATA) {
|
||||
syslog(LOG_NOTICE, "mraa: Added firmata subplatform");
|
||||
return MRAA_SUCCESS;
|
||||
@@ -993,6 +996,22 @@ mraa_add_subplatform(mraa_platform_t subplatformtype, const char* uart_dev)
|
||||
return MRAA_ERROR_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
mraa_result_t
|
||||
mraa_remove_subplatform(mraa_platform_t subplatformtype)
|
||||
{
|
||||
#if defined(FIRMATA)
|
||||
if (subplatformtype == MRAA_GENERIC_FIRMATA) {
|
||||
if (plat == NULL || plat->sub_platform == NULL) {
|
||||
return MRAA_ERROR_INVALID_PARAMETER;
|
||||
}
|
||||
free(plat->sub_platform->adv_func);
|
||||
free(plat->sub_platform->pins);
|
||||
free(plat->sub_platform);
|
||||
}
|
||||
#endif
|
||||
return MRAA_ERROR_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
#if defined(IMRAA)
|
||||
mraa_result_t
|
||||
mraa_add_from_lockfile(const char* imraa_lock_file)
|
||||
|
||||
Reference in New Issue
Block a user