-
Notifications
You must be signed in to change notification settings - Fork 3
/
json.h
32 lines (23 loc) · 931 Bytes
/
json.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef __JSON_H__
#define __JSON_H__
#include <stdio.h>
#include <stdlib.h>
#include <json-c/json.h>
#include <mosquitto.h>
#include "get_config.h"
#include "node.h"
#include "logger.h"
struct channel_command
{
int module;
int channel;
int value;
};
//extern struct json_object *jsonCompleteKbus;
//extern struct json_object *jsonSend;
extern char *build_error_object(bool error, struct node controller, struct prog_config, char *error_msg);
extern struct channel_command parse_command_message(char *message);//, int *module_position, int * channel_position, int *channel_value);
extern voidbuild_controller_object(struct mosquitto *mosq, struct node controller);
extern void build_event_object(struct mosquitto *mosq, struct node controller, int modulePosition, int channelPosition, int channelValue);
extern int *parse_mqtt(struct mosquitto *mosq, char *message);
#endif /*__JSON_H__*/