/****************************************************************************
 * This file is part of the project AqHome.
 * AqHome (c) by 2023 Martin Preuss, all rights reserved.
 *
 * The license for this file can be found in the file COPYING which you
 * should have received along with this file.
 ****************************************************************************/

#ifndef AQHOMED_P_H
#define AQHOMED_P_H


#include "./aqhomed.h"

#include "aqhome/nodes/nodedb.h"


/* default values */
#define AQHOMED_DEFAULT_NODEADDR          240
#define AQHOMED_DEFAULT_PIDFILE           "/var/run/aqhomed.pid"
#define AQHOMED_DEFAULT_DEVICE            "/dev/ttyUSB0"
#define AQHOMED_DEFAULT_IPC_PORT          45454
#define AQHOMED_DEFAULT_MQTT_CLIENTID     "aqhomed"
#define AQHOMED_DEFAULT_MQTT_TOPIC_PREFIX "aqhome/sensors"
#define AQHOMED_DEFAULT_MQTT_KEEPALIVE    600
#define AQHOMED_DEFAULT_MQTT_PORT         1883



struct AQHOMED {
  GWEN_MSG_ENDPOINT *rootEndpoint;

  GWEN_MSG_ENDPOINT *ttyEndpoint;
  GWEN_MSG_ENDPOINT *ipcdEndpoint;
  GWEN_MSG_ENDPOINT *mqttEndpoint;

  AQH_NODE_DB *nodeDb;

  GWEN_DB_NODE *dbArgs;

  char *dbFile;
  char *logFile;
  char *writeFolder;
  char *pidFile;

  int nodeAddress;
  char *mqttTopicPrefix;
};

#endif

