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
17
namespace
Retro
{
18
19
//------------------------------------------+-----------------------------------
21
22
inline
RlinkCrc16::RlinkCrc16
()
23
: fCrc(0)
24
{}
25
26
//------------------------------------------+-----------------------------------
28
29
inline
void
RlinkCrc16::Clear
()
30
{
31
fCrc
= 0;
32
return
;
33
}
34
35
//------------------------------------------+-----------------------------------
37
38
inline
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
48
inline
uint16_t
RlinkCrc16::Crc
()
const
49
{
50
return
fCrc
;
51
}
52
53
}
// end namespace Retro
Retro::RlinkCrc16::fCrc16Table
static const uint16_t fCrc16Table[256]
FIXME_docs.
Definition:
RlinkCrc16.hpp:35
Retro::RlinkCrc16::RlinkCrc16
RlinkCrc16()
Default constructor.
Definition:
RlinkCrc16.ipp:22
Retro::RlinkCrc16::Clear
void Clear()
FIXME_docs.
Definition:
RlinkCrc16.ipp:29
Retro::RlinkCrc16::Crc
uint16_t Crc() const
FIXME_docs.
Definition:
RlinkCrc16.ipp:48
Retro::RlinkCrc16::AddData
void AddData(uint8_t data)
FIXME_docs.
Definition:
RlinkCrc16.ipp:38
Retro::RlinkCrc16::fCrc
uint16_t fCrc
current crc value
Definition:
RlinkCrc16.hpp:34
Retro
Declaration of class ReventLoop.
Definition:
ReventLoop.cpp:47
librlink
RlinkCrc16.ipp
Generated on Thu Feb 9 2023 12:40:56 for w11 - cpp by
1.9.6