Tool/software: Code Composer Studio
hi ,
I am working on 2640r2f board i want to connect peripheral boards to central without prerssing key
i have did without pressing key for 1 one board now i want to connect another board without pressing key one after one
i have did that for both connecting but its connect address different as show below in process role event changed some
could you suggest me how connect peripherals address to central in what condition should place before service uuid and central address
static void SimpleBLECentral_processRoleEvent(gapCentralRoleEvent_t *pEvent)
{
// if (scanIdx == -1)
// {
// if (!scanningStarted)
// {
// scanningStarted = TRUE;
// scanRes = 0;
Display_print0(dispHandle, 1, 0, Util_convertBdAddr2Str(pEvent->initDone.devAddr));
SimpleBLECentral_startGapDiscovery();
// }
// }
// DELAY_MS(4000);
// if filtering device discovery results based on service UUID
if (DEFAULT_DEV_DISC_BY_SVC_UUID == TRUE)
{
if (SimpleBLECentral_findSvcUuid(SUNLIGHT_SERV_UUID,
pEvent->deviceInfo.pEvtData,
pEvent->deviceInfo.dataLen))
{
SimpleBLECentral_addDeviceInfo(pEvent->deviceInfo.addr,
pEvent->deviceInfo.addrType);
}
}
// discovery complete
// scanningStarted = FALSE;
// if not filtering device discovery results based on service UUID
// if (DEFAULT_DEV_DISC_BY_SVC_UUID == FALSE)
// {
// Copy results
// scanRes = pEvent->discCmpl.numDevs;
// memcpy(devList, pEvent->discCmpl.pDevList,
// (sizeof(gapDevRec_t) * scanRes));
// }
// Display_print1(dispHandle, 2, 0, "Devices Found %d", scanRes);
if (scanRes > 0)
{
SimpleBLECentral_connectToFirstDevice();
}
if (pEvent->gap.hdr.status == SUCCESS)
{
state = BLE_STATE_CONNECTED;
connHandle = pEvent->linkCmpl.connectionHandle;
procedureInProgress = TRUE;
// If service discovery not performed initiate service discovery
if (charHdl == 0)
{
Util_startClock(&startDiscClock);
}
Display_print0(dispHandle, 2, 0, "Connected");
Display_print0(dispHandle, 3, 0, Util_convertBdAddr2Str(pEvent->linkCmpl.devAddr));
SimpleBLECentral_Handler(1);
}
else
{
state = BLE_STATE_IDLE;
connHandle = GAP_CONNHANDLE_INIT;
discState = BLE_DISC_STATE_IDLE;
Display_print0(dispHandle, 2, 0, "Connect Failed");
Display_print1(dispHandle, 3, 0, "Reason: %d", pEvent->gap.hdr.status);
}
if(state == BLE_STATE_DISCONNECTING)
{
state = BLE_STATE_IDLE;
connHandle = GAP_CONNHANDLE_INIT;
discState = BLE_DISC_STATE_IDLE;
charHdl = 0;
procedureInProgress = FALSE;
keyPressConnOpt = DISCONNECT;
// Cancel RSSI reads
SimpleBLECentral_CancelRssi(pEvent->linkTerminate.connectionHandle);
Display_print0(dispHandle, 2, 0, "Disconnected");
Display_print1(dispHandle, 3, 0, "Reason: %d", pEvent->linkTerminate.reason);
Display_clearLine(dispHandle, 4);
Display_clearLine(dispHandle, 6);
}
}