DSPS central application

3 posts / 0 new
Last post
zwang308
Offline
Last seen:4 years 4 months ago
Master
Joined:2014-07-02 14:15
DSPS central application

Hi Dialog,

I am developing a BLE central device using DA14580 and taking the DSPS host application as the reference.

我注意到在“gapm_adv_report_ind_handler”功能, you filter devices according to whether they claim DSPS service in their advertising data.

I am wondering why the condition in if statement is ¶m->report.data[3] but not ¶m->report.data[0]. I mean why we have an offset 3 here.

if(!memcmp(¶m->report.data[3], APP_DFLT_ADV_DATA, APP_DFLT_ADV_DATA_LEN))

In DSPS device application, seems it copy advertise data into buffer directly with an offset 0:

cmd->info.host.adv_data_len = APP_DFLT_ADV_DATA_LEN;
memcpy(&cmd->info.host.adv_data[0], APP_DFLT_ADV_DATA, cmd->info.host.adv_data_len);

Thanks a lot!

Device:
MHv_Dialog
Offline
Last seen:1 month 2 weeks ago
Staff
Joined:2013-12-06 15:10
Hi,

Hi,

The first 3 bytes of the advertising data in an advertising report contains the flags. The first byte is the data length (0x02 - the length itself is not counted), the second byte is the type of data which isflags(0x01) and the third byte contains the flags (0x06).

When you build the advertising data package in the peripheral, the three bytes {0x02,0x01,0x06} are automatically placed by the SDK - you don't need to think about it.

Flags Data Type Octet Bit Description

0 LE Limited Discoverable Mode
1 LE General Discoverable Mode
2 BR/EDR Not Supported.
3 Simultaneous LE and BR/EDR
4 Simultaneous LE and BR/EDR to Same
5..7 Reserved

The flags set to 0x06 means

LE General Discoverable Mode &BR/EDR Not Supported.

zwang308
Offline
Last seen:4 years 4 months ago
Master
Joined:2014-07-02 14:15
Hi MHv_Dialog,

Hi MHv_Dialog,

Thanks a lot! That helps.