DCAITI Robot Hardware  1.0
Functions | Variables
UARTCom.cpp File Reference
#include "communication/UARTCom.hpp"
#include "communication/UCommands.hpp"
#include "communication/UValue.hpp"
#include "misc/Utils.hpp"
#include "constants.h"
#include "MotorWheel.h"
Include dependency graph for UARTCom.cpp:

Functions

U_FrameType parseFrameType (uint8_t *d)
 extracts frametype from data package More...
 
uint8_t fromFrameType (U_FrameType ft)
 translates frametype to corresponding byte value More...
 
U_Component parseComponent (uint8_t *d)
 extract component information More...
 
uint8_t fromComponent (U_Component cp)
 translates component into byte value More...
 
U_Request parseRequest (uint8_t *d)
 extracts request information from data package More...
 
uint32_t parseTimestamp (uint8_t *d)
 extracts timestamp from data package More...
 
uint16_t computeChecksum (uint8_t *d, uint8_t pl)
 computes checksum from data package More...
 
int correctChecksum (uint8_t *d)
 checks if checksum inside package and computed checksum from package data are the same More...
 
void showPackage (uint8_t *d, int pl)
 debugging function, prints out package data More...
 
void clearPackage (uint8_t *d)
 erases all package data and sets the array to 0 More...
 
void handleRequest (uint8_t *d)
 executes commands according to incoming request More...
 
void handlePackage (uint8_t *d, int pl)
 package handler, checks for errors first, then proceeds to extract information from the data package More...
 

Variables

uint8_t currentParseIndex
 
int payloadLength
 
uint32_t currentTimestamp = 0
 
MotorWheel wheelLeft
 
MotorWheel wheelRight
 

Function Documentation

◆ clearPackage()

void clearPackage ( uint8_t *  d)

erases all package data and sets the array to 0

Parameters
ddata package
Here is the caller graph for this function:

◆ computeChecksum()

uint16_t computeChecksum ( uint8_t *  d,
uint8_t  pl 
)

computes checksum from data package

Parameters
ddata package
plpayload length
Returns
uint16_t
Here is the caller graph for this function:

◆ correctChecksum()

int correctChecksum ( uint8_t *  d)

checks if checksum inside package and computed checksum from package data are the same

Parameters
ddata package
Returns
int
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fromComponent()

uint8_t fromComponent ( U_Component  cp)

translates component into byte value

Parameters
cpcomponent
Returns
uint8_t
Here is the caller graph for this function:

◆ fromFrameType()

uint8_t fromFrameType ( U_FrameType  ft)

translates frametype to corresponding byte value

Parameters
ftframetype
Returns
uint8_t
Here is the caller graph for this function:

◆ handlePackage()

void handlePackage ( uint8_t *  d,
int  pl 
)

package handler, checks for errors first, then proceeds to extract information from the data package

Parameters
d
pl
Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleRequest()

void handleRequest ( uint8_t *  d)

executes commands according to incoming request

Parameters
ddata package
Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseComponent()

U_Component parseComponent ( uint8_t *  d)

extract component information

Parameters
ddata package
Returns
U_Component
Here is the caller graph for this function:

◆ parseFrameType()

U_FrameType parseFrameType ( uint8_t *  d)

extracts frametype from data package

Parameters
ddata package
Returns
U_FrameType
Here is the caller graph for this function:

◆ parseRequest()

U_Request parseRequest ( uint8_t *  d)

extracts request information from data package

Parameters
ddata package
Returns
U_Request
Here is the caller graph for this function:

◆ parseTimestamp()

uint32_t parseTimestamp ( uint8_t *  d)

extracts timestamp from data package

Parameters
ddata package
Returns
uint32_t
Here is the call graph for this function:

◆ showPackage()

void showPackage ( uint8_t *  d,
int  pl 
)

debugging function, prints out package data

Parameters
ddata package
plpayload length
Here is the caller graph for this function:

Variable Documentation

◆ currentParseIndex

uint8_t currentParseIndex

◆ currentTimestamp

uint32_t currentTimestamp = 0

◆ payloadLength

int payloadLength

◆ wheelLeft

MotorWheel wheelLeft
extern

◆ wheelRight

MotorWheel wheelRight
extern