w11 - cpp 0.794
Backend server for Rlink and w11
Loading...
Searching...
No Matches
RlinkCrc16.ipp
Go to the documentation of this file.
1// $Id: RlinkCrc16.ipp 1186 2019-07-12 17:49:59Z mueller $
2// SPDX-License-Identifier: GPL-3.0-or-later
3// Copyright 2014-2018 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4//
5// Revision History:
6// Date Rev Version Comment
7// 2018-12-22 1091 1.0.2 Drop empty dtors for pod-only classes
8// 2018-12-18 1089 1.0.1 use c++ style casts
9// 2014-11-08 602 1.0 Initial version
10// ---------------------------------------------------------------------------
11
16// all method definitions in namespace Retro
17namespace Retro {
18
19//------------------------------------------+-----------------------------------
21
23 : fCrc(0)
24{}
25
26//------------------------------------------+-----------------------------------
28
29inline void RlinkCrc16::Clear()
30{
31 fCrc = 0;
32 return;
33}
34
35//------------------------------------------+-----------------------------------
37
38inline void RlinkCrc16::AddData(uint8_t data)
39{
40 uint8_t tmp = uint8_t(fCrc>>8) ^ data;
41 fCrc = (fCrc<<8) ^ fCrc16Table[tmp];
42 return;
43}
44
45//------------------------------------------+-----------------------------------
47
48inline uint16_t RlinkCrc16::Crc() const
49{
50 return fCrc;
51}
52
53} // end namespace Retro
static const uint16_t fCrc16Table[256]
FIXME_docs.
Definition: RlinkCrc16.hpp:35
RlinkCrc16()
Default constructor.
Definition: RlinkCrc16.ipp:22
void Clear()
FIXME_docs.
Definition: RlinkCrc16.ipp:29
uint16_t Crc() const
FIXME_docs.
Definition: RlinkCrc16.ipp:48
void AddData(uint8_t data)
FIXME_docs.
Definition: RlinkCrc16.ipp:38
uint16_t fCrc
current crc value
Definition: RlinkCrc16.hpp:34
Declaration of class ReventLoop.
Definition: ReventLoop.cpp:47