aboutsummaryrefslogtreecommitdiffstats
path: root/4a-hal
diff options
context:
space:
mode:
Diffstat (limited to '4a-hal')
-rw-r--r--4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c30
-rw-r--r--4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.h8
-rw-r--r--4a-hal/4a-hal-utilities/4a-hal-utilities-data.h1
3 files changed, 7 insertions, 32 deletions
diff --git a/4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c b/4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c
index 3401c93..18cf781 100644
--- a/4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c
+++ b/4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c
@@ -68,10 +68,6 @@ static struct HalUtlApiVerb CtlHalDynApiStaticVerbs[] =
static int HalCtlsInitOneApi(afb_dynapi *apiHandle)
{
- int apiMetadataUnpackErr, apiHalmetadataUnpackErr;
-
- json_object *apiMetadata, *apiHalmetadata;
-
CtlConfigT *ctrlConfig;
struct SpecificHalData *currentCtlHalData;
@@ -94,27 +90,13 @@ static int HalCtlsInitOneApi(afb_dynapi *apiHandle)
currentCtlHalData->internal = true;
currentCtlHalData->status = HAL_STATUS_UNAVAILABLE;
- if(! json_object_object_get_ex(ctrlConfig->configJ, "metadata", &apiMetadata))
- return -4;
+ currentCtlHalData->name = (char *) ctrlConfig->api;
+ currentCtlHalData->sndCard = (char *) ctrlConfig->uid;
+ currentCtlHalData->info = (char *) ctrlConfig->info;
- if(! json_object_object_get_ex(ctrlConfig->configJ, "hal-metadata", &apiHalmetadata))
- return -5;
-
- apiMetadataUnpackErr = wrap_json_unpack(apiMetadata, "{s:s s?:s s?:s s?:o s?:o !}",
- "uid", NULL,
- "version", &currentCtlHalData->version,
- "api", &currentCtlHalData->name,
- "info", NULL,
- "require", NULL);
- if(apiMetadataUnpackErr)
- return -6;
-
- apiHalmetadataUnpackErr = wrap_json_unpack(apiHalmetadata, "{s:s s:s s:s !}",
- "sndcard", &currentCtlHalData->sndCard,
- "author", &currentCtlHalData->author,
- "date", &currentCtlHalData->date);
- if(apiHalmetadataUnpackErr)
- return -7;
+ currentCtlHalData->author = (char *) ctrlConfig->author;
+ currentCtlHalData->version = (char *) ctrlConfig->version;
+ currentCtlHalData->date = (char *) ctrlConfig->date;
currentCtlHalData->apiHandle = apiHandle;
currentCtlHalData->ctrlConfig = ctrlConfig;
diff --git a/4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.h b/4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.h
index b2b42f3..e3d449c 100644
--- a/4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.h
+++ b/4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.h
@@ -25,14 +25,6 @@
#include "../4a-hal-utilities/4a-hal-utilities-data.h"
-// Api info definitions
-#define HAL_CTLS_API_NAME_MAX_SIZE 32
-#define HAL_CTLS_API_INFO_MAX_SIZE 64
-#define HAL_CTLS_API_SNDCARD_MAX_SIZE 128
-#define HAL_CTLS_API_AUTHOR_MAX_SIZE 32
-#define HAL_CTLS_API_VERSION_MAX_SIZE 16
-#define HAL_CTLS_API_DATE_MAX_SIZE 16
-
// Verbs that can be use to create api
int HalCtlsCreateApi(afb_dynapi *apiHandle, char *path, struct HalMgrData *HalMgrGlobalData);
int HalCtlsCreateAllApi(afb_dynapi *apiHandle, struct HalMgrData *HalMgrGlobalData);
diff --git a/4a-hal/4a-hal-utilities/4a-hal-utilities-data.h b/4a-hal/4a-hal-utilities/4a-hal-utilities-data.h
index 75653e4..3ae16db 100644
--- a/4a-hal/4a-hal-utilities/4a-hal-utilities-data.h
+++ b/4a-hal/4a-hal-utilities/4a-hal-utilities-data.h
@@ -36,6 +36,7 @@ struct SpecificHalData {
char *name;
enum HalStatus status;
char *sndCard;
+ char *info;
uint8_t internal;
char *author;