-
Notifications
You must be signed in to change notification settings - Fork 1k
methor_in_serial
liuyanwei edited this page Sep 29, 2015
·
2 revisions
in baby.().().() , the verb method and,then,with can improve code readability 。
example:
baby.having(self.p).and.channel(channelOnPeropheralView).
then.connectToPeripherals().discoverServices().discoverCharacteristics()
.readValueForCharacteristic().discoverDescriptorsForCharacteristic().readValueForDescriptors().begin();
serial method in baby.().().() according to corebluetooth’s sequence and limit . the sequence is scanfor->discover peripheral -> connect peripheral ->discover service ->discover characteristic->read characteristic value or discover characteristic's descriptors -> read descriptor's value
rule:
- begin() or stop() must end of serial
- having(),channel() must before begin()
- without peripheral having(instance of peripheral), connectToPeripherals() is forbid
- without connect peripheral ,discoverServices() is forbid
- without discoverServices() or discoverCharacteristics() , readValueForCharacteristic() 、discoverDescriptorsForCharacteristic()、readValueForDescriptors() is forbid
- without discoverCharacteristics(),readValueForCharacteristic() or discoverDescriptorsForCharacteristic() is forbid
- without discoverDescriptorsForCharacteristic(),readValueForDescriptors() is forbid