feat(pico-sensor): added callback in mqtt client to process incomming messages in application
This commit is contained in:
@@ -70,6 +70,32 @@ void MqttClient_Deinit(void);
|
||||
*/
|
||||
void MqttClient_Init(void);
|
||||
|
||||
typedef enum topic_ID_e {
|
||||
Topic_ID_None,
|
||||
#if MQTT_CLIENT_IS_EV_CHARGER
|
||||
Topic_ID_Solar_Power, /* power from PV panels */
|
||||
Topic_ID_Site_Power, /* power to the house/site */
|
||||
Topic_ID_Grid_Power, /* power from/to grid */
|
||||
Topic_ID_Battery_Power, /* power from/to battery */
|
||||
Topic_ID_Battery_Percentage,/* battery level percentage */
|
||||
Topic_ID_Charging_Power, /* actual charging power */
|
||||
#elif MQTT_CLIENT_IS_SENSOR
|
||||
Topic_ID_Sensor_Update,
|
||||
#endif
|
||||
} topic_ID_e;
|
||||
|
||||
/*!
|
||||
* \brief Callback function for incoming messages
|
||||
*/
|
||||
typedef void (*MqttClient_MessageCallback_t)(topic_ID_e topic, const unsigned char *payload, size_t len);
|
||||
|
||||
/*!
|
||||
* \brief Register a callback function for incoming messages
|
||||
* \param cb Callback function to be registered
|
||||
*/
|
||||
void MqttClient_RegisterMessageCallback(MqttClient_MessageCallback_t cb);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user