ios - Wait for peripheral:didUpdateValueForCharacteristic:error: with sync request -


what best approach dealing core bluetooth delegate sync request? requirements have implement following method:

-(nsdata *)datawithrequest:(nsdata *)request             characteristic:(cbcharacteristic *)characteristic {      [_peripheralactive writevalue:request                 forcharacteristic:characteristic                              type:cbcharacteristicwritewithoutresponse];     // how wait response _mydata here?     return _mydata; } 

// cbperipheraldelegate adopt

-(void)peripheral:(cbperipheral *)peripheral didupdatevalueforcharacteristic:(cbcharacteristic *)characteristic              error:(nserror *)error {     // staff     _mydata = characteristic.value; } 

any waiting in same tread/queue block delegate, waiting in tread/queue return current _mydata. please.


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -