rcProtocol  V.0.3.0
A protocol for diy transmitters/receivers
Protected Member Functions | Protected Attributes | List of all members
RCGlobal Class Reference

#include <rcGlobal.h>

+ Inheritance diagram for RCGlobal:

Protected Member Functions

 RCGlobal ()
 
int8_t force_send (void *buf, uint8_t size, unsigned long timeout)
 
int8_t wait_till_available (unsigned long timeout)
 
void apply_settings (RCSettings *settings)
 
void flush_buffer ()
 

Protected Attributes

const uint8_t _PAIR_ADDRESS [5] = {'P', 'a', 'i', 'r', '0'}
 
const uint8_t _DISCONNECT [5] = {255, 255, 255, 255, 255}
 
const uint8_t _ACK = 0x06
 
const uint8_t _NACK = 0x15
 
const uint8_t _TEST = 0x02
 
const uint8_t _PACKET_CHANNELS = 0xA0
 
const uint8_t _PACKET_UPDATE_TRANS_SETTINGS = 0xB1
 
const uint8_t _PACKET_UPDATE_RECVR_SETTINGS = 0xB2
 
const uint8_t _PACKET_DISCONNECT = 0xC0
 
const uint8_t _PACKET_RECONNECT = 0xCA
 
RCSettings _settings
 
RCSettings _pairSettings
 
RF24 * _radio
 

Detailed Description

Contains functions and variables used by both DeviceProtocal and RemoteProtocol.

Everything in RCGlobal is protected, so only DeviceProtocol and RemoteProtocol have access to these members.

You can also find Global constants in rcGlobal.h

Definition at line 54 of file rcGlobal.h.

Constructor & Destructor Documentation

◆ RCGlobal()

RCGlobal::RCGlobal ( )
protected

Definition at line 3 of file rcGlobal.cpp.

Member Function Documentation

◆ force_send()

int8_t RCGlobal::force_send ( void *  buf,
uint8_t  size,
unsigned long  timeout 
)
protected

repeatidly send a packet of buf until the packet has been received.

Parameters
bufdata to send
sizesize of data in bytes
timeouthow long before giving up. (millis)
Returns
0 if successful
-1 if not

Definition at line 15 of file rcGlobal.cpp.

◆ wait_till_available()

int8_t RCGlobal::wait_till_available ( unsigned long  timeout)
protected

Wait until a packet has been received

Parameters
timeouthow long before giving up (millis)

Definition at line 28 of file rcGlobal.cpp.

◆ apply_settings()

void RCGlobal::apply_settings ( RCSettings settings)
protected

apply the given settings to the radio

Parameters
settings

Definition at line 40 of file rcGlobal.cpp.

◆ flush_buffer()

void RCGlobal::flush_buffer ( )
protected

Flush the radio's input buffer

Definition at line 65 of file rcGlobal.cpp.

Member Data Documentation

◆ _PAIR_ADDRESS

const uint8_t RCGlobal::_PAIR_ADDRESS[5] = {'P', 'a', 'i', 'r', '0'}
protected

Definition at line 59 of file rcGlobal.h.

◆ _DISCONNECT

const uint8_t RCGlobal::_DISCONNECT[5] = {255, 255, 255, 255, 255}
protected

Definition at line 60 of file rcGlobal.h.

◆ _ACK

const uint8_t RCGlobal::_ACK = 0x06
protected

Definition at line 61 of file rcGlobal.h.

◆ _NACK

const uint8_t RCGlobal::_NACK = 0x15
protected

Definition at line 62 of file rcGlobal.h.

◆ _TEST

const uint8_t RCGlobal::_TEST = 0x02
protected

Definition at line 63 of file rcGlobal.h.

◆ _PACKET_CHANNELS

const uint8_t RCGlobal::_PACKET_CHANNELS = 0xA0
protected

Definition at line 65 of file rcGlobal.h.

◆ _PACKET_UPDATE_TRANS_SETTINGS

const uint8_t RCGlobal::_PACKET_UPDATE_TRANS_SETTINGS = 0xB1
protected

Definition at line 66 of file rcGlobal.h.

◆ _PACKET_UPDATE_RECVR_SETTINGS

const uint8_t RCGlobal::_PACKET_UPDATE_RECVR_SETTINGS = 0xB2
protected

Definition at line 67 of file rcGlobal.h.

◆ _PACKET_DISCONNECT

const uint8_t RCGlobal::_PACKET_DISCONNECT = 0xC0
protected

Definition at line 68 of file rcGlobal.h.

◆ _PACKET_RECONNECT

const uint8_t RCGlobal::_PACKET_RECONNECT = 0xCA
protected

Definition at line 69 of file rcGlobal.h.

◆ _settings

RCSettings RCGlobal::_settings
protected

Definition at line 71 of file rcGlobal.h.

◆ _pairSettings

RCSettings RCGlobal::_pairSettings
protected

Definition at line 72 of file rcGlobal.h.

◆ _radio

RF24* RCGlobal::_radio
protected

Definition at line 74 of file rcGlobal.h.


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