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

This class implements CAN bus transport layer for IoT Blockss. More...

#include <can_layer.h>

Inheritance diagram for vitroio::sdk::Can_layer:
Collaboration diagram for vitroio::sdk::Can_layer:

Public Member Functions

 Can_layer (Canbus *bus, uint32_t nodeId)
 Construct a new Can_layer object. More...
 
int send (uint32_t parameterId, const IoVec *iov, int iovcnt)
 Function sends given data. More...
 
uint32_t getTimestamp ()
 Function sends timestamp request and returns timestamp value. More...
 
int computeCRC (const IoVec *iov, int iovcnt, uint32_t *crc_value)
 Function computes CRC of data send via CAN bus to Crystal. More...
 
- Public Member Functions inherited from vitroio::sdk::Transport_layer
virtual int send (uint32_t parameterId, const IoVec *iov, int iovcnt)
 Function sends given data. More...
 
virtual uint32_t getTimestamp ()
 Function sends timestamp request and returns timestamp value. More...
 
void updateNodeId (uint32_t nodeId)
 Update node ID. More...
 
uint32_t nodeId ()
 Returns node ID. More...
 

Additional Inherited Members

- Protected Member Functions inherited from vitroio::sdk::Transport_layer
 Transport_layer (uint32_t nodeId)
 
- Protected Attributes inherited from vitroio::sdk::Transport_layer
uint32_t nodeId_
 

Detailed Description

This class implements CAN bus transport layer for IoT Blockss.

Constructor & Destructor Documentation

◆ Can_layer()

vitroio::sdk::Can_layer::Can_layer ( Canbus bus,
uint32_t  nodeId 
)

Construct a new Can_layer object.

Parameters
busPointer to Canbus object
nodeIdnodeId value

Member Function Documentation

◆ computeCRC()

int vitroio::sdk::Can_layer::computeCRC ( const IoVec iov,
int  iovcnt,
uint32_t *  crc_value 
)

Function computes CRC of data send via CAN bus to Crystal.

Parameters
iovChunks of data
iovcntCount of chunks
crc_valuePointer to save CRC
Returns
int Status

◆ getTimestamp()

uint32_t vitroio::sdk::Can_layer::getTimestamp ( )
virtual

Function sends timestamp request and returns timestamp value.

Returns
uint32_t Received timestamp

Reimplemented from vitroio::sdk::Transport_layer.

◆ send()

int vitroio::sdk::Can_layer::send ( uint32_t  parameterId,
const IoVec iov,
int  iovcnt 
)
virtual

Function sends given data.

Parameters
parameterIdId of parameter sent
iovPointer to first IoVec with data to be sent IoVec
iovcntCount of IoVects to read
Returns
int Status of sending

Reimplemented from vitroio::sdk::Transport_layer.