-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDeviceHandler.h
More file actions
60 lines (40 loc) · 1.36 KB
/
DeviceHandler.h
File metadata and controls
60 lines (40 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
DeviceLoader.h - Handle the controlled device
Saul bertuccio 4 feb 2017
Released into the public domain.
*/
#ifndef DeviceHandler_h
#define DeviceHandler_h
#include "Device.h"
#include "FS.h"
class DeviceHandler {
public:
static const char SEP=';';
static const char EOL='\n';
static const String DATA_DIR;
static String *getDevicesName();
static int getDevicesNum();
static int getDeviceTypesNum();
static String * getDeviceTypes();
static String * getDeviceTypesDescription();
DeviceHandler();
~DeviceHandler();
boolean setDevice( const String &device_name, const String &device_type );
boolean setDevice( const String &device_name );
boolean renameDevice( const String &new_name);
boolean addDeviceKey( String * attr );
boolean deleteDeviceKey( String &kname);
boolean deleteDevice();
boolean saveDevice();
Device & getDevice();
private:
boolean is_opened;
Device * device;
static Device * loadDeviceFile( const String &device_name );
static boolean renameDeviceFile( const String &old_name, const String &new_name);
static boolean deleteDeviceFile( const String &device_name );
static boolean existsDeviceFile( const String &device_name );
static boolean saveDeviceFile( Device * device );
static int recountDevices(bool force);
};
#endif