-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLWM2M_Device_obj.h
66 lines (56 loc) · 1.7 KB
/
LWM2M_Device_obj.h
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
57
58
59
60
61
62
63
64
65
66
#ifndef LWM2M_DEVICE_OBJ_H
#define LWM2M_DEVICE_OBJ_H
#define DEVICE_OBJECT_ID "3"
#define MANUFACTURER "/3/0/0"
#define DEVICE_TYPE "/3/0/17"
#define MODEL_NUMBER "/3/0/1"
#define SERIAL_NUMBER "/3/0/2"
#define HARDWARE_VERSION "/3/0/18"
#define FIRMWARE_VERSION "/3/0/3"
#define SOFTWARE_VERSION "/3/0/19"
#define AVAILABLE_POWER_SOURCES "/3/0/6"
#define POWER_SOURCE_VOLTAGE "/3/0/7"
#define POWER_SOURCE_CURRENT "/3/0/8"
#define BATTERY_LEVEL "/3/0/9"
#define REBOOT "/3/0/4"
#define CURRENT_TIME "/3/0/13"
#define UTCOFFSET "/3/0/14"
#define TIMEZONE "/3/0/15"
#define ERROR_CODE "/3/0/11"
#define RESET_ERROR_CODE "/3/0/12"
#define SUPPORTED_BINGING_AND_MODES "/3/0/16"
#define OBJECT_INSTANCE(obj, inst) "/" obj "/" #inst
typedef enum{
INSTANCE_0 = 0,
INSTANCE_1,
INSTANCE_2,
INSTANCE_3,
}InstanceID;
typedef enum{
DC_POWER = 0,
INTERNAL_BATTERY,
EXTERNAL_BATTERY,
POWER_OVER_ETHERNET,
USB,
AC_MAIN_POWER,
SOLAR,
}AvailablePowerSources;
#define DEVICE_MAX_BUFF 100
#define OPERATION_PERFORM_TIMEOUT 1000
typedef struct{
char Manufacturer[DEVICE_MAX_BUFF];
char DeviceType[DEVICE_MAX_BUFF];
char ModelNumber[DEVICE_MAX_BUFF];
char SerialNumber[DEVICE_MAX_BUFF];
char HardwareVersion[DEVICE_MAX_BUFF];
char FirmwareVersion[DEVICE_MAX_BUFF];
char SoftwareVersion[DEVICE_MAX_BUFF];
int ErrorCode;
int PowerSourceVoltage;
int PowerSourceCurrent;
int BatteryLevel;
}_Device_obj;
_Device_obj DeviceObj;
void InitDevice(AwaClientSession * session);
void DeviceControl(AwaClientSession * session);
#endif