Skip to content

Latest commit

 

History

History
73 lines (49 loc) · 1.96 KB

mlog.md

File metadata and controls

73 lines (49 loc) · 1.96 KB

H4P Logo

H4P_MQTTLogger

Shortname mlog< N >

Registers a handler function with a selected set of events, which publishes the event message to MQTT using a topic name selected by the user.

For information on how to use this plugin, see Everything is an event: Listeners, Emitters and Handlers


Contents


Usage

H4P_MQTTLogger is a multiple-use plugin: there can be many in one app. They will appear as 1, 2. 3 etc. They may be instantiated as any name.

H4P_MQTTLogger myML1(...             // internal ref: mlog1
H4P_MQTTLogger myML2(...             // internal ref: mlog2
H4P_MQTTLogger anyNameYouChoose(...  // internal ref: mlog3

Dependencies

H4P_AsyncMQTT

Commands Added

N/A

Service Commands

stop / start have no effect

API

Constructor

/*
uint32_t filter; Name of the event (or combination of events) to be fowarded to the event handler function
const string& topic; MQTT topic name the event(s) is published to 
*/
H4P_MQTTLogger(const string& topic,uint32_t filter);

Example Sketch


(c) 2021 Phil Bowles [email protected]