Skip to content

Commit 5dcc333

Browse files
committed
fix(mosq): Update API docs adding on-message callback
1 parent 840a561 commit 5dcc333

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

components/mosquitto/api.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
| Type | Name |
1616
| ---: | :--- |
1717
| struct | [**mosq\_broker\_config**](#struct-mosq_broker_config) <br>_Mosquitto configuration structure._ |
18+
| typedef void(\* | [**mosq\_message\_cb\_t**](#typedef-mosq_message_cb_t) <br> |
1819

1920
## Functions
2021

@@ -34,12 +35,20 @@ ESP port of mosquittto supports only the options in this configuration structure
3435

3536
Variables:
3637

38+
- void(\* handle_message_cb <br>On message callback. If configured, user function is called whenever mosquitto processes a message.
39+
3740
- char \* host <br>Address on which the broker is listening for connections
3841

3942
- int port <br>Port number of the broker to listen to
4043

4144
- esp\_tls\_cfg\_server\_t \* tls_cfg <br>ESP-TLS configuration (if TLS transport used) Please refer to the ESP-TLS official documentation for more details on configuring the TLS options. You can open the respective docs with this idf.py command: `idf.py docs -sp api-reference/protocols/esp_tls.html`
4245

46+
### typedef `mosq_message_cb_t`
47+
48+
```c
49+
typedef void(* mosq_message_cb_t) (char *client, char *topic, char *data, int len, int qos, int retain);
50+
```
51+
4352
4453
## Functions Documentation
4554

0 commit comments

Comments
 (0)