Skip to content
Snippets Groups Projects

epicardium: BLE opt in

Merged koalo requested to merge koalo/bleoptin into master
Files
2
+ 15
6
@@ -18,16 +18,22 @@ int bleShallStart(void)
{
int bleConfigFile = epic_file_open("ble.txt", "r");
if (bleConfigFile < 0) {
LOG_INFO("startup", "can not open ble.txt -> BLE is not started");
LOG_INFO(
"startup",
"can not open ble.txt -> BLE is not started"
);
epic_file_close(bleConfigFile);
return 0;
}
char cfgBuf[BLEMAXCFGBYTES+1];
char cfgBuf[BLEMAXCFGBYTES + 1];
int readNum = epic_file_read(bleConfigFile, cfgBuf, BLEMAXCFGBYTES);
LOG_INFO("startup", "readNum %i", readNum);
if (readNum < 0) {
LOG_INFO("startup", "can not read ble.txt -> BLE is not started");
LOG_INFO(
"startup",
"can not read ble.txt -> BLE is not started"
);
epic_file_close(bleConfigFile);
return 0;
}
@@ -35,12 +41,15 @@ int bleShallStart(void)
LOG_INFO("startup", "faa %s", cfgBuf);
char bleActiveStr[] = "active=true";
cfgBuf[sizeof(bleActiveStr)-1] = '\0';
char bleActiveStr[] = "active=true";
cfgBuf[sizeof(bleActiveStr) - 1] = '\0';
LOG_INFO("startup", "foe %i %s", sizeof(bleActiveStr), cfgBuf);
if (strcmp(cfgBuf, "active=true") != 0) {
LOG_INFO("startup", "ble.txt is not \"active=true\" -> BLE is not started");
LOG_INFO(
"startup",
"ble.txt is not \"active=true\" -> BLE is not started"
);
epic_file_close(bleConfigFile);
return 0;
}
Loading