Added BLE_StopScanning() to support testing.
This commit is contained in:
parent
25e4cff3ac
commit
3ce181656f
6 changed files with 52 additions and 2 deletions
|
@ -192,6 +192,22 @@ void COMM_BLE_Task(void * pvParameters)
|
|||
|
||||
switch (command.ID)
|
||||
{
|
||||
case COMM_BLE_STOP_SCANNING:
|
||||
{
|
||||
cy_en_ble_api_result_t apiResult = Cy_BLE_GAPC_StopScan();
|
||||
|
||||
if (apiResult != CY_BLE_SUCCESS)
|
||||
{
|
||||
#ifdef TRACE_BLE
|
||||
COMM_Console_Print_String("[BLE] Cy_BLE_GAPC_StopScan API Error: 0x");
|
||||
COMM_Console_Print_UInt32AsHex(apiResult);
|
||||
COMM_Console_Print_String("\n");
|
||||
#endif // TRACE_BLE
|
||||
}
|
||||
COMM_BLE_RequestState(COMM_BLE_IDLE);
|
||||
}
|
||||
break;
|
||||
|
||||
case COMM_BLE_STOP_ADVERTISING:
|
||||
{
|
||||
cy_en_ble_api_result_t apiResult = Cy_BLE_GAPP_StopAdvertisement();
|
||||
|
@ -340,6 +356,14 @@ SystemKResult_T BLE_StopAdvertising(void)
|
|||
return SYSTEMK_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
SystemKResult_T BLE_StopScanning(void)
|
||||
{
|
||||
COMM_BLE_Command_T command = { .ID = COMM_BLE_STOP_SCANNING, .Data = (void *)0x00 };
|
||||
xQueueSend(COMM_BLE_CommandQueue, &command, 0);
|
||||
|
||||
return SYSTEMK_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
void COMM_BLE_RequestState(COMM_BLE_StateID_T state)
|
||||
{
|
||||
Next_State = state;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue