RobotKit API
Public Member Functions | Static Public Member Functions
RKDeviceMessenger Class Reference

Singleton to provide a messaging framework for command and responses. More...

#import <RKDeviceMessenger.h>

List of all members.

Public Member Functions

(void) - postCommand:
(void) - postCommand:delay:
(void) - addResponseObserver:selector:
(void) - removeResponseObserver:
(void) - addDataStreamingObserver:selector:
(void) - removeDataStreamingObserver:

Static Public Member Functions

(RKDeviceMessenger *) + sharedMessenger

Detailed Description

Use to listen to command responses and streaming data.


Member Function Documentation

- (void) addDataStreamingObserver: (id)  observer
selector: (SEL)  handler 

Adds an observer for data streaming. Data streaming are packets of data that is sent from the device without being commanded.

Parameters:
observerThe observer. Only one selector per observer is allowed.
handlerA selector of the form - (void)handDataStreaming:(RKDeviceAsyncData *)data
- (void) addResponseObserver: (id)  observer
selector: (SEL)  handler 

Adds an observer for response objects return for commands.

Parameters:
observerThe observer for responses.
handlerA selector that will be called on the observer with a signiture of -handleResponse:(RKDeviceResponse *)response.
- (void) postCommand: (RKDeviceCommand *)  command

Method for posting a command in the command queue to be sent to a robot.

Parameters:
commandThe command object to post to the command queue.
- (void) postCommand: (RKDeviceCommand *)  command
delay: (NSTimeInterval)  delay 

Method for posting a command in the command queue to be sent to a robot with a delay.

Parameters:
commandThe command to post to the command queue.
delayA delay in seconds before the command is queued.
- (void) removeDataStreamingObserver: (id)  observer

Removes an observer from receiving asynchronize data @

Parameters:
observerThe observer to remove.
- (void) removeResponseObserver: (id)  observer

Removes an response observer.

Parameters:
observerThe observer.
+ (RKDeviceMessenger *) sharedMessenger

Accessor to the singleton.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties