IDBLUE logo
Public Member Functions
IDBlueResponseProcessor Class Reference
Inheritance diagram for IDBlueResponseProcessor:
<IDataHandler>

Public Member Functions

(ResponseFactory *) - responseFactory
(PropertyGenerator *) - propertyGenerator
(id) - initWithCommandQueue:withReceiveBuffer:withResponseFactory:withPropertyGenerator:
(BOOL) - addHandler:
(BOOL) - removeHandler:
(BOOL) - hasHandler:
(ResponseHandlerCollection *) - handlers
(NSString *) - incomingBufferContents
(int) - incomingBufferCount
(void) - onPacketReceived:withHandler:
(BOOL) - notifyAsyncResponse:
(BOOL) - notifySyncResponse:

Detailed Description

IDBlueResponseProcessor is responsible for converting incoming data from IDBLUE into IDBlueResponse objects and notifing listeners of received responses


Member Function Documentation

- (BOOL) addHandler: (id<IResponseHandler>)  handler

Add an ResponseHandler to the list of handlers that are notified of respones received from an IDBLUE device.

Gets the array of ResponseHandler objects

- (BOOL) hasHandler: (id<IResponseHandler>)  handler

Determines if the given ResponseHandler is contained in the list of handlers that are notified of responses received from an IDBLUE device.

- (NSString *) incomingBufferContents

Gets the data in the incoming buffer, in hex format

Gets the number of bytes in the incoming buffer

- (id) initWithCommandQueue: (CommandQueue*)  queue
withReceiveBuffer: (PacketQueue*)  receiveBuffer
withResponseFactory: (ResponseFactory*)  factory
withPropertyGenerator: (PropertyGenerator*)  generator 

Initialize an IDBlueResponseProcessor with the given CommandQueue

Parameters:
queueThe CommandQueue that will hold commands sent to IDBLUE, awaiting responses
receiveBufferThe PacketQueue that will be used to store incoming data, and convert the bytes into IDBluePackets.
factoryThe ResponseFactory that creates IDBleuResponse objects
generatorThe PropertyGenerator that creates IDBlueProeprty objets
- (BOOL) notifyAsyncResponse: (IDBlueResponse*)  response

Notifies all ResponseHandler objects (registered with addHandler or passed into the constructor) of an asynchronous response from an IDBLUE device. notifyAsyncResponse is called from within IDBlueCommandSender afer a call to onDataReceived if the incoming data is an asynchronous response (e.g. a the user presses the front button of IDBLUE, resulting in a tag scan being sent back to the host).

Parameters:
responsethe asynchronous response received from an IDBLUE device.
Returns:
TRUE if an ResponseHandler was notified of the response, FALSE otherwise.
- (BOOL) notifySyncResponse: (IDBlueCommand*)  command

Notifies the ResponseHandler assigned to the IDBlueCommand sent to IDBLUE that a synchronous response has been received (a synchronous response is a response sent from an IDBLUE device in response to an IDBlueCommand).

Parameters:
commandThe IDBlueCommand object that was sent to IDBLUE that received the response (use the method [command response] to get the IDBlueResponse).
Returns:
TRUE if an IDBLUE handler was notified, FALSE otherwise
- (void) onPacketReceived: (IDBluePacket*)  packet
withHandler: (id<IResponseHandler>)  handler 

Notifies the given ResponseHandler that an IDBluePacket has been received from IDBLUE. onPacketReceived is called from within IDBlueCommandSender. It should not be called externally.

Parameters:
packetthe IDBluePacket received from IDBLUE
handlerthe ResponseHandler object to notify
- (BOOL) removeHandler: (id<IResponseHandler>)  handler

Removes an ResponseHandler from the list of handlers that are notified of responses received from an IDBLUE device.

Gets the ResponseFactory


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.