- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I use the CYBT413055 Eval an want to attemps reconnect the Eval Board when the connection was lost.
i want to it periodically so i attemps each 10 seconds (using a timer) to reconnect as follow:
/*
* SPP connection up callback
*/
void spp_connection_up_callback(uint16_t handle, uint8_t* bda){
wiced_stop_timer(&spp_reconnect_timer); // stop the timer when connection is established
}
/*
* SPP connection down callback
*/
void spp_connection_down_callback(uint16_t handle)
{
/* check if timer is initialized and start it */
if(wiced_init_timer(&spp_reconnect_timer, spp_reconnect_timeout, 0, WICED_SECONDS_PERIODIC_TIMER) == WICED_SUCCESS){
wiced_start_timer(&spp_reconnect_timer,5);
}
void spp_reconnect_timeout(uint32_t param){
spp_reconnect_result = wiced_bt_spp_connect(bda);//reconnect;
}
It does not work! I need your help Thank u
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Update:
The more appropriate example here would be rfcomm-spp-multi-port where we have demonstrated client and server roles and implementation of two rfcomm ports ( 2 spp connection).
https://github.com/Infineon/mtb-example-btsdk-rfcomm-spp-multi-port
Before we call wiced_bt_spp_connect, we have to make sure that the service control block is set properly and the initialization of rfcomm server is active, etc. This app is expected to communicate with an external MCU/Host and the demonstration is done using ClientControl application which is present in the SDK. Instead, the host logic can be implemented in any other MCU or we can skip those and make it an individual embedded app. For example, instead of receiving the connect command from the external MCU, if we press the button it reconnects. I would suggest you to refer the above example. Please create a new thread if you have any doubts.