Skip to content

Commit b0a9101

Browse files
Sean LyonsSML892
authored andcommitted
Merge pull request #87 in SA/ble_examples from feature/fix_SSS_client_not_reconnecting_after_termination to simplelink_cc2640r2_sdk-2.20
Squashed commit of the following: commit 94b26cac7840dd13ead27d50305963e5193fa8fc Author: Wennerfeldt <[email protected]> Date: Thu Oct 18 13:16:59 2018 +0200 Fix so that client now starts discovery again following a termination. Fixed internal state in discovery support functions not being properly reset.
1 parent 88e8491 commit b0a9101

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

examples/rtos/CC2640R2_LAUNCHXL/bleapps/simple_serial_socket_client/src/app/simple_serial_socket_client.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -843,8 +843,16 @@ static void SimpleSerialSocketClient_processRoleEvent(gapCentralRoleEvent_t *pEv
843843
PIN_setOutputValue(ledPinHandle, Board_RLED, 0);
844844
PIN_setOutputValue(ledPinHandle, Board_GLED, 0);
845845

846+
// Prepare for going back to discovery
846847
streamServiceHandle.startHandle = GATT_INVALID_HANDLE;
847848
streamServiceHandle.endHandle = GATT_INVALID_HANDLE;
849+
scanningStarted = TRUE;
850+
discoveryDone = FALSE;
851+
852+
// Start discovery
853+
GAPCentralRole_StartDiscovery(DEFAULT_DISCOVERY_MODE,
854+
DEFAULT_DISCOVERY_ACTIVE_SCAN,
855+
DEFAULT_DISCOVERY_WHITE_LIST);
848856
}
849857
break;
850858

examples/rtos/CC2640R2_LAUNCHXL/bleapps/simple_serial_socket_client/src/app/simple_service_discovery.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ uint32_t SimpleServiceDiscovery_discoverService(uint16_t connHandle, ICall_Entit
155155
}
156156
else
157157
{
158+
discoveryState = BLE_DISC_STATE_IDLE;
158159
retVal = SIMPLE_DISCOVERY_UNSUCCESSFUL;
159160
}
160161
}
@@ -173,6 +174,7 @@ uint32_t SimpleServiceDiscovery_discoverService(uint16_t connHandle, ICall_Entit
173174

174175
if (pMsg->hdr.status == bleProcedureComplete)
175176
{
177+
discoveryState = BLE_DISC_STATE_IDLE;
176178
retVal = SIMPLE_DISCOVERY_SUCCESSFUL;
177179
}
178180
}

0 commit comments

Comments
 (0)