11

According to the BLE patent, the size of data in a BLE packet is 47 bytes. However, Android exposes only 20 bytes of data.

Community
  • 1
  • 1
Augustin
  • 2,444
  • 23
  • 24
  • hi which packets are you talking about. is it the scan record or the data transmitted via characteristic read/write? – Neo Dec 04 '15 at 15:34

2 Answers2

4

The standard format for the BLE packet in data transmission protocol is:

Command Byte (1 byte) + Device Identification ID (2 bytes) + Data (12-16 bytes) + CheckSum(1 byte)

Command section: These will be hex values that you have to specify according to the type of command (eg. Device Name, Factory Information, Temperature and Humidity data etc.)

Device Identification ID: This will consist of the UUID of the receiving device (it can be 16 bit if its a SIG Group Generated UUID or 128 bit if you are testing)

Data Section: This part will contain all the data that you want to send (it can be between 12 and 16 bytes, although it is recommended that you fix the length of the data packet)

CheckSum: For error correction. You can use a different mechanism but then you will have to adjust your data part accordingly)

You have to define a custom gatt profile and server if you are planning to implement something that doesn't already have an existing profile on the SIG Bluetooth Site.

P.S. Read up more on the device specifications of your external device and also check out the core specs on the bluetooth website. Everything you do must conform to their standards

Alright, Hope this helped.. Cheers!

Jobs
  • 628
  • 7
  • 27
  • p.p.s The Bluetooth Core Specification is not for the faint of heart! Its a huge document, but it goes into total detail... – Jobs Dec 04 '15 at 06:39
2

Basically the BLE packet (delivered as scan record to android APIs) is as far as I know just standard BLE, just as with any other platform.

i.e. it consists of items, and each item consist of 3 items in following order:

  1. 1 byte data length value
  2. 1 byte type as defined in : GATT profile
  3. data, the length is defined by the 1 byte length value

With my tests on BLE I actually see that the scan record that I get is actually longer than I can advertise. So I would assume that you can see beacons & BLE devices advertising with more than 31 bytes even with android devices.

But the BluetoothLeAdvertiser API will only allow you to have 31 bytes in the advertisement scan record you are advertising from android device.

I would not have any good reasoning why the limit is 31 bytes, I just have tested that it is enforced that way.

Dr.Jukka
  • 2,346
  • 2
  • 15
  • 20