Private
Public Access
2
0

mraa.c: Added init platform from json file

Signed-off-by: Houman Brinjcargorabi <houman.brinjcargorabi@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Houman Brinjcargorabi
2016-05-24 16:41:45 +01:00
committed by Brendan Le Foll
parent 346f447c4d
commit 8ba8ce3b26
6 changed files with 835 additions and 10 deletions

View File

@@ -44,6 +44,7 @@
if (res != MRAA_SUCCESS) \
return res;} while(0)
/** @file
*
* This file defines the basic shared values for libmraa
@@ -306,6 +307,16 @@ mraa_result_t mraa_remove_subplatform(mraa_platform_t subplatformtype);
*/
void* mraa_init_io(const char* desc);
/**
* Instantiate an unknown board using a json file
*
* @param Path to the json file, relative to the folder the program
* was initially run in or a direct path
*
* @return mraa_result indicating success
*/
mraa_result_t mraa_init_json_platform(const char* path);
#ifdef __cplusplus
}
#endif

View File

@@ -327,4 +327,18 @@ initIo(std::string desc)
return new T(mraa_init_io(desc.c_str()));
}
/**
* Instantiate an unknown board using a json file
*
* @param Path to the json file, relative to the folder the program
* was initially run in or a direct path
*
* @return Result indicating success
*/
inline Result
initJsonPlatform(std::string path)
{
return (Result) mraa_init_json_platform(path.c_str());
}
}