IDBLUE logo
Public Member Functions | Protected Attributes
IDBlueResponse Class Reference
Inheritance diagram for IDBlueResponse:
GetBluetoothNameResponse GetEntryCountResponse GetStatusResponse IDBlueProperty NackResponse SendStatus SetPropertyResponse SimpleResponse TimestampResponse

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

Detailed Description

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.


Member Function Documentation

- (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.

Parameters:
packetThe response sent from an IDBLUE device
asyncWhether the response was sent asynchronously
Returns:
The initialized IDBlueResponse object, or nil if initialization failed.
- (BOOL) isResponseFor: (CommandIdentifier)  command

Get whether the current response is a response for the giveen command identifier

Parameters:
commandThe command identifier to check
Returns:
TRUE if the current IDBlueResponse is a valid response for the given command identifier, FALSE otherwise.
- (NSString *) message

Get the message of the current IDBlueResponse

Notify the given ResponseHandler of an asynchronous response

Parameters:
handlerThe handler to be notified of the asynchronous response
Returns:
TRUE if the handler was notified, FALSE otherwise

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


The documentation for this class was generated from the following files:

 

Generated on Mon Jan 19 2015 15:47:40
Copyright © 2015 Cathexis Innovations Inc. All Rights Reserved.