pfodParser  3.61.0
The pfodParser library is handles commands sent from the Android pfodApp, pfodApp supports WiFi, BLE, Bluetooth and SMS connections
pfodSecurityClient.h File Reference
#include <Arduino.h>
#include "pfodStream.h"
#include "pfodParser.h"
#include "pfodMACClient.h"
#include "pfodRingBuffer.h"
#include "pfod_Base.h"

Go to the source code of this file.

Classes

class  pfodSecurityClient
 

Macros

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

Macro Definition Documentation

◆ pfod_MAYBE_UNUSED

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

pfodSecurityClient 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

pfodSecurityClient 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 pfodSecurityClient 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 pfodSecurityClient::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 53 of file pfodSecurityClient.h.