mirror of
https://github.com/Wessel/c-websocket-server.git
synced 2026-07-14 12:34:10 +02:00
feat: Populate repo
This commit is contained in:
23
include/json.h
Normal file
23
include/json.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#ifndef JSON_H
|
||||
#define JSON_H
|
||||
|
||||
typedef struct {
|
||||
char* sensorId;
|
||||
char* sensorData;
|
||||
} Message;
|
||||
|
||||
typedef struct {
|
||||
Message payload;
|
||||
char* auth;
|
||||
} Envelope;
|
||||
|
||||
enum RESPONSE_CODES {
|
||||
SUCCESS,
|
||||
MISSING_JSON,
|
||||
MISSING_PAYLOAD,
|
||||
MISSING_AUTH
|
||||
};
|
||||
|
||||
int parse_envelope_json(const char* json, Envelope* envelope);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user