VitroIO SDK
Software development kit for Vitro Shard.
Loading...
Searching...
No Matches
vitroio::sdk::CanbusFrame Class Reference

Class is a wrapper for mbed::CANMessage. It provides interface allowing creation of frames complied with vitroio protocol. More...

#include <canbus_frame.h>

Public Member Functions

 CanbusFrame ()
 
 ~CanbusFrame ()
 
void setNodeId (uint32_t id)
 Function allows to set node ID for the frame. More...
 
void setParameterId (uint32_t id)
 Function allows to set parameter ID for the frame. More...
 
bool setDataLength (uint32_t length)
 Function allows to set data length of the frame. More...
 
uint32_t nodeId () const
 Function allows to obtain node ID from the frame. More...
 
uint32_t parameterId () const
 Function allows to obtain parameter ID from the frame. More...
 
uint32_t dataLength () const
 Function allows to obtain data length of the frame. More...
 
uint32_t maxDataLength () const
 Function allows to obtain maximum data length of the frame. More...
 
char * data ()
 Function allows a direct access to the frame data for modifications. More...
 
const char * data () const
 Function allows to get frame data for reading. More...
 

Friends

class Canbus
 

Detailed Description

Class is a wrapper for mbed::CANMessage. It provides interface allowing creation of frames complied with vitroio protocol.

Constructor & Destructor Documentation

◆ CanbusFrame()

vitroio::sdk::CanbusFrame::CanbusFrame ( )

◆ ~CanbusFrame()

vitroio::sdk::CanbusFrame::~CanbusFrame ( )

Member Function Documentation

◆ data() [1/2]

char * vitroio::sdk::CanbusFrame::data ( )

Function allows a direct access to the frame data for modifications.

Note
This function should be used with dataLength() function to avoid exceeding address range.
Returns
Function returns pointer to buffer of frame data.

◆ data() [2/2]

const char * vitroio::sdk::CanbusFrame::data ( ) const

Function allows to get frame data for reading.

Note
This function should be used with dataLength() function to avoid exceeding address range.
Returns
Function returns constant pointer to buffer of frame data.

◆ dataLength()

uint32_t vitroio::sdk::CanbusFrame::dataLength ( ) const

Function allows to obtain data length of the frame.

Returns
Function returns length of the frame data.

◆ maxDataLength()

uint32_t vitroio::sdk::CanbusFrame::maxDataLength ( ) const

Function allows to obtain maximum data length of the frame.

Returns
Function returns maximum size of frame data.

◆ nodeId()

uint32_t vitroio::sdk::CanbusFrame::nodeId ( ) const

Function allows to obtain node ID from the frame.

Returns
Function returns node ID of the frame.

◆ parameterId()

uint32_t vitroio::sdk::CanbusFrame::parameterId ( ) const

Function allows to obtain parameter ID from the frame.

Returns
Function returns parameter ID of the frame.

◆ setDataLength()

bool vitroio::sdk::CanbusFrame::setDataLength ( uint32_t  length)

Function allows to set data length of the frame.

Parameters
lengthData length in bytes
Returns
Function returns true on success or false otherwise.

◆ setNodeId()

void vitroio::sdk::CanbusFrame::setNodeId ( uint32_t  id)

Function allows to set node ID for the frame.

Parameters
idNode ID to set

◆ setParameterId()

void vitroio::sdk::CanbusFrame::setParameterId ( uint32_t  id)

Function allows to set parameter ID for the frame.

Parameters
idParameter ID to set

Friends And Related Function Documentation

◆ Canbus

friend class Canbus
friend