Error about GAPM_START_SCAN_CMD

5 posts / 0 new
Last post
圣one_wang
Offline
Last seen:1 year 3 days ago
加入:2015-10-23 03:55
Error about GAPM_START_SCAN_CMD

DA14580Firmware : .. \DA14580_581_583_SDK_3.0.10.1\dk_apps\keil_projects\proximity\prox_monitor_ext_usb\Keil_5
PCTool : ..\DA14580_581_583_SDK_3.0.10.1\host_apps\windows\proximity\monitor\host_proxm_sdk
In the PC project ,there is a function :
void app_inq(void) // it send a command:GAPM_START_SCAN_CMD
{ .... }
but after about 7 seconds or 8 seconds ,receive a message :

gapm_cmp_evt_handler (ke_msg_id_t是否,
struct gapm_cmp_evt *param,
ke_task_id_t dest_id,
ke_task_id_t src_id)
param->operation = GAPM_SCAN_ACTIVE
param->status = 0x45(69),
why the param->status is not equal to CO_ERROR_NO_ERROR ??
what does the 0x45 means ?

Device:
MT_dialog
Offline
Last seen:2 months 2 days ago
圣aff
加入:2015-06-08 11:34
Hi Stone_wang,

Hi Stone_wang,

The scanning procedure completes after approximatey 10 seconds automatically and triggers the completetion of the operation. The status code of the operation (0x45 GAP_ERR_TIMEOUT) declares that the Scanning operation was ended due to timeout (since the operation lasts only for 10 seconds). You can find the GAP error codes in the RW-BLE-GAP-IS.pdf.

Thanks MT_dialog

圣one_wang
Offline
Last seen:1 year 3 days ago
加入:2015-10-23 03:55
Hi,MT_dialog

Hi,MT_dialog
Yes,The scanning procedure completes after approximatey 10 seconds automatically and triggers the completetion of the operation. but why I send GAPM_START_SCAN_CMD command ,it always lasts only for 7-8 seconds ?
when I use sdk 5.0.4 it is the same error ,I don't know why .Thanks.

MT_dialog
Offline
Last seen:2 months 2 days ago
圣aff
加入:2015-06-08 11:34
Hi Stone_wang,

Hi Stone_wang,

This is not an error, this is by design of the stack (actually the 10 seconds aren't exactly 10 but 7-8 seconds), if you have a central and you start the scanning in GAP_GEN_DISCOVERY this is the amount the device will contiunsly scan, then the operation will finish and the callback will occur with "timeout" status. From the callback you can restart the scanning procedure. For scanning contiously you can use the GAP_OBSERVER_MODE that doesn't timeout and you can only stop it using the GAPM_CANCEL_CMD (the later option will scan for any advertising report data).

Thanks MT_dialog

圣one_wang
Offline
Last seen:1 year 3 days ago
加入:2015-10-23 03:55
ok,I understand ,Thank a lot。

ok,I understand ,Thank a lot。