mash/mash.h

Sat, 14 Jul 2018 17:21:25 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Sat, 14 Jul 2018 17:21:25 +0200
changeset 533
49580ca85ab7
parent 147
0e7c51a66b5e
permissions
-rw-r--r--

Versie 0.6.3. MQTT device berichten alleen als een fermenter ingeschakeld is. MQTT fermenter birth en death berichhten als een fementer in of uitgeschakeld wordt. MQTT node death bericht bij normaal afsluiten van de daemon. Alle MQTT persistent berichten worden nu goed opgeruikmd.

#ifndef	_MASH_H
#define	_MASH_H


#define TRUE 1
#define FALSE 0

#include "../config.h"

#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <stdarg.h>
#include <string.h>
#include <ctype.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <time.h>
#include <fcntl.h>
#include <syslog.h>
#include <unistd.h>
#include <errno.h>
#include <signal.h>
#include <getopt.h>
#include <limits.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <poll.h>
#include <libxml/xmlmemory.h>
#include <libxml/parser.h>


#define MBSE_SS(x) (x)?(x):"(null)"


/* rdconfig.c */
typedef struct _key_list {
    char		*key;
    int			(*prc)(char **);
    char		**dest;
} key_list;

typedef struct _w1_therm {
    struct _w1_therm    *next;
    char                *master;                /* Master for this device       */
    int                 bus;                    /* Reserved for ds2482-800      */
    char                *name;                  /* Name of this device          */
    char                *alias;                 /* Friendly name                */
    int                 present;                /* 1=present, 0=absent          */
    int                 lastval;                /* Last valid value             */
    int			update;			/* Value updated		*/
} w1_therm;

typedef struct _sys_config {
    char		*name;			/* Configuration name		*/
    int			my_port;		/* my client/server port	*/
    w1_therm		*w1therms;		/* 1-wire temp sensors		*/
    int			lcd_cols;		/* LCD display columns		*/
    int			lcd_rows;		/* LCD display rows		*/
} sys_config;


void killconfig(void);
int  rdconfig(char *);
int  wrconfig(char *);




#endif

mercurial