mirror of
https://github.com/eclipse/paho.mqtt-sn.embedded-c.git
synced 2025-12-13 23:46:51 +01:00
1.Return CONNACK instead of the broker when the gateway receives CONNECT while the client is Sleep or Awake mode. 2.Define the max size of a que for PUBLISH while the client state is Asleep mode. Despose packets when the que is full of packets. 3.Return PUBACK or PUBREL to the broker when the client is Asleep or Awake. Signed-off-by: tomoaki <tomoaki@tomy-tech.com> Signed-off-by: tomoaki <tomoaki@tomy-tech.com>
This commit is contained in:
@@ -16,7 +16,6 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "LMqttsnClientApp.h"
|
||||
#include "LTimer.h"
|
||||
|
||||
@@ -63,3 +62,17 @@ void LTimer::stop(){
|
||||
_millis = 0;
|
||||
}
|
||||
|
||||
uint32_t LTimer::getRemain(void)
|
||||
{
|
||||
struct timeval curTime;
|
||||
uint32_t secs, usecs;
|
||||
if (_millis <= 0){
|
||||
return 0;
|
||||
}else{
|
||||
gettimeofday(&curTime, 0);
|
||||
secs = (curTime.tv_sec - _startTime.tv_sec) * 1000;
|
||||
usecs = (curTime.tv_usec - _startTime.tv_usec) / 1000.0;
|
||||
secs = _millis - (secs + usecs);
|
||||
return secs;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user