Tool/software: Code Composer Studio
Hello,
I'm having trouble reconnecting simple_central and simple_peripheral.
The idea is that simple_central constantly searches for peripherals. Being able to connect with up to 8 devices.
The problem that occurs is that when starting simple_central it connects to the two available devices. If I turn-off and turn-on one of the peripherals, simple_central can no longer connect to the device again.
The timeout is configured in 2s at simple_central.
The simple_peripheral can be detected by Btool after being switched on again.
Do I need a command to clean up lost connections?
switch (*fsm_control) { case BLE_INIT: if(GL_Ble_Init_Done == 1){ *fsm_control = BLE_IDLE; } break; case BLE_IDLE: if(numConn<2){ *fsm_control = BLE_SCAN; } break; case BLE_SCAN: SimpleCentral_enqueueMsg(SC_EVT_SCAN_ENABLED, SUCCESS, NULL); *fsm_control = BLE_WAIT_SCAN; *fsm_timer = GL_Count_50ms + 7; break; case BLE_WAIT_SCAN: if(numScanRes>0){ *fsm_conn_control = numScanRes; *fsm_control = BLE_CONNECT; }else{ *fsm_control = BLE_IDLE; } break; case BLE_CONNECT: for(uint8_t i=0; i<*fsm_conn_control; i++) SimpleCentral_enqueueMsg(SC_EVT_CONNECT_ENABLED, i, NULL); *fsm_control = BLE_WAIT_CONNECT; *fsm_timer = GL_Count_50ms + 5; break; case BLE_WAIT_CONNECT: *fsm_control = BLE_IDLE; break; default: *fsm_control = BLE_INIT; break;
simplelink_cc2640r2_sdk_4_20_00_04