index 3edc43f882dae8786e57bd7abcdb36ceda852361..016ec003f2bf5533927f3f72ec8085670d0bb5f9 100644 (file)
#include "tic.h"
-bool filter_mode;
+bool filter_mode; ///< if true, switch lexers to configuration parsing
bool *etiq_en; ///< when non-NULL, a token-indexed array, where the related token is emitted if the value is true. @note This could be made a bit field if memory is a concern
void make_field(struct tic_field *field, const struct tic_etiquette *etiq, char *horodate, char *data)
index 0f12e746578307274d1442e2222acf4dd797f9e3..f01670a09f1bd48a2c84c35744bc0ced42db8d29 100644 (file)
/**
* @file
* Interface for TIC parsers
- * Users of this interface must implement the functions listed at the bottom:
+ * Users of this interface must implement the functions declared at the bottom:
* - print_field()
* - frame_sep()
* - frame_err()
T_HEX = 0x20,
};
+/** Internal parser representation of a TIC etiquette */
struct tic_etiquette {
- uint8_t tok;
- uint8_t unittype;
- const char *label;
- const char *desc;
+ uint8_t tok; ///< bison token number
+ uint8_t unittype; ///< combined unit and type (see @tic_unit @data_type)
+ const char *label; ///< TIC "etiquette", as an ASCII string
+ const char *desc; ///< corresponding TIC long description
};
+/** Internal parser representation of a TIC field (i.e. body of a dataset) */
struct tic_field {
- struct tic_etiquette etiq;
+ struct tic_etiquette etiq; ///< the field "etiquette"
union {
char *s;
int i;
- } data;
- char *horodate;
+ } data; ///< the field data, if any
+ char *horodate; ///< the field horodate, if any
};
void make_field(struct tic_field *field, const struct tic_etiquette *etiq, char *horodate, char *data);
index 4aa31e89fe98d3880e951bc255e29f2399cd96d7..f841c18b61258cfbf54914b38560751619e5e0c8 100644 (file)
extern bool filter_mode;
extern bool *etiq_en;
+/** Global configuration details */
static struct {
const char *idtag;
char framedelims[2];
char ferr;
} tp;
+/** enum for optflags bitfield */
enum {
OPT_MASKZEROES = 0x01,
OPT_CRFIELD = 0x02,
OPT_PARSESTGE = 0x20,
};
+/** TIC units representation strings */
static const char * tic_units[] = {
[U_SANS] = "",
[U_WH] = "Wh",
index f280bcd71c6fc4e71d4a9a3e1112c6b523a08589..a9d3350e04d5deb5c45d4cf237a9babf7455082c 100644 (file)
/**
* @file
- * Complete lexer for ENEDIS' TIC protocol.
- * Supports version 01, a.k.a "historique" as found on ENEDIS' LINKY smart meter.
+ * Complete lexer for ENEDIS' TIC protocol version 01.
+ * Supports version 01, a.k.a "historique" as found on ENEDIS' Linky and Bleus meters.
* Ref doc: https://www.enedis.fr/media/2027/download
*
* "le champ « étiquette » ne contient aucun caractère ayant une valeur égale à celle
index e3cdb9a3ae8180639d328dbd3f68e8d2c94c1961..492bdbf300794be369c9facf1f711aea8caf0317 100644 (file)
// License: GPLv2 - http://www.gnu.org/licenses/gpl-2.0.html
*/
-/*
- * Complete lexer for ENEDIS' TIC protocol.
- * Supports version 02, a.k.a "standard" as found on ENEDIS' LINKY smart meter.
+/**
+ * @file
+ * Complete lexer for ENEDIS' TIC protocol version 02.
+ * Supports version 02, a.k.a "standard" as found on ENEDIS' Linky smart meter.
* Ref doc: https://www.enedis.fr/media/2035/download
*/