pfodParser 3.61.0 The pfodParser library is handles commands sent from the Android pfodApp, pfodApp supports WiFi, BLE, Bluetooth and SMS connections

Classes | Macros
pfodSecurity.h File Reference
`#include <Arduino.h>`
`#include "pfodStream.h"`
`#include "pfodParser.h"`
`#include "pfodRawCmdParser.h"`
`#include "pfodMAC.h"`
`#include "pfod_Base.h"`
`#include "pfodDwgs.h"`
`#include "pfodControl.h"`
`#include "pfodDrawing.h"`
`#include "pfodLinkedList.h"`

Go to the source code of this file.

## Classes
class | pfodSecurity

## Macros
#define | PFOD_RAW_CMD_PARSER
| pfodSecurity for Arduino Parses commands of the form { cmd | arg1 `arg2 ...` More...
#define | pfod_MAYBE_UNUSED(x) (void)(x)

## Macro Definition Documentation

## ◆ pfod_MAYBE_UNUSED

#define pfod_MAYBE_UNUSED | ( |  | x | ) | (void)(x)

Definition at line 61 of file pfodSecurity.h.

## ◆ PFOD_RAW_CMD_PARSER

#define PFOD_RAW_CMD_PARSER

pfodSecurity for Arduino Parses commands of the form { cmd | arg1 `arg2 ...`

} hashCode Arguments are separated by The | and the args are optional This is a complete paser for ALL commands a pfodApp will send to a pfodDevice see www.pfod.com.au for more details. see http://www.forward.com.au/pfod/secureChallengeResponse/index.html for the details on the 128bit security and how to generate a secure secret password

pfodSecurity adds about 2100 bytes to the program and uses about 400 bytes RAM and upto 19 bytes of EEPROM starting from the address passed to init()

The pfodSecurity parses messages of the form { cmd | arg1 `arg2` ... } hashCode The hashCode is checked against the SipHash_2_4 using the 128bit secret key. The hash input is the message count, the challenge for this connection and the message If the hash fails the cmd is set to DisconnectNow (0xff) It is then the responsability of the calling program to close the connection. and to call pfodSecurity::disconnected() when the connection is closed.

If the hash passes the message is parsed into the args array by replacing '|', '‘’ and '}' with '/0' (null)

When the the end of message } is seen parse() returns the first byte of the cmd getCmd() returns a pointer to the null terminated cmd skipCmd() returns a pointer to the first arg (null terminated) or a pointer to null if there are no args getArgsCount() returns the number of args found. These calls are valid until the start of the next msg { is parsed. At which time they are reset to empty command and no args.

Definition at line 45 of file pfodSecurity.h.