Hey together,
I have a integer variable that I publish to an MQTT broker as a life bit.
Since I want to let this run for basically forever, I want to make sure that the variable doesnt overflow.
How can I make sure that doesnt happen?
How I declared the variable:
int MqttPayloadLifeBit = 0;
How it's used:
// Publish lifebit message
mqttClient.beginMessage(MqttTopicPub, MqttPayloadPub.length(), MqttRetainedPub, MqttQosPub, MqttDupPub);
mqttClient.print(MqttPayloadPub);
mqttClient.endMessage();
// Count life bit
MqttPayloadLifeBit++;
Thank you so far!