I would like to write an iOS APP to transfer some data to an embedded BLE Module and vice versa. To get the best structure of my data stream, I create my own characteristics and services with its corresponding UUID's. So far, everything is all right! But what happens, if I would like to add a second BLE Module without change my hard coded UUID's in my embedded BLE Module? Do I have to generate completely new UUID's for each BLE Module I would like to add? In this case I have to change my iOS App too, because I have to change my expected UUID's for the specific services and characteristics or? Thanks!
Asked
Active
Viewed 2,032 times
1 Answers
1
No you don't have to generate new UUID's for each BLE Module. Thats not the way it is designed to operate. Just make sure that you don't re-use the same UUID for any of the characteristic within the same BLE module.
Thumb rule:
- I can't have a BLE module having two characteristics having the same UUID.
- I can't have a BLE module having two services having the same UUID.
- I can't have a BLE module having a UUID used once for a service and the same for a characteristics.
- I can definitely have theoretically infinite number of BLE modules having same GATT structure (that includes all the UUIDs).
This is possible since the GATT Client (the application) distinguishes and accesses the connected GATT Servers by means of connection handles, which are out of scope from other GATT servers connected to the same application.

WedaPashi
- 3,561
- 26
- 42
-
Ahh ok! So I will generate some different UUID's for all my services and characteristics once and implement them into all my BLE Modules. So I can filter every time the same UUID's with my APP. Thats's clear! But I haven't understood your last sentence. How can I distinguish two different BLE Modules with the same UUID's for there services and characteristics and maybe the same name? Is there any other ID I can trigger for? – Sep 23 '15 at 10:49
-
First, why would *you* have to do it when probably the stack (on android or iOS or whatever smartphone OS you are using) does it for you. When the smartphone app scans for BLE Modules nearby, if there are 2 modules with same GATT structure and the same device name, they still are accessed through two different handles. So the two (or more) identical modules can be connected with the application without *you* having the need to distinguish between the two. All you as a developer need to do is use their respective device handle objects. – WedaPashi Sep 23 '15 at 10:53
-
If you are asking how stack knows that there are two modules nearby, (with Identical GATT or not) then you know that it is managed by means of MAC Addresses which are always unique and not configurable for user. – WedaPashi Sep 23 '15 at 10:57
-
Okay that's my answer! One more question in the same direction. When I generate the different UUID's for my services and characteristics are there any rules to differ between services and characteristics and to differ between different services? For example, I generate this UUID: 8226 ????-61e4-11e5-9d70-feff819cdc9f I have often seen, that only the marked digits differ.. is that correct? – Sep 23 '15 at 11:16
-
No, no restriction there. I have used close to 60 UUIDs generated at once using a uuid generator website, and got them into a txt file and used them without giving thought. If you generate them in a file, you'll get them in series. Use them in whatever way you like. The system need a 128-bit long identifier which is not used with that module previously, thats it. – WedaPashi Sep 23 '15 at 11:22
-
Thank you for your time! That's all I would like to know! – Sep 23 '15 at 12:59
-
Welcome. Hope it helps. – WedaPashi Sep 23 '15 at 13:25
-
Maybe you could help me one more time ;) If you have heard something about the MLDP of Microchip I would appreciate if you answer this question, too: [link](http://stackoverflow.com/questions/32741990/private-microchip-low-energy-data-profile-mldp-for-ios-apps) – Sep 23 '15 at 17:13
-
Sorry about that, but I have to ask one more question to understand the background. In my first comment I asked if I could use always the SAME UUID's for all my modules (and also the same services and characteristics / but that is clear!). So the last evening I searched for all BLE devices I could find. I found two Apple TV's with different peripheral.identifier (I think this is the UUID). Why use Apple different UUID's for the same device type if they could use always the same?? – Sep 24 '15 at 13:45
-
Is Peripheral.identifier a uuid? I don't think so. – WedaPashi Sep 24 '15 at 14:46
-
Bit it's type is NSUUID and it looks like a uuid :p so what is it? – Sep 24 '15 at 15:34