YMSCBDescriptor Class Reference
| Inherits from | NSObject |
|---|---|
| Declared in | YMSCBDescriptor.h YMSCBDescriptor.m |
Overview
Base class for defining a Bluetooth LE descriptor.
YMSCBDescriptor holds an instance of CBDescriptor (cbDescriptor).
The implementation of this class is TBD.
Other Methods
cbDescriptor
Pointer to actual CBDescriptor
@property (atomic, strong) CBDescriptor *cbDescriptorDiscussion
Pointer to actual CBDescriptor
Declared In
YMSCBDescriptor.h
UUID
Descriptor UUID
@property (atomic, readonly) CBUUID *UUIDDiscussion
Descriptor UUID
Declared In
YMSCBDescriptor.h
parent
Pointer to parent peripheral.
@property (atomic, weak) YMSCBPeripheral *parentDiscussion
Pointer to parent peripheral.
Declared In
YMSCBDescriptor.h
readCallbacks
FIFO queue for reads.
@property (atomic, strong) NSMutableArray *readCallbacksDeclared In
YMSCBDescriptor.h
writeCallbacks
FIFO queue for writes.
@property (atomic, strong) NSMutableArray *writeCallbacksDeclared In
YMSCBDescriptor.h
Issuing a Write Request
– writeValue:withBlock:
Issue write with value data and execute callback block writeCallback upon response.
- (void)writeValue:(NSData *)data withBlock:(void ( ^ ) ( NSError *error ))writeCallbackParameters
data |
The value to be written |
|---|---|
writeCallback |
Callback block to execute upon response. |
Discussion
Issue write with value data and execute callback block writeCallback upon response.
The callback block writeCallback has one argument: error:
erroris populated with the returnederrorobject from the delegate method peripheral:didWriteValueForCharacteristic:error: implemented in YMSCBPeripheral.
Declared In
YMSCBDescriptor.h
– writeByte:withBlock:
Issue write with byte val and execute callback block writeCallback upon response.
- (void)writeByte:(int8_t)val withBlock:(void ( ^ ) ( NSError *error ))writeCallbackParameters
val |
Byte value to be written |
|---|---|
writeCallback |
Callback block to execute upon response. |
Discussion
Issue write with byte val and execute callback block writeCallback upon response.
The callback block writeCallback has one argument: error:
erroris populated with the returnederrorobject from the delegate method peripheral:didWriteValueForCharacteristic:error: implemented in YMSCBPeripheral.
Declared In
YMSCBDescriptor.h
Issuing a Read Request
– readValueWithBlock:
Issue read and execute callback block readCallback upon response.
- (void)readValueWithBlock:(void ( ^ ) ( NSData *data , NSError *error ))readCallbackParameters
readCallback |
Callback block to execute upon response. |
|---|
Discussion
Issue read and execute callback block readCallback upon response.
The callback block readCallback has two arguments: data and error:
datais populated with thevalueproperty of [YMSCBCharacteristic cbCharacteristic].erroris populated with the returnederrorobject from the delegate method peripheral:didUpdateValueForCharacteristic:error: implemented in YMSCBPeripheral.
Declared In
YMSCBDescriptor.h
Callback Handler Methods
– executeReadCallback:error:
Handler method to process first callback in readCallbacks.
- (void)executeReadCallback:(NSData *)data error:(NSError *)errorParameters
data |
Value returned from read request. |
|---|---|
error |
Error object, if failed. |
Discussion
Handler method to process first callback in readCallbacks.
Declared In
YMSCBDescriptor.h
– executeWriteCallback:
Handler method to process first callback in writeCallbacks.
- (void)executeWriteCallback:(NSError *)errorParameters
error |
Error object, if failed. |
|---|
Discussion
Handler method to process first callback in writeCallbacks.
Declared In
YMSCBDescriptor.h