RCKit
Public Member Functions | Protected Attributes
Transceiver Class Reference

Abstract base class for a transceiver device that will send and receive messages on behalf of RCRx class. More...

#include <Transceiver.h>

Inheritance diagram for Transceiver:
Inheritance graph
[legend]
Collaboration diagram for Transceiver:
Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual void init ()
virtual void run ()
virtual void setDelegate (RCRx *delegate)
virtual void receivedRequest (uint8_t *msg, uint16_t len, uint16_t rssi=0)
virtual void sendReply (uint8_t *msg, uint16_t len)

Protected Attributes

RCRx_delegate
 Object whose handleRequest() function will be called whenever an RCOIP message is received.

Detailed Description

Abstract base class for a transceiver device that will send and receive messages on behalf of RCRx class.

RXRx class requires to be connected to a Transceiver, and the transceiver is responsible for receiving requests from an RCOIP transmitter and sending replies back to it. Any transport or media can in principle be supported. RCRx includes some specific implementations for example for WiShield and Ethernet

Real transceiver objects must inherit from this subclass and implement the sendReply() function and call delegate->handleRequest(uint8_t *msg, uint16_t len, uint16_t rssi) whenever an RCOI message is received.


Member Function Documentation

virtual void Transceiver::init ( )
virtual

Initialise the object. You are required to call this once during setup(). Subclasses must implement this: there is no base implementation.

Reimplemented in WiShieldTransceiver, and EthernetTransceiver.

Referenced by RCRx::init().

void Transceiver::receivedRequest ( uint8_t *  msg,
uint16_t  len,
uint16_t  rssi = 0 
)
virtual

Passes the received message to the delegate. Call this when the Transceiver has received a message from the RCOIP transmitter. The optional rssi parameter is an indication of the received signal strength, but if your Transceiver has no such measure, you dont need to supply it

Parameters:
[in]msgPointer to the RCOP message.
[in]lenLength of the RCOIP message in bytes.
[in]rssiReceiver Signal Strength as reported by the WiFi receiver (if any)

References _delegate, and RCRx::handleRequest().

Referenced by EthernetTransceiver::run().

virtual void Transceiver::run ( )
virtual

Poll the object for activity. You are required to call this frequently in your main loop Subclasses must implement this: there is no base implementation.

Reimplemented in WiShieldTransceiver, and EthernetTransceiver.

Referenced by RCRx::run().

virtual void Transceiver::sendReply ( uint8_t *  msg,
uint16_t  len 
)
virtual

Sends an RCOIP reply message to the sender of the current message Subclasses must implement this: there is no base implementation.

Parameters:
[in]msgPointer to the RCOP message.
[in]lenLength of the RCOIP message in bytes.

Reimplemented in WiShieldTransceiver, and EthernetTransceiver.

Referenced by RCRx::sendReply().

void Transceiver::setDelegate ( RCRx delegate)
virtual

Sets the delegate object. The delegate will get its handleRequest(uint8_t *msg, uint16_t len, uint16_t rssi) function called whenever an RCOIP message is received. The delegate can use the sendReply() function to send an RCOIP message back to the sender of the currently received message.

Parameters:
[in]delegatePointer to the delegate RXRx object
Author:
Mike McCauley (mikem.nosp@m.@air.nosp@m.spayc.nosp@m.e.co.nosp@m.m)

References _delegate.

Referenced by RCRx::setTransceiver().


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