DSPS Central - obtain Peripheral device name using GAPM_SCAN_ACTIVE

4 posts / 0 new
Last post
MSun
Offline
Last seen:9 months 6 days ago
加入:2015-11-30 22:40
DSPS Central - obtain Peripheral device name using GAPM_SCAN_ACTIVE

I am making a small modification to the working DSPS Central application, based on SDK5 to allow it to report back to my application the scanned peripheral device names during scanning.

Before making modifications, I used the Connection Manager application to first verify I can report this information from my (DSPS) peripheral device.

In Connection Manager, I, set it to "Boot as Central". Using an Active Scan.
I am successfully able to see 2 advertising reports reported by my Peripheral, indicating first UUID information, and then subsequentyly the Device Name information ... see log below ...

====> [13:24:56.677] Tx <====
Src Task : 0x3f (TASK_APP)
Dst Task : 0xd (TASK_GAPM)
Msg Id : 0x340f (GAPM_START_SCAN_CMD)
Own Add Type : 0x0 (ADDR_PUBLIC)
Payload : 0f 34 0d 00 3f 00 14 00 10 00 00 00 00 00 00 00 00 00 00 00 10 00 10 00 00 00 01 00

====> [13:24:56.716] Rx <====
Src Task : 0xd (TASK_GAPM)
Dst Task : 0x3f (TASK_APP)
Msg Id : 0x3410 (GAPM_ADV_REPORT_IND)
Evt Type : 0x0
Addr Typ : 0x0
Bd Addr : 80:ea:ca:00:00:00
Rssi : 0x89
Data Len : 0x15
Data : 02 01 06 11 07 b7 5c 49 d2 04 a3 40 71 a0 b5 35 85 3e b0 83 07
Payload : 10 34 3f 00 0d 00 29 00 00 00 00 00 00 ca ea 80 15 02 01 06 11 07 b7 5c 49 d2 04 a3 40 71 a0 b5 35 85 3e b0 83 07 00 00 00 00 00 00 00 00 00 00 89

====> App Info <====
Advertising data
Flags: LE General Discoverable Mode, BR/EDR Not Supported
128-bit Service UUIDs: 0783B03E8535B5A07140A304D2495CB7

====> [13:24:56.728] Rx <====
Src Task : 0xd (TASK_GAPM)
Dst Task : 0x3f (TASK_APP)
Msg Id : 0x3410 (GAPM_ADV_REPORT_IND)
Evt Type : 0x4
Addr Typ : 0x0
Bd Addr : 80:ea:ca:00:00:00
Rssi : 0x8a
Data Len : 0x12
Data : 11 09 53 6f 6c 65 4f 4e 45 5f 50 51 52 53 54 55 5f 4c
Payload : 10 34 3f 00 0d 00 29 00 04 00 00 00 00 ca ea 80 12 11 09 53 6f 6c 65 4f 4e 45 5f 50 51 52 53 54 55 5f 4c 00 00 00 00 00 00 00 00 00 00 00 00 00 8a

====> App Info <====
Advertising data
Device Name: SoleONE_PQRSTU_L

Now I undertook to make modifications to my DPSP Central application.

In user_config.h, I changed the scan mode to GAPM_SCAN_ACTIVE.

Now in user_sps_host.c, when scanning my peripheral, I see 2 callbacks into user_on_adv_report_ind()
The first has evt_type 0, and the second has evt_type 4, as expected.
First event reports properly my BT addr, UUID and RSSI
Second event reports properly my BT addr, RSSI ....... but report.data_len = 0, and hence there is no Device Name populated into the report.data[] array.

=========================================================================================================================
Questions:

Is there anything else I am missing in doing an Active Scan to report my Peripheral's Device Name ?

For the Connection Manager DA14580 application, I have the binary/hex file full_emb.hex
Is there source code for this DA14580 application ... I could wade through that code to see why it is able to successfully report my Peripheral's Device Name.

Thanks.

Device:
Gongyu_Dialog
Offline
Last seen:3 days 18 hours ago
加入:2016-04-27 07:07
As a peripheral device, we

As a peripheral device, we add the name info in the micro-definition of the USER_ADVERTISE_SCAN_RESPONSE_DATA. (file user_config.h"
But for other devices, they might not add the name info in the scan_rsp packet.

MSun
Offline
Last seen:9 months 6 days ago
加入:2015-11-30 22:40
My peripheral device is

My peripheral device is simply a DA14580-EVKT-B board, running the DSPS sps_device SDK5 application.

As shown with Dialog "Connection Manager", the "Connection Manager" is able to successfully do an active scan, and detect the peripheral Device Name from the actively scanned DSPS sps_device application.
So the peripheral is supplying Device Name properly.

But when I modify the DSPS sps_host SDK5 application to perform active scanning, the scan request response response is showing an empty string for the Device Name.

MSun
Offline
Last seen:9 months 6 days ago
加入:2015-11-30 22:40
Issue is solved.

Issue is solved.

我认为这是只有wh显示空字符串en I had a breakpoint set in the user_on_adv_report_ind() function.
Once I took away breakpoint, and let code run uninterrupted, then DeviceName was being properly reported.

Thanks.