SHETSourceRemoteClient Class Reference

#include <SHETSource.h>

List of all members.

Public Member Functions

 SHETSourceRemoteClient (const SHETSourceServer *server, int address)
void updateStatus (void)
void updateOutputTypes (void)
bool isConnected (void)
bool isOutputNotifying (void)
notify_flags_t getOutputNotify (void)
bool getOutputNotify (int port)
bool readBool (int port)
int8 readInt8 (int port)
int16 readInt16 (int port)
void beginTransmission (void)
void endTransmission (void)
void request (int length)

Detailed Description

Server-side representation of a client. Provides access to information on individual clients in a (hopefully) fairly transparent way by abstracting away all the nasty details about going over I2C.


Constructor & Destructor Documentation

SHETSourceRemoteClient::SHETSourceRemoteClient ( const SHETSourceServer server,
int  address 
)

Create a new instance for the specified server object and address.

Parameters:
server A pointer to the SHETSourceServer object which created the object.
address The I2C address of the client this object will represent.

Member Function Documentation

void SHETSourceRemoteClient::beginTransmission ( void   ) 

A wrapper for the function of the same name in the Wire library. This wrapper automatically fills in the address for you.

void SHETSourceRemoteClient::endTransmission ( void   ) 

A wrapper for the function of the same name in the Wire library. This wrapper doesn't actually do anything but it is included for consistency of style when using the beginTransmission() wrapper.

bool SHETSourceRemoteClient::getOutputNotify ( int  port  ) 

Get the state of a specified bit on the output notifications.

Parameters:
port The port whose output flag you want to check.
Returns:
True if that bit is set.
notify_flags_t SHETSourceRemoteClient::getOutputNotify ( void   ) 

Get the raw bit-field for the output notifications.

Returns:
The raw bits for the output notifications.
bool SHETSourceRemoteClient::isConnected ( void   ) 

Is the device responding to poll requests?

Returns:
True if the device responded to its last poll successfully.
bool SHETSourceRemoteClient::isOutputNotifying ( void   ) 

Has the device set one of the output notification bits when it was last polled?

Returns:
True of any output notification bit is set.
bool SHETSourceRemoteClient::readBool ( int  port  ) 

Request and fetch the boolean value from the client on the specified output port. WARNING: This does not do any sanity checks on whether this output port actually returns this type of value. If you request the wrong type of data from the port, if the port is not set to a particular data type or if the device is not connected, the output is undefined.

Parameters:
port The port number of the output to read.
Returns:
The value read from the device.
int16 SHETSourceRemoteClient::readInt16 ( int  port  ) 

Request and fetch the 16-bit integer value from the client on the specified output port. WARNING: This does not do any sanity checks on whether this output port actually returns this type of value. If you request the wrong type of data from the port, if the port is not set to a particular data type or if the device is not connected, the output is undefined.

Parameters:
port The port number of the output to read.
Returns:
The value read from the device.
int8 SHETSourceRemoteClient::readInt8 ( int  port  ) 

Request and fetch the 8-bit integer value from the client on the specified output port. WARNING: This does not do any sanity checks on whether this output port actually returns this type of value. If you request the wrong type of data from the port, if the port is not set to a particular data type or if the device is not connected, the output is undefined.

Parameters:
port The port number of the output to read.
Returns:
The value read from the device.
void SHETSourceRemoteClient::request ( int  length  ) 

A wrapper for the function of the same name in the Wire library. This wrapper automatically fills in the address for you.

Parameters:
length The length of data you are requesting.
void SHETSourceRemoteClient::updateOutputTypes ( void   ) 

Send out a request to get the type values for the outputs of the device and stores the values in the object.

void SHETSourceRemoteClient::updateStatus ( void   ) 

Send out a poll request to the client and update the status variables. If the client has just connected for the first time, the following functions are called automatically: updateOutputTypes().


The documentation for this class was generated from the following files:
 All Classes Functions Variables
Generated on Thu Jun 3 15:50:50 2010 by  doxygen 1.6.3