2603 views|5 replies

9

Posts

0

Resources
The OP
 

Using the MS-formula library of st 3.1, the scan results do not contain the device name [Copy link]

 

I plan to connect Xiaomi's Bluetooth temperature and humidity monitor, as the title suggests, and basically did not change anything. I just ran it and found that there were only 2 items in the advertisement, but there were 3 items in the advertisement on the phone, and the last one did not appear. Does anyone know what's going on?

This post is from ST - Low Power RF

Latest reply

If you are a broadcaster and you see the above description, then you should know how to broadcast advertising data.   Details Published on 2020-3-29 10:46
 
 

9702

Posts

24

Resources
2
 

Can't see the picture

This post is from ST - Low Power RF
Personal signature虾扯蛋,蛋扯虾,虾扯蛋扯虾
 
 
 

51

Posts

0

Resources
3
 

Could you please describe the problem clearly.

I don't understand your question, I will try my best to tell you what I know.

1. BLE broadcast data format:

BLE broadcast data has a certain format, with a maximum length of 31 bytes, and consists of AD structs one by one. Each AD struct consists of length+AD Type+AD Data

For details, see Bluetooth core Advertising and Scan Response data format

2. Broadcast data analysis.

If the scanner scans such a string of broadcast data, how to parse it (the following format is processed in hexadecimal):

02 01 06 07 09 31 32 33 34 35 36 05 03 ff f0 ff f1 07 ff 80 ea ca 00 00 00

First, the data should be divided into several AD structs. According to 1, we know that the division is as follows:

len AD type AD data

02 01 06

07 09 31 32 33 34 35 36

05 03 ff f0 ff f1

07 ff 80 ea ca 00 00 00

AD type is used to represent different data types. For example, AD type = 0x09 represents the name of the device, and the data following it is the specific data of the name, here is "123456".

AD type = 0x01 represents Flags. Here 06 means that it supports discovery, supports BLE, but does not support BR/EDR single-mode chip.

AD type = 0x03 represents a complete 16-bit UUID list. There are two ff f0 and ff f1 (I have not actually checked the data format of the large and small segments, it may also be 0xf0ff and 0xf1ff, please try it yourself)

AD type can be found at the following link

https://www.bluetooth.com/specifications/assigned-numbers/generic-access-profile/

For details of AD data, please refer to the attached file CCS_v8.pdf (Supplement to the Bluetooth Core Specification)

3. Corresponding to the main function API in ST BLE stack

a. Search for methods that correspond to all the BLE functions you want to call in the stack. Please search in bluenrg1_api.h

b. Corresponding to all stacks, tell your function, please find it in bluenrg1_even.h

c. I won’t list the specifics one by one, I usually search by guessing keywords. For example, adv report.

This post is from ST - Low Power RF
 
 
 

51

Posts

0

Resources
4
 

Supplementary attachments

ce5b618576a8cd165c5e35f39aa410a.jpg (111.28 KB, downloads: 0)

ce5b618576a8cd165c5e35f39aa410a.jpg

CSS_v8.pdf

422.79 KB, downloads: 6

This post is from ST - Low Power RF
 
 
 

51

Posts

0

Resources
5
 

If you are a broadcaster and you see the above description, then you should know how to broadcast advertising data.

This post is from ST - Low Power RF
 
 
 

9

Posts

0

Resources
6
 

Finally I saw that adtype=4 will include the device name.

When adtype=0, there is no device name. In the demo, adtype=0 is recognized, so there is no way to match the device name.

This post is from ST - Low Power RF
 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list