#define MAX_FILENAME_LEN (100)
#define RX_BUFFER (64)
+#define XML_CONFIG_FOLDER "/data/"
+#define XML_CONFIG_FILE "config_multichannel_audio_kit.xml"
/** Internal structure, enabling multiple instances of this component.
* \note Do not access any of this variables.
return 0;
}
+
+STATIC char* GetDefaultConfig(void) {
+
+ char const *data_path = getenv("AFM_APP_INSTALL_DIR");
+
+ if (!data_path) {
+ AFB_ERROR("AFM_APP_INSTALL_DIR is not defined");
+ }
+ else {
+ size_t size;
+ char * config_path;
+
+ AFB_NOTICE("AFM_APP_INSTALL_DIR is: %s", data_path);
+ size = strlen(data_path) + strlen(XML_CONFIG_FOLDER) + strlen(XML_CONFIG_FILE) + 2;
+ config_path = malloc(size);
+ if (config_path != NULL) {
+ snprintf(config_path, size, "%s%s%s", data_path, XML_CONFIG_FOLDER, XML_CONFIG_FILE);
+ if(access(config_path, R_OK ) == 0) {
+ AFB_NOTICE("Default configuration: %s", config_path);
+ return config_path;
+ }
+ }
+ }
+
+ return NULL;
+}
+
STATIC UcsXmlVal_t* ParseFile(struct afb_req request) {
char *xmlBuffer;
ssize_t readSize;
afb_req_fail_f (request, "UNICENS-init", "Fail to initialize UNICENS");
goto OnErrorExit;
}
-
+
afb_req_success(request,NULL,"UNICENS-active");
OnErrorExit:
OnErrorExit:
return;
}
+
+PUBLIC int ucs2_initbinding(void) {
+ char *config_file = GetDefaultConfig();
+ if (config_file != NULL) {
+
+ free(config_file);
+ }
+
+ return 0;
+}