- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, im trying to disconnect the ble of the client side from the server side.
cy_ble_disable/cy_ble_stop are working but i can't readvertise afterward.
Ive tried using cy_ble_start/cy_ble_enable following the previous api's but its still not working.
Is it possiable to do it some how?
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
To disconnect the BLE client (say Phone) from the server side (PSoC 6) use Cy_BLE_GAP_Disconnect() API.
cy_stc_ble_gap_disconnect_info_t param =
{
.bdHandle = /* BD Handle */
.reason = CY_BLE_HCI_ERROR_OTHER_END_TERMINATED_USER
};
Cy_BLE_GAP_Disconnect(¶m);
On disconnection, the following events are generated in order.
CY_BLE_EVT_GATT_DISCONNECT_IND
CY_BLE_EVT_GAP_DEVICE_DISCONNECTED
After the CY_BLE_EVT_GATT_DISCONNECT_IND and CY_BLE_EVT_GAP_DEVICE_DISCONNECTED events you can use Cy_BLE_GAPP_StartAdvertisement() to restart the advertisement.
Thanks,
Ajay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Can you please attach your project.
Thanks,
Hima
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
To disconnect the BLE client (say Phone) from the server side (PSoC 6) use Cy_BLE_GAP_Disconnect() API.
cy_stc_ble_gap_disconnect_info_t param =
{
.bdHandle = /* BD Handle */
.reason = CY_BLE_HCI_ERROR_OTHER_END_TERMINATED_USER
};
Cy_BLE_GAP_Disconnect(¶m);
On disconnection, the following events are generated in order.
CY_BLE_EVT_GATT_DISCONNECT_IND
CY_BLE_EVT_GAP_DEVICE_DISCONNECTED
After the CY_BLE_EVT_GATT_DISCONNECT_IND and CY_BLE_EVT_GAP_DEVICE_DISCONNECTED events you can use Cy_BLE_GAPP_StartAdvertisement() to restart the advertisement.
Thanks,
Ajay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You need to make sure you have received "CY_BLE_EVT_STACK_SHUTDOWN_COMPLETE" before calling Cy_BLE_Start() API. Note that you do not have to call Cy_BLE_Enable as Start calls it automatically.
Also make sure the Cy_BLE_Stop() and Start() return CY_BLE_SUCCESS, otherwise post the error you are getting in the thread. After receiving CY_BLE_SUCCESS from the API calls, you need to call Cy_BLE_ProcessEvents to process the commands through the stack till you receive CY_BLE_EVT_STACK_SHUTDOWN_COMPLETE event for Stop and CY_BLE_EVT_STACK_ON event for Start.
Regards,
Meenakshi Sundaram R