I am looking to create a cross-platform application that allows me to periodically advertise the devices Mac address(though I have realized for some reason I receive 3 for a single device.) so that it can be recorded and used to reference short manual user advertisement such that each advertisement can be identified by a specific user; however, It seems as though I have fallen into issues regarding UUIDs on BLE
After searching for a while I still seem to be a bit confused regarding UUID's in the BLE service. Originally I decided to use a custom BLE which repeatedly failed to advertise either with an odd error or due to the packet being to large even though the data was only 1 byte long. I realized that the UUIDs must be in the form xxxxxxxx-0000-1000-8000-00805F9B34FB
. Anything outside of this will send the full UUID which is too large when advertising without being connected. I have also found that I can use any UUID prefix in the upper half (0000XXXX
) that is not in the reserved range 0x000E
– 0x01FF
.
Is this a correct assumption and I can use any UUID that does not conflict with the criteria i.e 00000200 - 0000FFFF. I ask because I seem to fall into issues when choosing a UUID in that range and as I understand creating custom UUID's outside the range is a bad idea on BLE since it would be forced to use 16 of the 20-23 bytes available. Any input regarding this?
Also Is their a predefined way to send advertisement's of the user device so that it can be cached and used to identify other user advertisements?
EDIT:
There arrives a need in the project to connect phones cross-platform along with other equipment in an connectionless manner. Initially I planned for a device to repeatedly advertise it’s identity along with a name and unique MAC address that can be used to identify user messages uniquely. Any device without the cached user identity would simply drop incoming packet’s from that user. – kdgwill 9 mins ago
I actually think it would be easier if I could somehow connect to 5-10 devices at a time; however, the idea is not to bother users w/ repeated prompts when new devices are added. As such I figured using advertising and flooding would help but msg sizes vary. Is it possible bother the user once for a connection prompt and autoconnect each additional BLE device. If I could somehow connect multiple devices on a 1 to 1 basis without having to prompt the user each time while still scanning for other possible connections to be made that would be very useful but I do not think BLE allows for that. – kdgwill 8 secs ago edit
Using the identifierForVendor or CBAdvertisementDataServiceUUIDsKey is a great way to uniquely identify each user; however, that would mean that if I don't use 1 of the registered UUIDs which I can probably just randomly choose one for the time being. that the overhead would be either 4-16 + however many bytes it takes to identify each packet.