init: initial commit
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
#pragma once
|
||||
|
||||
#include "esp_err.h"
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/event_groups.h"
|
||||
|
||||
/* Event bits set by the MQTT publisher into the shared event group */
|
||||
#define MQTT_CONNECTED_BIT BIT0
|
||||
#define MQTT_CALIBRATE_START BIT1
|
||||
#define MQTT_CALIBRATE_STOP BIT2
|
||||
#define MQTT_SELECTED_BIT BIT3
|
||||
#define MQTT_DESELECTED_BIT BIT4
|
||||
|
||||
/**
|
||||
* Initialise and connect the MQTT client.
|
||||
*
|
||||
* sensor_id — stable anchor ID string (e.g. "anchor_a1b2c3")
|
||||
* broker_uri — e.g. "mqtt://192.168.1.100:1883"
|
||||
* evt_group — FreeRTOS event group; publisher sets bits above on events
|
||||
*/
|
||||
esp_err_t mqtt_publisher_init(const char *sensor_id,
|
||||
const char *broker_uri,
|
||||
EventGroupHandle_t evt_group);
|
||||
|
||||
/** Publish an RSSI reading. Non-blocking (QoS 1). */
|
||||
void mqtt_publisher_send_rssi(const char *tag_id, int8_t rssi);
|
||||
|
||||
/** Publish the announce message (empty payload). */
|
||||
void mqtt_publisher_announce(void);
|
||||
Reference in New Issue
Block a user