![]() |
Public Member Functions | |
(BOOL) | - successful |
(CommandStatus) | - status |
(void) | - setStatus: |
(NSString *) | - message |
(void) | - setMessage: |
(NSDate *) | - timestamp |
(CommandIdentifier) | - command |
(void) | - setCommand: |
(IDBluePacket *) | - packet |
(BOOL) | - isResponseFor: |
(BOOL) | - async |
(void) | - set: |
(id) | - initFromPacket:withAsync: |
(BOOL) | - notifyAsynchronousResponse: |
Protected Attributes | |
CommandStatus | _status |
CommandIdentifier | _command |
IDBlueResponse represents a response from an IDBLUE device. It can be used as a response to simple commands (i.e. commands that don't return any data in the payload), or it can be subclassed to process the data in the payload of an IDBluePacket.
- (BOOL) async |
Gets whether the current IDBlueResponse was sent asynchronously
- (CommandIdentifier) command |
Get the command identifier of the current IDBlueResponse. This may be different that the command identifier of the command sent to IDBLUE that resulted in the current response, in the event of a NACK response.
- (id) initFromPacket: | (IDBluePacket*) | packet | |
withAsync: | (BOOL) | async | |
Initialize the current IDBlueResponse from the given IDBluePacket. Override this method when sublcassing IDBlueResponse to process the payload of the IDBluePacket.
packet | The response sent from an IDBLUE device |
async | Whether the response was sent asynchronously |
- (BOOL) isResponseFor: | (CommandIdentifier) | command |
Get whether the current response is a response for the giveen command identifier
command | The command identifier to check |
- (NSString *) message |
Get the message of the current IDBlueResponse
- (BOOL) notifyAsynchronousResponse: | (id<IResponseHandler>) | handler |
Notify the given ResponseHandler of an asynchronous response
handler | The handler to be notified of the asynchronous response |
- (IDBluePacket *) packet |
Get the IDBluePacket the current IDBlueResponse was created from
- (void) set: | (BOOL) | async |
Set the async property
- (void) setCommand: | (CommandIdentifier) | command |
Sets the command identifier of the response
- (void) setMessage: | (NSString*) | message |
Set the message of the current IDBlueResponse
- (void) setStatus: | (CommandStatus) | status |
Sets the status of the current IDBlueResponse object, indicating the error code (or CS_Ok if successful).
- (CommandStatus) status |
Get the error code returned from the command snet to IDBLUE that resulted in the NACK
- (BOOL) successful |
Gets whether the command that the current IDBlueResponse belongs to is successful or not.
- (NSDate *) timestamp |
Get the date / time the current IDBlueResponse was created