Skip to content

Commit 8a2ff7a

Browse files
committed
Add message id to callback
1 parent 218feb2 commit 8a2ff7a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/examples/mqtt_interrupt/mqtt_interrupt.ino

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,12 @@ void disconnectedFromNetwork(void) { callback_flags |= NETWORK_DISCONN_FLAG; }
6363
void connectedToBroker(void) { callback_flags |= BROKER_CONN_FLAG; }
6464
void disconnectedFromBroker(void) { callback_flags |= BROKER_DISCONN_FLAG; }
6565

66-
void receive(char *topic, uint16_t msg_length) {
66+
void receive(const char *topic,
67+
const uint16_t msg_length,
68+
const int32_t message_id) {
69+
// Message ID is not used here, as we don't specify a MQTT Quality of
70+
// Service different from the default one. Read more about this in the
71+
// documentation for the onReceive() function in MqttClient
6772
memcpy(topic_buffer, topic, MQTT_TOPIC_MAX_LENGTH);
6873
message_length = msg_length;
6974

0 commit comments

Comments
 (0)