1 /** \ingroup RandomProximityIdentifier
3 * @author David Llewellyn-Jones <david@flypig.co.uk>
8 * Copyright David Llewellyn-Jones, 2020
9 * Released under the GPLv2.
11 * @brief Random Proximity Identifier functionality
12 * @section DESCRIPTION
14 * This class is used to generate and manage the Random Proximity Identifier
15 * (RPI). It's largely internal. The functionality from \ref Contrac should
16 * generally be used in preference to this.
20 /** \addtogroup RandomProximityIdentifier
29 #include "contrac/contrac.h"
30 #include "contrac/dtk.h"
35 * The size in bytes of an RPI in binary format.
41 * The size in bytes of an RPI in base64 format, not including the null
45 #define RPI_SIZE_BASE64 (24)
48 * The maximum value a time interval number can take. Time interval numbers
49 * are measured from the start of the day and increment every 10 minutes, so
50 * must fall within the interval [0, 143].
53 #define RPI_INTERVAL_MAX (144)
58 * An opaque structure for representing a DTK.
60 * The internal structure can be found in rpi.c
62 typedef struct _Rpi Rpi
;
64 // Function prototypes
67 void rpi_delete(Rpi
* data
);
69 bool rpi_generate_proximity_id(Rpi
* data
, Dtk
const * dtk
, uint8_t time_interval_number
);
70 unsigned char const * rpi_get_proximity_id(Rpi
const * data
);
71 uint8_t rpi_get_time_interval_number(Rpi
const * data
);
72 void rpi_assign(Rpi
* data
, unsigned char const * rpi_bytes
, uint8_t time_interval_number
);
73 bool rpi_compare(Rpi
const * data
, Rpi
const * comparitor
);
75 // Function definitions
79 /** @} addtogroup RandomProximityIdentifier */