Files
paho.mqtt-sn.embedded-c/MQTTSNGateway/GatewayTester/src/LTaskManager.h
tomoaki 4935d2aa86 BugFix of #86
Fix of warning: comparison between signed and unsigned integer
expressions 


Set a null string to the client ID when it of CONNECT is empty.

Signed-off-by: tomoaki <tomoaki@tomy-tech.com>
2017-09-28 07:19:22 +09:00

67 lines
1.6 KiB
C++

/**************************************************************************************
* Copyright (c) 2016, Tomoaki Yamaguchi
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v1.0 which accompany this distribution.
*
* The Eclipse Public License is available at
* http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* Contributors:
* Tomoaki Yamaguchi - initial API and implementation and/or initial documentation
**************************************************************************************/
#ifndef TASKMANAGER_H_
#define TASKMANAGER_H_
#include <stdio.h>
#include <string.h>
#include <time.h>
#include "LMqttsnClientApp.h"
#include "LTimer.h"
using namespace std;
namespace linuxAsyncClient {
struct TaskList{
void (*callback)(void);
time_t interval;
time_t prevTime;
uint8_t count;
};
struct TestList {
const char* testLabel;
void (*testTask)(void);
uint8_t count;
};
/*========================================
Class TaskManager
=======================================*/
class LTaskManager{
public:
LTaskManager();
~LTaskManager();
void add(TaskList* task);
void add(TestList* test);
void run(void);
void done(uint8_t index);
void suspend(uint8_t index);
uint8_t getIndex(void);
private:
TaskList* _tasks;
TestList* _tests;
uint8_t _index;
};
} /* end of namespace */
#endif /* TASKMANAGER_H_ */