first commit
This commit is contained in:
42
main/mqtt_service/mqtt_protocol.c
Normal file
42
main/mqtt_service/mqtt_protocol.c
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* mqtt_protocol.c
|
||||
*
|
||||
* Created on: 28 May 2026
|
||||
* Author: Christian Lind Vie Madsen
|
||||
*/
|
||||
|
||||
#include "mqtt_protocol.h"
|
||||
|
||||
char *topics[5] = {
|
||||
|
||||
|
||||
};
|
||||
|
||||
void mqtt_protocol_GenerateTopic(char *buf, size_t size, mqtt_protocol_msg_t msg_type){
|
||||
|
||||
snprintf(buf, size,"SV/v1/1234/%d",msg_type+1);
|
||||
|
||||
}
|
||||
|
||||
void mqtt_protocol_heartbeat(char *buf,
|
||||
size_t size,
|
||||
const char *trailerId,
|
||||
const char *timestamp,
|
||||
const char *lat,
|
||||
const char *lon)
|
||||
{
|
||||
snprintf(buf, size,
|
||||
"{"
|
||||
"\"timestamp\":\"%s\","
|
||||
"\"location\":{"
|
||||
"\"latitude\":\"%s\","
|
||||
"\"longitude\":\"%s\""
|
||||
"}"
|
||||
"}",
|
||||
timestamp,
|
||||
lat,
|
||||
lon
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user