mash/mash.h

changeset 103
99c47a8a61cb
child 143
54f9b5d39e4c
equal deleted inserted replaced
102:e37b9c571a56 103:99c47a8a61cb
1 #ifndef _MASH_H
2 #define _MASH_H
3
4
5 #define TRUE 1
6 #define FALSE 0
7
8 #include "../config.h"
9
10 #include <stdlib.h>
11 #include <stdio.h>
12 #include <stdint.h>
13 #include <stdarg.h>
14 #include <string.h>
15 #include <ctype.h>
16 #include <sys/types.h>
17 #include <sys/stat.h>
18 #include <sys/time.h>
19 #include <time.h>
20 #include <fcntl.h>
21 #include <syslog.h>
22 #include <unistd.h>
23 #include <errno.h>
24 #include <signal.h>
25 #include <getopt.h>
26 #include <limits.h>
27 #include <sys/socket.h>
28 #include <arpa/inet.h>
29 #include <netdb.h>
30 #include <poll.h>
31 #include <libxml/xmlmemory.h>
32 #include <libxml/parser.h>
33
34
35 /* mosquitto */
36 #include <mosquitto.h>
37
38 #define MBSE_SS(x) (x)?(x):"(null)"
39
40
41 /* rdconfig.c */
42 typedef struct _key_list {
43 char *key;
44 int (*prc)(char **);
45 char **dest;
46 } key_list;
47
48 typedef struct _w1_therm {
49 struct _w1_therm *next;
50 char *master; /* Master for this device */
51 int bus; /* Reserved for ds2482-800 */
52 char *name; /* Name of this device */
53 char *alias; /* Friendly name */
54 int present; /* 1=present, 0=absent */
55 int lastval; /* Last valid value */
56 int update; /* Value updated */
57 } w1_therm;
58
59 typedef struct _sys_config {
60 char *name; /* Configuration name */
61 int my_port; /* my client/server port */
62 w1_therm *w1therms; /* 1-wire temp sensors */
63 int lcd_cols; /* LCD display columns */
64 int lcd_rows; /* LCD display rows */
65 } sys_config;
66
67
68 void killconfig(void);
69 int rdconfig(char *);
70 int wrconfig(char *);
71
72
73
74 #ifdef HAVE_WIRINGPI_H
75
76 PI_THREAD (my_sensors_loop);
77
78 #endif
79
80
81 #endif
82

mercurial