Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed SDFileSystem
include/DeviceRepeater.h
- Committer:
- Inscape_ao
- Date:
- 2019-05-11
- Revision:
- 7:9ab8809f9693
- Child:
- 10:db2be22bc2f9
File content as of revision 7:9ab8809f9693:
#ifndef _DEVICEREPEATER_H_
#define _DEVICEREPEATER_H_
#include "DeviceDriverInterface.h"
class DeviceRepeater
{
public:
typedef enum device_attr_status {
DEV_FATAL = -2,
DEV_NOT_INIT = -1,
DEV_READY = 0,
DEV_RUNNING,
DEV_REQ_STOP,
} DevStatus;
private:
static const int DEFAULT_REPEAT_MAX_COUNT = 1;
static const int DEFAULT_REPEAT_STRIDE = 5;
static const int NOT_ID_SELECTED = -1;
private:
int selected_id;
DevStatus stat;
DeviceDriver *pDriver;
/* Tick base class */
Ticker *pClock;
/* members for repeating */
int repeat_max_count;
int repeat_stride_sec;
int repeat_remain_cnt;
int repeat_remain_sec;
private:
DeviceRepeater(void);
public:
DeviceRepeater(DeviceDriver *setDriver);
bool setRepeatCount(int maxcount);
bool setRepeatStride(int sec);
bool setConfigId(int id);
bool setConfigValue(int setValue);
bool getConfigValue(int *retValue);
bool start();
bool stop();
bool readyToStart();
void tick();
bool resetAllStatus(void);
private:
bool init();
};
#endif /* _DEVICEREPEATER_H_ */