DDD
Dependencies: HW4 FP MQTTPacket
Fork of MQTT by
Diff: MQTTClient.cpp
- Revision:
- 9:01b8cc7d94cc
- Parent:
- 8:c46930bd6c82
- Child:
- 11:db15da110a37
- Child:
- 12:cc7f2d62a393
--- a/MQTTClient.cpp Wed Apr 09 13:48:20 2014 +0000 +++ b/MQTTClient.cpp Wed Apr 09 23:21:54 2014 +0000 @@ -23,3 +23,13 @@ ((Client<Network, Timer, Thread>*) arg)->run(NULL); } + +MQTT::PacketId::PacketId() +{ + next = 0; +} + +int MQTT::PacketId::getNext() +{ + return next = (next == MAX_PACKET_ID) ? 1 : ++next; +} \ No newline at end of file