Bluetooth LE Advertising Packets: where to find the preamble, MAC address, and CRC? - bluetooth

Does anybody have the BLE Advertising Packet format that shows the relation (e.g. a hierarchy graph) among packet preamble, MAC address, and CRC fields? A graph that shows the length of bits for each field would be the best.

This is written in the Bluetooth Core
Specification https://www.bluetooth.com/specifications/specs/core-specification/ in the Link Layer chapter, section 2.1.
The advertising bluetooth device address is found in section 2.3.1.1 (ADV_IND).

Related

yj-16009 iBeacon Proximity BLT beacon

I'm making a project with Esp32 whroom, so I bought the yj-16009 iBeacon DataSheet and I'm trying to get it to work as wireless Bluetooth proximity sensor like in this Video
I used the this code from the video and the esp32 is monitoring and showing BLT scanning results like this the results shown are after I turned off any BLT device around so first I don't understand what it is reading, and second after I turn on the iBeacon the results remain with the same range of numbers no matter if I get the iBeacon closer or farther, therefor I came to the conclusion that it doesn't recognize the iBeacon sensor for some reason.
I also download an app named LightBlue which does recognize the iBeacon sensor.
My question is if anyone knows how to make the esp32 recognize the iBeacon sensor. Another thing I tried to find any information about this sensor and there is no info about it anywhere. I have read on other questions here that it might need to be programmed somehow which I don't know how to do because there is no info online. So if anyone is familiar with this kind of sensor and can help me figure how to make the ibeacon to work like the video above as a Bluetooth Proximity device it would be a blessing.
The code you reference is just scanning for any BLE advertisements (iBeacon or otherwise) and printing out the RSSI signal strength of each detection. The reason you do not see the RSSI change when you move the beacon is because the ESP32 is probably picking up non-iBeacon adverts from your phone, laptop and other Bluetooth enabled devices in the vicinity which are not moving (there are more around you than you think!)
In order to make the device detect iBeacon only (and not all the other devices) you need to change the C code to do a few more things:
Access the bytes of the advertisement payload and use them as follows:
Compare the beginning of these bytes to see if they include the iBeacon byte sequence FF 4C 00 02 15
If the above byte sequence is not in the advertising data, ignore that detection — it is not an iBeacon advert
If it does include that byte sequence, decode the next 16 bytes as the iBeacon uuid, the next two bytes as the major and the next two bytes as the minor. See my answer here: What is the iBeacon Bluetooth Profile
Print out the identifiers along with the RSSI that the code already prints.

what does bluetooth transmit when it is just visible

I want to know what does bluetooth transmit when it is just visible, not connected. I googled , I saw it transmit name of the device and mac address but just them ? Can we add some extra datas or can we change them dynamically ?
For classic Bluetooth (i.e. pre Android API level 21), you are restricted with the data that you can send in the inquiry response (which is connection-less data sent over the air). There are three types of inquiry response data that can be sent over the air:-
Inquiry Result:-
Inquiry Result with RSSI:-
Extended Inquiry Result:-
In other words, depending on what the scanning device asks for, the result can be different, and even though in all cases it is not just name and mac address, you cannot add just random extra data to the inquiry response.
For Bluetooth Low Energy (i.e. Android API level 21 and later), advertising data can be dynamic and can be configurable. The minimum advert report can only contain the device's Bluetooth Address (either the public or the random address). In other words, even the name of the device is not a requirement. However, it is usually common to include both the address and the name as this gives more information about the advertising device.
You can read more about this in the Bluetooth Specification v5.2, Vol 6, Part B, Section 2.3.1 (Advertising PDUs). Also have a look at the links below for more information:-
Is a BLE advertisement required to provide a non-empty local name
How BLE works: advertisements
BLE advertising primer

Is BT Address the same as MAC Address?

I was trying to figure out the BT Address of a device and then got in trouble while finding that it follows IEEE 802-2014 standard as well as MAC Address hence which is the difference within MAC Address and BT Address:
Can a phone device (let's say) have BT Address and MAC Address?
If so which would be the impact of having either same MAC Address or BT Address within 2 devices?
Bluetooth addresses are indeed drawn from the same space as the MAC addresses you might be more familiar with -- those on Ethernet adapters or 802.11 WiFi interfaces. In order to assign an address to a Bluetooth interface on say, a phone, the manufacturer must purchase the right to do so from the IEEE in the same way that they must register some portion of the space to assign MAC addresses to 802.11 interfaces. Because of this, it's common to say "Bluetooth MAC", at least in my own experience. The Bluetooth Core Specification says this:
The BD_ADDR shall be created in accordance with Section 9.2 (“48-bit univer-
sal LAN MAC addresses”) of the IEEE 802-2001 standard (http://stan-
dards.ieee.org/getieee802/download/802-2001.pdf) and using a valid
Organizationally Unique Identifier (OUI) obtained from the IEEE Registration
Authority (see http://standards.ieee.org/regauth/oui/forms/ and sections 9 and
9.1 of the IEEE 802-2001 specification).
If a phone has both a Bluetooth and 802.11 chipset, it must have unique hardware identifiers for both. In practice, what I have seen is that manufacturers will assign MAC address X to the 802.11 interface, and MAC address X+1 to the Bluetooth interface on the same phone or vice versa; for example, WiFi MAC 00:11:22:33:44:00 and Bluetooth MAC 00:11:22:33:44:01. There's nothing stating that they must do this, but it seems to be a pretty standard way of divvying up their IEEE allocations.

How to get HDMI Port info from EDID block?

I am trying to get the HDMI port from the EDID data. So far I have taken the EDID data by connecting to different HDMI ports (say 1,2,3,4).When I compared the data, I can find the 0xAA byte of EDID data is varying for each port with the values 0x10,0x20,0x30,0x40 respectively. When I searched for the CEA-861-E details of EDID, the address oxAA is reserved field. Below is the link for CEA-861 specification I referred.
[http://electronix.ru/forum/index.php?act=Attach&type=post&id=77872][1]
So my question is, how to know the port ID for the HDMI from EDID data? Is my understanding based on my experiment correct?
Your suggestions are highly appropriated.
Cheers,
Gopinath
It can be found in the vendor specific data block. A "Vendor Specific Data Block" (if any) contains as its first three bytes the vendor's IEEE
24-bit registration number, LSB first. For HDMI, it is always 00-0C-03 for HDMI Licensing, LLC.
It is followed by a two byte source physical address, LSB first. The source physical address provides the CEC physical address for upstream CEC devices.
For more details, please refer the below post. http://www.bitsandqubits.com/2017/06/detecting-hdmi-port-id-from-edid-data.html

bluetooth module HM-15 and Arduino scanning for iBeacons

I bought a HM-15 BLE bluetooth module and successefully connected to Arduino. I am able to sent At commands and I would like to use it for scanning for iBeacons and get their major and minor.
Using AT+DISC? I can see the beacon address but I cannot connect to it and now I am stuck on how to retrieve major and minor
Can you help me? Here is the datasheet of the module:
http://www.elecrow.com/download/bluetooth40_en.pdf
Thanks
Bluetooth beacons do not require a connection and you read the identifiers directly from the advertisement.
Read section 19, Start a discovery scan, and learn how to read and decode the bytes in the discovered peripherals. The exact byte layout varies for different beacon types. For AltBeacon, an open source beacon variant, you can see the byte layout here: https://github.com/AltBeacon/spec
To decode a proprietary beacon format, you will need to learn how that beacon layout differs from the example linked above.
Old question, but just for the record, you can use AT-DISI?
This will scan for beacons, including iBeacons and also AltBeacons. The response from HM-10 will include RSSI for each.
PS: I'm assuming HM-15 and HM-10 operate the same way. Probably not exactly a fully reasonable assumption.

Resources