- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello everyone,
I work on a project on CYBLE-416045-02 module. I have start with demo project to use BLE. For this moment all woked great.
i have create a new task which print a message every 10 secondes.
I program my module all work great, all task initialized, Ble advertisement OK and my new task work great with a message every 10s.
At this moment, activate advertisement and i connect my module and my smartphone application.
After connexion succesfull, all continue to work great.
After this test, i quit my smartphone application and at this moment my new task print none message and i don't see any disconnect message on my console.
Do you have any advice or idea about this problem ?
Thanks,
Best regards,
Max
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello everyone,
I have found the problem,
void static DisconnectEventHandler(void)
{
/* Variable used to store the return values of RTOS APIs */
BaseType_t rtosApiResult;
requestHtsIndication = false;
/* Turn off the Orange LED and blink the Red LED once to
indicate disconnection*/
status_led_data_t statusLedData =
{
.orangeLed = LED_TURN_OFF,
.redLed = LED_BLINK_ONCE
};
/* Turn off the Orange LED and blink the Red LED once to
indicate disconnection*/
rtosApiResult = xQueueSend(statusLedDataQ, &statusLedData,0u);
if(rtosApiResult != pdTRUE)
{
Task_DebugPrintf("Failure! : BLE - Sending data to Status LED queue",
0u);
}
/* Request Temperature Task not to send any data */
// notification_command_t notificationCommand = RESET;
//xQueueOverwrite(notificationMessageQ, ¬ificationCommand);
notification_message_t notificationMessage;
notificationMessage.command = RESET;
xQueueReset(notificationMessageQ); //reset queue to initial state empty
xQueueSend(notificationMessageQ, ¬ificationMessage,0u); //sendMessage
}
You can see in comment the 2 precedentes lines and below the 4 new lines.
The main problem come from xQueueOverwrite which work with only a 1 length queue. After different tests, i saw when i set my queue for notificationMessageQ to 1 my disconnexion worked. So i change my xQueueOverwrite to XQueueSend and i added a xQueueReset to be sure that the only element on my queue was Reset.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
To complete my informations, i have used CySmart to test disconnect. And i have the same problem. After a click on Disconnect, my module freeze, no message print and no new advertisment available.
Max
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Max
Please can you share the Air logs and your project so that we can understand the issue better.
If using Modustoolbox you can refer below code example :
https://github.com/Infineon/mtb-example-psoc6-ble-battery-level-freertos
Thanks & Regards
Pratiksha V
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello everyone,
I have found the problem,
void static DisconnectEventHandler(void)
{
/* Variable used to store the return values of RTOS APIs */
BaseType_t rtosApiResult;
requestHtsIndication = false;
/* Turn off the Orange LED and blink the Red LED once to
indicate disconnection*/
status_led_data_t statusLedData =
{
.orangeLed = LED_TURN_OFF,
.redLed = LED_BLINK_ONCE
};
/* Turn off the Orange LED and blink the Red LED once to
indicate disconnection*/
rtosApiResult = xQueueSend(statusLedDataQ, &statusLedData,0u);
if(rtosApiResult != pdTRUE)
{
Task_DebugPrintf("Failure! : BLE - Sending data to Status LED queue",
0u);
}
/* Request Temperature Task not to send any data */
// notification_command_t notificationCommand = RESET;
//xQueueOverwrite(notificationMessageQ, ¬ificationCommand);
notification_message_t notificationMessage;
notificationMessage.command = RESET;
xQueueReset(notificationMessageQ); //reset queue to initial state empty
xQueueSend(notificationMessageQ, ¬ificationMessage,0u); //sendMessage
}
You can see in comment the 2 precedentes lines and below the 4 new lines.
The main problem come from xQueueOverwrite which work with only a 1 length queue. After different tests, i saw when i set my queue for notificationMessageQ to 1 my disconnexion worked. So i change my xQueueOverwrite to XQueueSend and i added a xQueueReset to be sure that the only element on my queue was Reset.