Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes
um7::Comms Class Reference

#include <comms.h>

List of all members.

Public Member Functions

 Comms (serial::Serial *s)
int16_t receive (Registers *r)
void send (const Accessor_ &a) const
bool sendWaitAck (const Accessor_ &a)

Static Public Member Functions

static std::string checksum (const std::string &s)
static std::string message (uint8_t address, std::string data)

Static Public Attributes

static const uint8_t PACKET_BATCH_LENGTH_MASK = 0x0F
static const uint8_t PACKET_BATCH_LENGTH_OFFSET = 2
static const uint8_t PACKET_HAS_DATA = 1 << 7
static const uint8_t PACKET_IS_BATCH = 1 << 6

Private Attributes

bool first_spin_
serial::Serialserial_

Detailed Description

Definition at line 56 of file comms.h.


Constructor & Destructor Documentation

um7::Comms::Comms ( serial::Serial s) [inline, explicit]

Definition at line 59 of file comms.h.


Member Function Documentation

std::string um7::Comms::checksum ( const std::string &  s) [static]

Definition at line 154 of file comms.cpp.

std::string um7::Comms::message ( uint8_t  address,
std::string  data 
) [static]

Definition at line 168 of file comms.cpp.

int16_t um7::Comms::receive ( Registers r = NULL)

Returns -1 if the serial port timed out before receiving a packet successfully, or if there was a bad checksum or any other error. Otherwise, returns the 8-bit register number of the successfully returned packet.

Definition at line 54 of file comms.cpp.

void um7::Comms::send ( const Accessor_ a) const

Definition at line 191 of file comms.cpp.

bool um7::Comms::sendWaitAck ( const Accessor_ a)

Definition at line 198 of file comms.cpp.


Member Data Documentation

bool um7::Comms::first_spin_ [private]

Definition at line 85 of file comms.h.

const uint8_t um7::Comms::PACKET_BATCH_LENGTH_MASK = 0x0F [static]

Definition at line 77 of file comms.h.

const uint8_t um7::Comms::PACKET_BATCH_LENGTH_OFFSET = 2 [static]

Definition at line 78 of file comms.h.

const uint8_t um7::Comms::PACKET_HAS_DATA = 1 << 7 [static]

Definition at line 75 of file comms.h.

const uint8_t um7::Comms::PACKET_IS_BATCH = 1 << 6 [static]

Definition at line 76 of file comms.h.

Definition at line 86 of file comms.h.


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


um7
Author(s): Mike Purvis , Alex Brown
autogenerated on Sat Jan 28 2017 03:34:13