I searched a bit and just found this as a possible duplicate question:
Multiple CBPeripheral for one device
My problem:
I have several services that all have about 30-40 characteristics (yes, I need all of them ...). As a starting point for working with CoreBluetooth, I always used the Apple code sample ( CoreBluetooth temperature sensor ).
Detection and maintenance / feature processing is divided into two classes, and this is great for multiple features. But processing this huge amount of features in one class is not what I mean by “good software”.
The first idea that comes to mind is to create one class for each service. But unfortunately, CBPeripheral can have one CBPeripheralDelegate at a time. This means that I cannot split it into several classes.
(We don’t need to start a discussion if BLE is the right technology to get this amount of data - it’s not. But there are manufacturers who use BLE, so they don’t have to bother with the MFi program ...)
I also read, finally, the CoreBluetooth Programming Guide , but it just describes the basic workflows - nothing about the right design.
I am looking for a good design. Can you have suggestions, tips or links to sample code? Thank you very much in advance!
ios architecture software-design core-bluetooth cbperipheral
orschaef
source share