Leosac
0.8.0
Open Source Access Control
|
#include <rplethprotocol.hpp>
Public Types | |
enum | TypeCode { Rpleth = 0x00, HID = 0x01, LCD = 0x02, MaxType } |
enum | RplethCommands { DHCPState = 0x01, SetDHCP = 0x02, SetMAC = 0x03, SetIP = 0x04, SetSubnet = 0x05, SetGateway = 0x06, SetPort = 0x07, Message = 0x08, Reset = 0x09, Ping = 0x0a } |
enum | HIDCommands { Beep = 0x00, Greenled = 0x01, Redled = 0x02, Nop = 0x03, Badge = 0x04, Com = 0x05, Wait_insertion = 0x06, Wait_removal = 0x07, Connect = 0x08, Disconnect = 0x09, GetReaderType = 0x0a, GetCSN = 0x0b, SetCardType = 0x0c, SendCards = 0x0d, ReceiveCardsWaited = 0x0e } |
enum | StatusCode { Success = 0x00, Failed = 0x01, BadChecksum = 0x02, Timeout = 0x03, BadSize = 0x04, BadType = 0x05, MaxStatus } |
Static Public Member Functions | |
static RplethPacket | decodeCommand (CircularBuffer &buffer, bool from_server=false) |
Decode a packet from a circular buffer object. More... | |
static std::size_t | encodeCommand (const RplethPacket &packet, Byte *buffer, std::size_t size) |
Private Member Functions | |
RplethProtocol ()=delete | |
Static Private Attributes | |
static const std::size_t | TypeByteIdx = 0 |
static const std::size_t | CommandByteIdx = 1 |
static const std::size_t | SizeByteIdx = 2 |
static const std::size_t | PacketMinSize = 4 |
Definition at line 41 of file rplethprotocol.hpp.
Enumerator | |
---|---|
Beep | |
Greenled | |
Redled | |
Nop | |
Badge | |
Com | |
Wait_insertion | |
Wait_removal | |
Connect | |
Disconnect | |
GetReaderType | |
GetCSN | |
SetCardType | |
SendCards | |
ReceiveCardsWaited |
Definition at line 72 of file rplethprotocol.hpp.
Enumerator | |
---|---|
DHCPState | |
SetDHCP | |
SetMAC | |
SetIP | |
SetSubnet | |
SetGateway | |
SetPort | |
Message | |
Reset | |
Ping |
Definition at line 58 of file rplethprotocol.hpp.
Enumerator | |
---|---|
Success | |
Failed | |
BadChecksum | |
Timeout | |
BadSize | |
BadType | |
MaxStatus |
Definition at line 91 of file rplethprotocol.hpp.
Enumerator | |
---|---|
Rpleth | |
HID | |
LCD | |
MaxType |
Definition at line 51 of file rplethprotocol.hpp.
|
privatedelete |
|
static |
Decode a packet from a circular buffer object.
If from_server
is true that means the packet comes from a Rpleth server: this is used by unit testing code.
Definition at line 32 of file rplethprotocol.cpp.
|
static |
Definition at line 72 of file rplethprotocol.cpp.
|
staticprivate |
Definition at line 44 of file rplethprotocol.hpp.
|
staticprivate |
Definition at line 46 of file rplethprotocol.hpp.
|
staticprivate |
Definition at line 45 of file rplethprotocol.hpp.
|
staticprivate |
Definition at line 43 of file rplethprotocol.hpp.