There is a small issue in your code:
Before you enable Battery notification from the Central / Client, the "fbatteryMeasureNotify" is 0.
You define the error code as CYBLE_API_RESULT_T apiResult; When you do this, a garbage value may be stored in apiResult. This can be 300 or 100. So before you enable the notification, the following part of code alone gets executed in BatteryService_Cyclic () function:
if(apiResult != CYBLE_ERROR_OK)
DBG_PRINTF("API Error: %x \r\n", apiResult);
fbatteryMeasureNotify = false;
Here because of garbage value in apiResult, it will print as 300 or 100.
So, please change the declaration of apiResult as "CYBLE_API_RESULT_T apiResult = CYBLE_ERROR_OK;"
Also, please leave your E-mail ID for our internal records.
thanks, now there is no error at connecting. But after enabling all notifications I get api error 1 (CYBLE_ERROR_INVALID_PARAMETER) once. If I hit the button often sometimes I get one or two notifications. I'll try to find where it happens.
Where should I leave my mail address?
OK, I found the error: my batteryLevel was over 100, but only 100 % are allowed. Now it works and I can start to go on. Thank you very much.
Please leave your E-,mail Address here in the forum.
it is christian.weiss at lnt-automation.de