CARMA C++
Utilities.h File Reference

Declarations of carma::canbus utility functions. More...

#include <vector>
#include "carma/canbus/Types.h"

Go to the source code of this file.

Namespaces

module  carma
 IDL for bima Rx Control, inherits from antenna::common::RxControl.
 
 carma::canbus
 This namespace contains all canbus library related code.
 

Functions

timespec carma::canbus::calculateTimeToNextHalfSec ()
 Calculate the time to the next half second boundary. More...
 
timespec carma::canbus::calculateTimeToNextSlowBoundary ()
 Calculate the time to the next five second boundary. More...
 
idType carma::canbus::createEngId (bool host, boardType board, serialNumberType serialNumber, msgType mid)
 Produce a CAN message from a board type and serial number (engineering message). More...
 
idType carma::canbus::createId (bool host, apiType api, nodeType node, msgType mid)
 Create a CAN id from api, node and mid. More...
 
double carma::canbus::dataToDouble (std::vector< byteType > &data)
 Convert data vector to IEEE double. More...
 
float carma::canbus::dataToFloat (std::vector< byteType > &data)
 Convert data vector to IEEE float. More...
 
long carma::canbus::dataToLong (std::vector< byteType > &data)
 Convert data vector to signed long integer. More...
 
short carma::canbus::dataToShort (std::vector< byteType > &data)
 Convert data vector to signed short integer. More...
 
unsigned char carma::canbus::dataToUbyte (std::vector< byteType > &data)
 Convert data vector to unsigned byte. More...
 
unsigned long carma::canbus::dataToUlong (std::vector< byteType > &data)
 Convert data vector to unsigned long integer. More...
 
unsigned short carma::canbus::dataToUshort (std::vector< byteType > &data)
 Convert data vector to unsigned short integer. More...
 
void carma::canbus::doubleToData (std::vector< byteType > &data, double value)
 Convert a IEEE 754-1990 double float (8 bytes) into raw CAN bytes. More...
 
busIdType carma::canbus::extractBusId (std::string filename)
 Extract the busId from a string containing the device filename. More...
 
void carma::canbus::floatToData (std::vector< byteType > &data, float value)
 Convert a IEEE 754-1990 float (4 bytes) into raw CAN bytes. More...
 
void carma::canbus::fromEngId (boardType &bt, serialNumberType &sn, msgType &mid, idType engId)
 Convert a raw CAN id to board type, serial number and mid. More...
 
void carma::canbus::fromId (apiType &api, nodeType &node, msgType &mid, idType id)
 Convert a raw CAN id to api code, node location and mid. More...
 
modeType carma::canbus::getMode (idType id)
 Extract the address mode from a 29 bit can id. More...
 
bool carma::canbus::isToHost (idType id)
 Extract the host bit from a 29 bit CAN id. More...
 
void carma::canbus::padWithZeros (std::vector< byteType > &data)
 Pad an input vector with up to 8 bytes of zeros. More...
 
void carma::canbus::sLongToData (std::vector< byteType > &data, long value)
 Convert a signed long integer (4 bytes) into raw CAN bytes. More...
 
void carma::canbus::sShortToData (std::vector< byteType > &data, short value)
 Convert a signed short integer (2 bytes) into raw CAN bytes. More...
 
void carma::canbus::uByteToData (std::vector< byteType > &data, unsigned char value)
 Convert a unsigned char into raw CAN bytes. More...
 
void carma::canbus::uLongToData (std::vector< byteType > &data, unsigned long value)
 Convert an unsigned long integer (4 bytes) into raw CAN bytes. More...
 
void carma::canbus::uShortToData (std::vector< byteType > &data, unsigned short value)
 Convert an unsigned short integer (2 bytes) into raw CAN bytes. More...
 
int carma::canbus::validateModulbusNo (int modulbusNo)
 Validate a modulbusNo. More...
 
int carma::canbus::validateSlotNo (int slotNo)
 Validate slot number for CANbus slot. More...
 

Variables

const bool carma::canbus::TO_HOST = true
 Constant for bool host parameter of createId indicating that the message is to be addressed to the linux host. More...
 
const bool carma::canbus::TO_NODES = false
 Constant for bool host parameter of createId indicating that the message is to be addressed to the can nodes on the bus. More...
 

Detailed Description

Declarations of carma::canbus utility functions.

Author
Andy Beard
Revision:
1.22
Date:
2005/07/07 00:01:26
Id:
Utilities.h,v 1.22 2005/07/07 00:01:26 abeard Exp

Definition in file Utilities.h.