39681

Bluetooth LE maximum transmission size

We are currently working with Bluetooth LE and want to send a 128 character string to a gatt service.

Now the Bluetooth Specs say that the maximum packet size of BLE is 22 bytes, my string will never fit in the packet.

We are thinking about chunking it up and send it in iterations.

Is this the usual way of doing things?

Answer1:

Yes, you need to chunk the data into 18 bytes pieces, then send a series of Prepare Write Requests to the Server. Each of this request has 3 parameters:

    <li>Attribute handle (2 bytes)</li> <li>Attribute offset (2 bytes)</li> <li>Data part (max 18 bytes)</li> </ul>

    So you would first send a packet with offset 0, then a packet with offset 18, then 36 etc. When you do that, the Server queues all your requests.

    In the end, you send an Execute Write Request and the Server writes all the bytes in one shot.

Recommend

  • Determining content length when not specified in HTTP
  • What's the reason why “text-float-text” guarantee 6 digit but “float-text-float” does 9?
  • Custom streaming to read BLOBS from MS-SQL - How should I handle the connection?
  • Application is not loading after upgrading to payara 4.1.1.171
  • Using BLE between devices with React Native
  • How do I multiply two integers where one is larger than 32 bits in MIPS?
  • Can't find mobile device when using Web Bluetooth API
  • MIPS questions about writing assembly to call functions on an array
  • How to printk the first 34 bytes (Ethernet and IP headers) of each packet (EtherType: 0x0806, Protoc
  • How to encode h.264 live stream to RTP packet with Java
  • RTCP receiver report sending interval
  • Working with a severely limited interpreted language
  • Redis scan skipping keys
  • Split an image into 64x64 chunks
  • How to use CompletableFuture without risking a StackOverflowError?
  • Spacing/Leading PdfPCell's elements
  • Accessing structure members with a pointer
  • Rewrite apply function to use recursion instead
  • How to redirect or show a page rather than “Forbidden” when i have directory listings off (htaccess/
  • Why are my web pages zoomed in when I open them in Opera Mobile?
  • How to resize image if the image is bigger than Textbox.But it not increase scale if smaller
  • CRASH: *** -[__NSArrayM objectAtIndex:]: index 4294967295 beyond bounds [0 .. 9]
  • Upper limits for fibonnacci
  • Serve file to user over http via php
  • Linking Ghostscript to pypdfocr in Windows Platform
  • How to merge keras sequential models with same input?
  • Prevent page break in text block with iText, XMLWorker
  • Javascript/Jquery runs fast in desktop browsers, but slow in mobile/smartphone browsers…should I spl
  • Can I read an iPhone beacon with Windows.Devices.Bluetooth.Advertisement.BluetoothLEManufacturerData
  • uniform generation of points on 3D box
  • SharedPreferences or SQLite Database?
  • copying resource to sdcard gives a damaged file in android
  • Spark fat jar to run multiple versions on YARN
  • Change multiple background-images with jQuery
  • Q promise. Difference between .when and .then
  • Android screen density dpi vs ppi
  • DirectX11 ClearRenderTargetViewback with transparent buffer?
  • Knitr HTML Loop - Some HTML output, some R output
  • Change an a tag attribute in JavaScript based on screen width
  • Is it possible to post an object from jquery to bottle.py?