Map27
 All Classes Functions Variables Enumerations Enumerator Pages
Public Member Functions | Static Public Member Functions | List of all members
Map27FCS Class Reference

Class for calculating Map27 Frame Check Sequence. More...

#include <Map27/FCS.h>

Public Member Functions

 Map27FCS ()
 
void init ()
 
void update (uint8_t ch)
 
void update (uint8_t *buf, uint16_t len)
 
uint16_t final ()
 

Static Public Member Functions

static uint16_t fcs (uint8_t *buf, uint16_t len)
 

Detailed Description

Class for calculating Map27 Frame Check Sequence.

This class provides methods for generating Map27 compliant Frame Check Sequence digits from Map27 message streams. Based on Map27 Appendix A1. This essentially the same as CRC-16-ANSI. The generator is A001. The result is a 16 bit FCS. It is used internally by Map27PhysicalLayer and you should not normally need to us it in application code.

Constructor & Destructor Documentation

Map27FCS::Map27FCS ( )

Constructor Initialise the FCS for the start of a new calculation

Member Function Documentation

uint16_t Map27FCS::fcs ( uint8_t *  buf,
uint16_t  len 
)
static

Easy to use static class member that will conclate and return the FCS of a number of octets

Parameters
[in]bufPointer to the buffer of octets to add
[in]lenNumber of octets in buf
Returns
The FCS of all the octets passed.
Examples:
test.cpp.
uint16_t Map27FCS::final ( )

Compute and return the FCS

Returns
The FCS of all the octets passed by update()
void Map27FCS::init ( )

Re-Initialise the FCS for the start of a new calculation

void Map27FCS::update ( uint8_t  ch)

Add a single octet to the FCS

Parameters
[in]chThe octet to add to the FCS
void Map27FCS::update ( uint8_t *  buf,
uint16_t  len 
)

Adds a number of octets to the FCS

Parameters
[in]bufPointer to the buffer of octets to add
[in]lenNumber of octets in buf

The documentation for this class was generated from the following files: