xrp style wpilib comms
Loading...
Searching...
No Matches
byteutils.cpp File Reference

Functions

float networkToFloat (char *buf, int offset)
 
int16_t networkToInt16 (char *buf, int offset)
 
uint16_t networkToUInt16 (char *buf, int offset)
 
int32_t networkToInt32 (char *buf, int offset)
 
uint32_t networkToUInt32 (char *buf, int offset)
 
void floatToNetwork (float num, char *buf, int offset)
 
void int16ToNetwork (int16_t num, char *buf, int offset)
 
void uint16ToNetwork (uint16_t num, char *buf, int offset)
 
void int32ToNetwork (int32_t num, char *buf, int offset)
 
void uint32ToNetwork (uint32_t num, char *buf, int offset)
 

Function Documentation

◆ floatToNetwork()

void floatToNetwork ( float num,
char * buf,
int offset = 0 )

Encode a float to a buffer in Network Byte Order

◆ int16ToNetwork()

void int16ToNetwork ( int16_t num,
char * buf,
int offset = 0 )

Encode an Int16 to a buffer in Network Byte Order

◆ int32ToNetwork()

void int32ToNetwork ( int32_t num,
char * buf,
int offset = 0 )

Encode an Int32 to a buffer in Network Byte Order

◆ networkToFloat()

float networkToFloat ( char * buf,
int offset = 0 )

Decode a float from a 4-byte buffer in Network Byte order

◆ networkToInt16()

int16_t networkToInt16 ( char * buf,
int offset = 0 )

Decode an int16 from a 2-byte buffer in Network Byte order

◆ networkToInt32()

int32_t networkToInt32 ( char * buf,
int offset = 0 )

Decode an int32 from a 4-byte buffer in Network Byte order

◆ networkToUInt16()

uint16_t networkToUInt16 ( char * buf,
int offset = 0 )

Decode an uint16 from a 2-byte buffer in Network Byte order

◆ networkToUInt32()

uint32_t networkToUInt32 ( char * buf,
int offset = 0 )

Decode an uint32 from a 4-byte buffer in Network Byte order

◆ uint16ToNetwork()

void uint16ToNetwork ( uint16_t num,
char * buf,
int offset = 0 )

Encode a UInt16 to a buffer in Network Byte Order

◆ uint32ToNetwork()

void uint32ToNetwork ( uint32_t num,
char * buf,
int offset = 0 )

Encode a UInt32 to a buffer in Network Byte Order