mash/mash.h

changeset 103
99c47a8a61cb
child 143
54f9b5d39e4c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mash/mash.h	Sat Jul 12 21:59:19 2014 +0200
@@ -0,0 +1,82 @@
+#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>
+
+
+/* mosquitto */
+#include <mosquitto.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 *);
+
+
+
+#ifdef HAVE_WIRINGPI_H
+
+PI_THREAD (my_sensors_loop);
+
+#endif
+
+
+#endif
+

mercurial