-
-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Previously the MTU (maximum size of BLE packet) was being ignored. By default the BLE MTU is 23. Each BLE packet has 3 header bytes. So unless the client says it can handle a larger MTU the server (WiCAN) can only send 20 bytes at a time. On Android apps have to specify what size MTU they want to use, or it stays the default. On iOS, apps can't choose. iOS always negotiates a size between 185 and 247. This code now pays attention to the MTU fro the client. The old code might pack multiple messages into one BLE packet, but it would never split a message across two or more BLE packets. This code now packs as many bytes into each BLE packet as it can. If the message doesn't fit in one packet, it will be split across multiple packets.
- Loading branch information
Showing
1 changed file
with
85 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters