RCKit
Public Member Functions | Protected Attributes | List of all members
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]

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

◆ init()

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, ESP8266Transceiver, and EthernetTransceiver.

Referenced by RCRx::init().

◆ receivedRequest()

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

◆ 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, ESP8266Transceiver, and EthernetTransceiver.

Referenced by RCRx::run().

◆ sendReply()

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, ESP8266Transceiver, and EthernetTransceiver.

Referenced by RCRx::sendReply().

◆ setDelegate()

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: