RSeries astromech firmware
SMQ Class Reference

#include <ReelTwoSMQ.h>

Detailed Description

Serial Message Queue.

Serial Message Queue implements a buffer-free CRC checked binary serial protocol to connect to a host computer that will transmit publish/subscribe requests via ZeroMQ.

Public Types

typedef void(* MessageHandler) (Message &msg)
 
typedef void(* MessageHandler) (Message &msg)
 

Static Public Member Functions

static void ready ()
 
static void process ()
 
static void send_string (const char *str)
 
static void send_string (PROGMEMString str)
 
static void send_string_id (const msg_id id)
 
static void send_string_hash (const char *str)
 
static bool send_ready ()
 
static bool sendTopic (const smq_id id)
 
static bool sendTopic (PROGMEMString str)
 
static bool sendTopic (const char *str)
 
static void send_start (const smq_id id)
 
static void send_start (PROGMEMString str)
 
static void send_start (const char *str)
 
static void send_start_hash (const char *str)
 
static void send_string (const msg_id id, const char *val)
 
static void send_string (PROGMEMString key, const char *val)
 
static void send_string (PROGMEMString key, PROGMEMString val)
 
static void send_string (const char *key, const char *val)
 
static void send_int8 (const msg_id id, int8_t val)
 
static void send_int8 (PROGMEMString key, int8_t val)
 
static void send_int8 (const char *key, int8_t val)
 
static void send_int16 (const msg_id id, int16_t val)
 
static void send_int16 (PROGMEMString key, int16_t val)
 
static void send_int16 (const char *key, int16_t val)
 
static void send_int32 (const msg_id id, int32_t val)
 
static void send_int32 (const char *key, int32_t val)
 
static void send_int32 (PROGMEMString key, int32_t val)
 
static void send_uint8 (const msg_id id, uint8_t val)
 
static void send_uint8 (PROGMEMString key, uint8_t val)
 
static void send_uint8 (const char *key, uint8_t val)
 
static void send_uint16 (const msg_id id, uint16_t val)
 
static void send_uint16 (PROGMEMString key, uint16_t val)
 
static void send_uint16 (const char *key, uint16_t val)
 
static void send_uint32 (const msg_id id, uint32_t val)
 
static void send_uint32 (PROGMEMString key, uint32_t val)
 
static void send_uint32 (const char *key, uint32_t val)
 
static void send_float (const msg_id id, float val)
 
static void send_float (PROGMEMString key, float val)
 
static void send_float (const char *key, float val)
 
static void send_double (const msg_id id, double val)
 
static void send_double (PROGMEMString key, double val)
 
static void send_double (const char *key, double val)
 
static void send_boolean (const msg_id id, bool val)
 
static void send_boolean (PROGMEMString key, bool val)
 
static void send_boolean (const char *key, bool val)
 
static void send_null (const msg_id id)
 
static void send_null (PROGMEMString key)
 
static void send_null (const char *key)
 
static void send_end ()
 
static void startPairing ()
 
static bool isPairing ()
 
static void stopPairing ()
 
static int masterKeyExchange (SMQLMK *remoteKey)
 
static void addPairedHosts (unsigned numHosts, SMQAddressKey *hosts)
 
static bool addPairedHost (SMQAddress *addr, SMQLMK *lmk=nullptr)
 
static unsigned getPairedHostCount ()
 
static unsigned getPairedHosts (SMQAddressKey *hosts, unsigned maxCount)
 
static void setHostPairingCallback (void(*callback)(SMQHost *host))
 
static void setHostDiscoveryCallback (void(*callback)(SMQHost *host))
 
static void setHostLostCallback (void(*callback)(SMQHost *host))
 
static bool clearToSend ()
 
static String getAddress ()
 
static bool init (String hostName, String key)
 
static bool init (const char *hostName=nullptr, const char *key=nullptr)
 
static bool addBroadcastPeer ()
 
static void createLocalMasterKey (SMQLMK *key)
 
static void setLocalMasterKey (SMQLMK *key)
 
static void getLocalMasterKey (SMQLMK *key)
 
static void removeBroadcastPeer ()
 
static void process ()
 
static void sendString (String str)
 
static void send_string (const char *str)
 
static void send_string (PROGMEMString str)
 
static void send_string_id (const msg_id id)
 
static void send_topic_id (const smq_id id)
 
static void send_topic_hash (const char *str)
 
static void send_string_hash (const char *str)
 
static void send_string_hash (PROGMEMString str)
 
static void send_start (const smq_id id)
 
static void send_start (const char *str)
 
static void send_start (PROGMEMString str)
 
static void send_string (const msg_id id, const char *val)
 
static void send_string (const char *key, const char *val)
 
static void send_string (PROGMEMString key, const char *val)
 
static void send_string (PROGMEMString key, PROGMEMString val)
 
static void sendString (const char *key, const char *val)
 
static void sendString (String key, String val)
 
static void sendString (const char *key, String val)
 
static void sendString (String key, const char *val)
 
static void send_int8 (const msg_id id, int8_t val)
 
static void send_int8 (const char *key, int8_t val)
 
static void send_int8 (PROGMEMString key, int8_t val)
 
static void send_int16 (const msg_id id, int16_t val)
 
static void send_int16 (const char *key, int16_t val)
 
static void send_int16 (PROGMEMString key, int16_t val)
 
static void send_int32 (const msg_id id, int32_t val)
 
static void send_int32 (const char *key, int32_t val)
 
static void send_int32 (PROGMEMString key, int32_t val)
 
static void send_long (const msg_id id, long val)
 
static void send_long (const char *key, long val)
 
static void send_uint8 (const msg_id id, uint8_t val)
 
static void send_uint8 (const char *key, uint8_t val)
 
static void send_uint8 (PROGMEMString key, uint8_t val)
 
static void send_uint16 (const msg_id id, uint16_t val)
 
static void send_uint16 (const char *key, uint16_t val)
 
static void send_uint16 (PROGMEMString key, uint16_t val)
 
static void send_uint32 (const msg_id id, uint32_t val)
 
static void send_uint32 (const char *key, uint32_t val)
 
static void send_uint32 (PROGMEMString key, uint32_t val)
 
static void send_float (const msg_id id, float val)
 
static void send_float (const char *key, float val)
 
static void send_float (PROGMEMString key, float val)
 
static void send_double (const msg_id id, double val)
 
static void send_double (const char *key, double val)
 
static void send_double (PROGMEMString key, double val)
 
static void send_boolean (const msg_id id, bool val)
 
static void send_boolean (const char *key, bool val)
 
static void send_boolean (PROGMEMString key, bool val)
 
static void send_null (const msg_id id)
 
static void send_null (const char *key)
 
static void send_null (PROGMEMString key)
 
static void clearAllPeers ()
 
static bool sendTopic (String topic, String host)
 
static bool sendTopic (PROGMEMString topic)
 
static bool sendTopic (const char *topic, const char *hostNameAddr=nullptr)
 
static SMQAddress messageSender ()
 
static bool broadcastTopic (smq_id topic)
 
static bool broadcastPairedTopic (smq_id topic)
 
static bool addPairedPeers ()
 
static void send_end ()
 
static void sendEnd ()
 

Member Typedef Documentation

◆ MessageHandler [1/2]

typedef void(* SMQ::MessageHandler) (Message &msg)

◆ MessageHandler [2/2]

typedef void(* SMQ::MessageHandler) (Message &msg)

Member Function Documentation

◆ addBroadcastPeer()

static bool SMQ::addBroadcastPeer ( )
inlinestatic

◆ addPairedHost()

static bool SMQ::addPairedHost ( SMQAddress addr,
SMQLMK lmk = nullptr 
)
inlinestatic

◆ addPairedHosts()

static void SMQ::addPairedHosts ( unsigned  numHosts,
SMQAddressKey hosts 
)
inlinestatic

◆ addPairedPeers()

static bool SMQ::addPairedPeers ( )
inlinestatic

◆ broadcastPairedTopic()

static bool SMQ::broadcastPairedTopic ( smq_id  topic)
inlinestatic

◆ broadcastTopic()

static bool SMQ::broadcastTopic ( smq_id  topic)
inlinestatic

◆ clearAllPeers()

static void SMQ::clearAllPeers ( )
inlinestatic

◆ clearToSend()

static bool SMQ::clearToSend ( )
inlinestatic

◆ createLocalMasterKey()

static void SMQ::createLocalMasterKey ( SMQLMK key)
inlinestatic

◆ getAddress()

static String SMQ::getAddress ( )
inlinestatic

◆ getLocalMasterKey()

static void SMQ::getLocalMasterKey ( SMQLMK key)
inlinestatic

◆ getPairedHostCount()

static unsigned SMQ::getPairedHostCount ( )
inlinestatic

◆ getPairedHosts()

static unsigned SMQ::getPairedHosts ( SMQAddressKey hosts,
unsigned  maxCount 
)
inlinestatic

◆ init() [1/2]

static bool SMQ::init ( const char *  hostName = nullptr,
const char *  key = nullptr 
)
inlinestatic

◆ init() [2/2]

static bool SMQ::init ( String  hostName,
String  key 
)
inlinestatic

◆ isPairing()

static bool SMQ::isPairing ( )
inlinestatic

◆ masterKeyExchange()

static int SMQ::masterKeyExchange ( SMQLMK remoteKey)
inlinestatic

◆ messageSender()

static SMQAddress SMQ::messageSender ( )
inlinestatic

◆ process() [1/2]

static void SMQ::process ( )
inlinestatic

◆ process() [2/2]

static void SMQ::process ( )
inlinestatic

◆ ready()

static void SMQ::ready ( )
inlinestatic

◆ removeBroadcastPeer()

static void SMQ::removeBroadcastPeer ( )
inlinestatic

◆ send_boolean() [1/6]

static void SMQ::send_boolean ( const char *  key,
bool  val 
)
inlinestatic

◆ send_boolean() [2/6]

static void SMQ::send_boolean ( const char *  key,
bool  val 
)
inlinestatic

◆ send_boolean() [3/6]

static void SMQ::send_boolean ( const msg_id  id,
bool  val 
)
inlinestatic

◆ send_boolean() [4/6]

static void SMQ::send_boolean ( const msg_id  id,
bool  val 
)
inlinestatic

◆ send_boolean() [5/6]

static void SMQ::send_boolean ( PROGMEMString  key,
bool  val 
)
inlinestatic

◆ send_boolean() [6/6]

static void SMQ::send_boolean ( PROGMEMString  key,
bool  val 
)
inlinestatic

◆ send_double() [1/6]

static void SMQ::send_double ( const char *  key,
double  val 
)
inlinestatic

◆ send_double() [2/6]

static void SMQ::send_double ( const char *  key,
double  val 
)
inlinestatic

◆ send_double() [3/6]

static void SMQ::send_double ( const msg_id  id,
double  val 
)
inlinestatic

◆ send_double() [4/6]

static void SMQ::send_double ( const msg_id  id,
double  val 
)
inlinestatic

◆ send_double() [5/6]

static void SMQ::send_double ( PROGMEMString  key,
double  val 
)
inlinestatic

◆ send_double() [6/6]

static void SMQ::send_double ( PROGMEMString  key,
double  val 
)
inlinestatic

◆ send_end() [1/2]

static void SMQ::send_end ( )
inlinestatic

◆ send_end() [2/2]

static void SMQ::send_end ( )
inlinestatic

◆ send_float() [1/6]

static void SMQ::send_float ( const char *  key,
float  val 
)
inlinestatic

◆ send_float() [2/6]

static void SMQ::send_float ( const char *  key,
float  val 
)
inlinestatic

◆ send_float() [3/6]

static void SMQ::send_float ( const msg_id  id,
float  val 
)
inlinestatic

◆ send_float() [4/6]

static void SMQ::send_float ( const msg_id  id,
float  val 
)
inlinestatic

◆ send_float() [5/6]

static void SMQ::send_float ( PROGMEMString  key,
float  val 
)
inlinestatic

◆ send_float() [6/6]

static void SMQ::send_float ( PROGMEMString  key,
float  val 
)
inlinestatic

◆ send_int16() [1/6]

static void SMQ::send_int16 ( const char *  key,
int16_t  val 
)
inlinestatic

◆ send_int16() [2/6]

static void SMQ::send_int16 ( const char *  key,
int16_t  val 
)
inlinestatic

◆ send_int16() [3/6]

static void SMQ::send_int16 ( const msg_id  id,
int16_t  val 
)
inlinestatic

◆ send_int16() [4/6]

static void SMQ::send_int16 ( const msg_id  id,
int16_t  val 
)
inlinestatic

◆ send_int16() [5/6]

static void SMQ::send_int16 ( PROGMEMString  key,
int16_t  val 
)
inlinestatic

◆ send_int16() [6/6]

static void SMQ::send_int16 ( PROGMEMString  key,
int16_t  val 
)
inlinestatic

◆ send_int32() [1/6]

static void SMQ::send_int32 ( const char *  key,
int32_t  val 
)
inlinestatic

◆ send_int32() [2/6]

static void SMQ::send_int32 ( const char *  key,
int32_t  val 
)
inlinestatic

◆ send_int32() [3/6]

static void SMQ::send_int32 ( const msg_id  id,
int32_t  val 
)
inlinestatic

◆ send_int32() [4/6]

static void SMQ::send_int32 ( const msg_id  id,
int32_t  val 
)
inlinestatic

◆ send_int32() [5/6]

static void SMQ::send_int32 ( PROGMEMString  key,
int32_t  val 
)
inlinestatic

◆ send_int32() [6/6]

static void SMQ::send_int32 ( PROGMEMString  key,
int32_t  val 
)
inlinestatic

◆ send_int8() [1/6]

static void SMQ::send_int8 ( const char *  key,
int8_t  val 
)
inlinestatic

◆ send_int8() [2/6]

static void SMQ::send_int8 ( const char *  key,
int8_t  val 
)
inlinestatic

◆ send_int8() [3/6]

static void SMQ::send_int8 ( const msg_id  id,
int8_t  val 
)
inlinestatic

◆ send_int8() [4/6]

static void SMQ::send_int8 ( const msg_id  id,
int8_t  val 
)
inlinestatic

◆ send_int8() [5/6]

static void SMQ::send_int8 ( PROGMEMString  key,
int8_t  val 
)
inlinestatic

◆ send_int8() [6/6]

static void SMQ::send_int8 ( PROGMEMString  key,
int8_t  val 
)
inlinestatic

◆ send_long() [1/2]

static void SMQ::send_long ( const char *  key,
long  val 
)
inlinestatic

◆ send_long() [2/2]

static void SMQ::send_long ( const msg_id  id,
long  val 
)
inlinestatic

◆ send_null() [1/6]

static void SMQ::send_null ( const char *  key)
inlinestatic

◆ send_null() [2/6]

static void SMQ::send_null ( const char *  key)
inlinestatic

◆ send_null() [3/6]

static void SMQ::send_null ( const msg_id  id)
inlinestatic

◆ send_null() [4/6]

static void SMQ::send_null ( const msg_id  id)
inlinestatic

◆ send_null() [5/6]

static void SMQ::send_null ( PROGMEMString  key)
inlinestatic

◆ send_null() [6/6]

static void SMQ::send_null ( PROGMEMString  key)
inlinestatic

◆ send_ready()

static bool SMQ::send_ready ( )
inlinestatic

◆ send_start() [1/6]

static void SMQ::send_start ( const char *  str)
inlinestatic

◆ send_start() [2/6]

static void SMQ::send_start ( const char *  str)
inlinestatic

◆ send_start() [3/6]

static void SMQ::send_start ( const smq_id  id)
inlinestatic

◆ send_start() [4/6]

static void SMQ::send_start ( const smq_id  id)
inlinestatic

◆ send_start() [5/6]

static void SMQ::send_start ( PROGMEMString  str)
inlinestatic

◆ send_start() [6/6]

static void SMQ::send_start ( PROGMEMString  str)
inlinestatic

◆ send_start_hash()

static void SMQ::send_start_hash ( const char *  str)
inlinestatic

◆ send_string() [1/12]

static void SMQ::send_string ( const char *  key,
const char *  val 
)
inlinestatic

◆ send_string() [2/12]

static void SMQ::send_string ( const char *  key,
const char *  val 
)
inlinestatic

◆ send_string() [3/12]

static void SMQ::send_string ( const char *  str)
inlinestatic

◆ send_string() [4/12]

static void SMQ::send_string ( const char *  str)
inlinestatic

◆ send_string() [5/12]

static void SMQ::send_string ( const msg_id  id,
const char *  val 
)
inlinestatic

◆ send_string() [6/12]

static void SMQ::send_string ( const msg_id  id,
const char *  val 
)
inlinestatic

◆ send_string() [7/12]

static void SMQ::send_string ( PROGMEMString  key,
const char *  val 
)
inlinestatic

◆ send_string() [8/12]

static void SMQ::send_string ( PROGMEMString  key,
const char *  val 
)
inlinestatic

◆ send_string() [9/12]

static void SMQ::send_string ( PROGMEMString  key,
PROGMEMString  val 
)
inlinestatic

◆ send_string() [10/12]

static void SMQ::send_string ( PROGMEMString  key,
PROGMEMString  val 
)
inlinestatic

◆ send_string() [11/12]

static void SMQ::send_string ( PROGMEMString  str)
inlinestatic

◆ send_string() [12/12]

static void SMQ::send_string ( PROGMEMString  str)
inlinestatic

◆ send_string_hash() [1/3]

static void SMQ::send_string_hash ( const char *  str)
inlinestatic

◆ send_string_hash() [2/3]

static void SMQ::send_string_hash ( const char *  str)
inlinestatic

◆ send_string_hash() [3/3]

static void SMQ::send_string_hash ( PROGMEMString  str)
inlinestatic

◆ send_string_id() [1/2]

static void SMQ::send_string_id ( const msg_id  id)
inlinestatic

◆ send_string_id() [2/2]

static void SMQ::send_string_id ( const msg_id  id)
inlinestatic

◆ send_topic_hash()

static void SMQ::send_topic_hash ( const char *  str)
inlinestatic

◆ send_topic_id()

static void SMQ::send_topic_id ( const smq_id  id)
inlinestatic

◆ send_uint16() [1/6]

static void SMQ::send_uint16 ( const char *  key,
uint16_t  val 
)
inlinestatic

◆ send_uint16() [2/6]

static void SMQ::send_uint16 ( const char *  key,
uint16_t  val 
)
inlinestatic

◆ send_uint16() [3/6]

static void SMQ::send_uint16 ( const msg_id  id,
uint16_t  val 
)
inlinestatic

◆ send_uint16() [4/6]

static void SMQ::send_uint16 ( const msg_id  id,
uint16_t  val 
)
inlinestatic

◆ send_uint16() [5/6]

static void SMQ::send_uint16 ( PROGMEMString  key,
uint16_t  val 
)
inlinestatic

◆ send_uint16() [6/6]

static void SMQ::send_uint16 ( PROGMEMString  key,
uint16_t  val 
)
inlinestatic

◆ send_uint32() [1/6]

static void SMQ::send_uint32 ( const char *  key,
uint32_t  val 
)
inlinestatic

◆ send_uint32() [2/6]

static void SMQ::send_uint32 ( const char *  key,
uint32_t  val 
)
inlinestatic

◆ send_uint32() [3/6]

static void SMQ::send_uint32 ( const msg_id  id,
uint32_t  val 
)
inlinestatic

◆ send_uint32() [4/6]

static void SMQ::send_uint32 ( const msg_id  id,
uint32_t  val 
)
inlinestatic

◆ send_uint32() [5/6]

static void SMQ::send_uint32 ( PROGMEMString  key,
uint32_t  val 
)
inlinestatic

◆ send_uint32() [6/6]

static void SMQ::send_uint32 ( PROGMEMString  key,
uint32_t  val 
)
inlinestatic

◆ send_uint8() [1/6]

static void SMQ::send_uint8 ( const char *  key,
uint8_t  val 
)
inlinestatic

◆ send_uint8() [2/6]

static void SMQ::send_uint8 ( const char *  key,
uint8_t  val 
)
inlinestatic

◆ send_uint8() [3/6]

static void SMQ::send_uint8 ( const msg_id  id,
uint8_t  val 
)
inlinestatic

◆ send_uint8() [4/6]

static void SMQ::send_uint8 ( const msg_id  id,
uint8_t  val 
)
inlinestatic

◆ send_uint8() [5/6]

static void SMQ::send_uint8 ( PROGMEMString  key,
uint8_t  val 
)
inlinestatic

◆ send_uint8() [6/6]

static void SMQ::send_uint8 ( PROGMEMString  key,
uint8_t  val 
)
inlinestatic

◆ sendEnd()

static void SMQ::sendEnd ( )
inlinestatic

◆ sendString() [1/5]

static void SMQ::sendString ( const char *  key,
const char *  val 
)
inlinestatic

◆ sendString() [2/5]

static void SMQ::sendString ( const char *  key,
String  val 
)
inlinestatic

◆ sendString() [3/5]

static void SMQ::sendString ( String  key,
const char *  val 
)
inlinestatic

◆ sendString() [4/5]

static void SMQ::sendString ( String  key,
String  val 
)
inlinestatic

◆ sendString() [5/5]

static void SMQ::sendString ( String  str)
inlinestatic

◆ sendTopic() [1/6]

static bool SMQ::sendTopic ( const char *  str)
inlinestatic

◆ sendTopic() [2/6]

static bool SMQ::sendTopic ( const char *  topic,
const char *  hostNameAddr = nullptr 
)
inlinestatic

◆ sendTopic() [3/6]

static bool SMQ::sendTopic ( const smq_id  id)
inlinestatic

◆ sendTopic() [4/6]

static bool SMQ::sendTopic ( PROGMEMString  str)
inlinestatic

◆ sendTopic() [5/6]

static bool SMQ::sendTopic ( PROGMEMString  topic)
inlinestatic

◆ sendTopic() [6/6]

static bool SMQ::sendTopic ( String  topic,
String  host 
)
inlinestatic

◆ setHostDiscoveryCallback()

static void SMQ::setHostDiscoveryCallback ( void(*)(SMQHost *host)  callback)
inlinestatic

◆ setHostLostCallback()

static void SMQ::setHostLostCallback ( void(*)(SMQHost *host)  callback)
inlinestatic

◆ setHostPairingCallback()

static void SMQ::setHostPairingCallback ( void(*)(SMQHost *host)  callback)
inlinestatic

◆ setLocalMasterKey()

static void SMQ::setLocalMasterKey ( SMQLMK key)
inlinestatic

◆ startPairing()

static void SMQ::startPairing ( )
inlinestatic

◆ stopPairing()

static void SMQ::stopPairing ( )
inlinestatic

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