Class for calculating Map27 Frame Check Sequence.
More...
#include <Map27/FCS.h>
|
static uint16_t | fcs (uint8_t *buf, uint16_t len) |
|
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 Initialise the FCS for the start of a new calculation
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] | buf | Pointer to the buffer of octets to add |
[in] | len | Number 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()
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] | ch | The 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] | buf | Pointer to the buffer of octets to add |
[in] | len | Number of octets in buf |
The documentation for this class was generated from the following files: