bmsd/websocket.c

changeset 680
0bb48333d133
parent 679
48f8f3fce7c0
child 681
7ed5c380e21b
equal deleted inserted replaced
679:48f8f3fce7c0 680:0bb48333d133
27 #include "bms.h" 27 #include "bms.h"
28 #include "xutil.h" 28 #include "xutil.h"
29 #include "websocket.h" 29 #include "websocket.h"
30 #include "fermenters.h" 30 #include "fermenters.h"
31 #include "co2meters.h" 31 #include "co2meters.h"
32 #include "ispindels.h"
32 #include <libwebsockets.h> 33 #include <libwebsockets.h>
33 34
34 35
35 extern sys_config Config; 36 extern sys_config Config;
36 extern int debug; 37 extern int debug;
122 syslog(LOG_NOTICE, "ws: reveived %ld bytes %s", len, buf); 123 syslog(LOG_NOTICE, "ws: reveived %ld bytes %s", len, buf);
123 if (strncmp(buf, (char *)"{\"device\":\"fermenters\",", 23) == 0) { 124 if (strncmp(buf, (char *)"{\"device\":\"fermenters\",", 23) == 0) {
124 fermenter_ws_receive(buf); 125 fermenter_ws_receive(buf);
125 } else if (strncmp(buf, (char *)"{\"device\":\"co2meters\",", 22) == 0) { 126 } else if (strncmp(buf, (char *)"{\"device\":\"co2meters\",", 22) == 0) {
126 co2meter_ws_receive(buf); 127 co2meter_ws_receive(buf);
128 } else if (strncmp(buf, (char *)"{\"device\":\"ispindels\",", 22) == 0) {
129 ispindel_ws_receive(buf);
127 } 130 }
128 131
129 break; 132 break;
130 133
131 case LWS_CALLBACK_CLOSED: 134 case LWS_CALLBACK_CLOSED:

mercurial