SELKIELogger  1.0.0
N2K Device communication
Collaboration diagram for N2K Device communication:

Modules

 Data conversion functions for N2K messages
 
 PGN Specific helper functions
 

Files

file  N2KConnection.h
 
file  N2KMessages.h
 
file  N2KTypes.h
 

Classes

struct  n2k_act_message
 

Macros

#define N2K_TO_DEGREES   0.0057295779513082332
 Convert raw angular value to degrees.
 
#define ACT_ESC   0x10
 Escape character.
 
#define ACT_SOT   0x02
 Start of text.
 
#define ACT_EOT   0x03
 End of text.
 
#define ACT_N2K   0x93
 N2k Message.
 
#define ACT_BEM   0xA0
 BEM CMD ??
 

Functions

bool n2k_act_to_bytes (const n2k_act_message *act, uint8_t **out, size_t *len)
 Convert N2K message to a series of bytes compatible with ACT gateway devices. More...
 
bool n2k_act_from_bytes (const uint8_t *in, const size_t len, n2k_act_message **msg, size_t *pos, bool debug)
 Convert a series of recieved bytes from ACT gateway devices into a message representation. More...
 
uint8_t n2k_act_checksum (const n2k_act_message *msg)
 Calculate checksum for n2k_act_message. More...
 
void n2k_act_print (const n2k_act_message *msg)
 Print representation of an n2k_act_message to standard output. More...
 

Detailed Description

Function Documentation

◆ n2k_act_checksum()

uint8_t n2k_act_checksum ( const n2k_act_message msg)

Calculate checksum for n2k_act_message.

Parameters
[in]msgntk_act_message input
Returns
Unsigned byte containing checksum value

Definition at line 248 of file N2KTypes.c.

◆ n2k_act_from_bytes()

bool n2k_act_from_bytes ( const uint8_t *  in,
const size_t  len,
n2k_act_message **  msg,
size_t *  pos,
bool  debug 
)

Convert a series of recieved bytes from ACT gateway devices into a message representation.

Will allocate an n2k_act_message for output, which must be freed by caller.

Parameters
[in]inArray of bytes
[in]lenNumber of bytes available in array
[out]msgPointer to n2k_act_message pointer for output
[out]posNumber of bytes consumed
[in]debugSet true for more verbose output
Returns
True on success, false on error

Definition at line 98 of file N2KTypes.c.

◆ n2k_act_print()

void n2k_act_print ( const n2k_act_message msg)

Print representation of an n2k_act_message to standard output.

Prints message as a sequence of bytes in hexadecimal form.

Parameters
[in]msgn2k_act_message to be printed

Definition at line 275 of file N2KTypes.c.

◆ n2k_act_to_bytes()

bool n2k_act_to_bytes ( const n2k_act_message act,
uint8_t **  out,
size_t *  len 
)

Convert N2K message to a series of bytes compatible with ACT gateway devices.

Allocates an array of bytes and converts n2k_act_message into a transmittable series of bytes

Array will need to be freed by caller

Parameters
[in]actn2k_act_message to be packed
[out]outPointer to array of bytes
[out]lenWill be set to message length after conversion
Returns
True on success, false on error

Definition at line 38 of file N2KTypes.c.