/*
 * LEIGH:plc
 * Copyright 2022 Alex Leigh
 *
 * This program is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the Free
 * Software Foundation, either version 3 of the License, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef _TLM_H
#define _TLM_H

#include <cJSON.h>

#define TLM_KEY_TIME "time"
#define TLM_KEY_LOS "los"
#define TLM_KEY_UOM "uom"
#define TLM_KEY_NAME "name"
#define TLM_KEY_VALUE "value"
#define TLM_KEY_PRIMARY "primary"
#define TLM_KEY_SYMBOLS "symbols"

// not arbitrary - these must agree with ESP
// TODO: Move to uom.h?
#define UOM_WETS "wet"
#define UOM_C "degc"

cJSON *tlmFframe_alloc();
cJSON* tlmFframe_symbol_alloc(const char *name, const char *value, const char *uom);
cJSON *tlmFframe_get_symbols(cJSON *frame);

#endif