#include <pfodSecurity.h>
Inherits pfodParser.
Definition at line 63 of file pfodSecurity.h.
◆ pfodSecurity() [1/2]
pfodSecurity::pfodSecurity |
( |
| ) |
|
◆ pfodSecurity() [2/2]
pfodSecurity::pfodSecurity |
( |
const char * |
_version | ) |
|
◆ addDwg()
◆ available()
int pfodSecurity::available |
( |
| ) |
|
|
virtual |
◆ byte64ToByte()
static uint8_t pfodSecurity::byte64ToByte |
( |
uint8_t |
b | ) |
|
|
static |
◆ closeConnection()
void pfodSecurity::closeConnection |
( |
| ) |
|
|
virtual |
◆ connect() [1/4]
void pfodSecurity::connect |
( |
pfod_Base * |
_pfodBase | ) |
|
◆ connect() [2/4]
void pfodSecurity::connect |
( |
pfod_Base * |
_pfodBase, |
|
|
const __FlashStringHelper * |
hexKeyPgr, |
|
|
int |
eepromAddress = 0 |
|
) |
| |
◆ connect() [3/4]
void pfodSecurity::connect |
( |
Stream * |
io_arg | ) |
|
|
virtual |
initialize the Security parser args io_arg the Stream pointer to read and write to for pfod messages
eepromAddress the starting address in eeprom to save the key and power cycles amount of eeprom used is (2 bytes power cycles + 1 byte key length + key bytes) ==> 3 + (input hexKey length)/2, use -1 to disable use of EEPROM, pfod_EEPROM.h will also disable EEPROM use for those boards that do not have EEPROm
hexKey pointer to program memory F("hexString") holding the key if this key is different from the current one in eeprom the eeprom is updated and the power cycles are reset to 0xffff if changing the key suggest you add 2 to your eepromAddress to move on from the previous one. The power cycle EEPROM addresses are are written to on each power up if hexKey is omitted or empty or blank then there is no sercurity used and EEPROM is not used.
Reimplemented from pfodParser.
◆ connect() [4/4]
void pfodSecurity::connect |
( |
Stream * |
io_arg, |
|
|
const __FlashStringHelper * |
hexKeyPgr, |
|
|
int |
eepromAddress = 0 |
|
) |
| |
◆ decodePasswordBytes()
static uint32_t pfodSecurity::decodePasswordBytes |
( |
byte * |
bytes, |
|
|
int |
idx, |
|
|
int |
bytesLen |
|
) |
| |
|
static |
◆ flush()
void pfodSecurity::flush |
( |
| ) |
|
|
virtual |
◆ getBytesFromPassword()
static int pfodSecurity::getBytesFromPassword |
( |
char * |
hexKey, |
|
|
int |
hexKeyLen, |
|
|
byte * |
keyBytes, |
|
|
int |
keyMaxLen |
|
) |
| |
|
static |
◆ getIdleTimeout()
unsigned long pfodSecurity::getIdleTimeout |
( |
| ) |
|
◆ getPfodAppStream()
Stream* pfodSecurity::getPfodAppStream |
( |
| ) |
|
|
virtual |
◆ getRawCmd()
byte* pfodSecurity::getRawCmd |
( |
| ) |
|
◆ init()
void pfodSecurity::init |
( |
| ) |
|
◆ isIdleTimeout()
bool pfodSecurity::isIdleTimeout |
( |
| ) |
|
◆ parse()
byte pfodSecurity::parse |
( |
| ) |
|
|
virtual |
◆ peek()
int pfodSecurity::peek |
( |
| ) |
|
|
virtual |
◆ read()
int pfodSecurity::read |
( |
| ) |
|
|
virtual |
◆ setDebugStream()
void pfodSecurity::setDebugStream |
( |
Print * |
debugOut | ) |
|
|
virtual |
◆ setIdleTimeout()
void pfodSecurity::setIdleTimeout |
( |
unsigned long |
timeout_in_seconds | ) |
|
|
virtual |
Set the idle Timeout in sec i.e.
15 ==> 15sec, 0 means never timeout Default is 15 (sec) When set to >0 then if no incoming msg received for this time (in Sec), then the parser will return DisconnectNow to disconnect the link
Setting this to non-zero value protects against a hacker taking over your connection and just hanging on to it not sending any msgs but not releasing it, so preventing you from re-connecting. when setting to non-zero you can use the pfod re-request time to ask the pfodApp to re-request a menu every so often to prevent the connection timing out while the pfodApp is running. See the pfod Specification for details.
Set to >0 to enable the timeout (recommended)
Reimplemented from pfodParser.
◆ write() [1/2]
size_t pfodSecurity::write |
( |
const uint8_t * |
buffer, |
|
|
size_t |
size |
|
) |
| |
|
virtual |
◆ write() [2/2]
size_t pfodSecurity::write |
( |
uint8_t |
| ) |
|
|
virtual |