Skip to content
liuyanwei edited this page Sep 29, 2015 · 2 revisions

verb

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 sequence

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
Clone this wiki locally