ESP8266 Centre + NB
app_study_room.h
浏览该文件的文档.
1 
15 /* Define to prevent recursive inclusion -------------------------------------*/
16 #ifndef __APP_STUDY_ROOM_H__
17 #define __APP_STUDY_ROOM_H__
18 
19 /* Includes ------------------------------------------------------------------*/
20 // #include <stddef.h>
21 // #include <stdint.h>
22 #include "ets_sys.h"
23 #include "os_type.h"
24 
25 #include "osapi.h" /* 需要用到os_sprintf */
26 #include "driver/uart.h" /* 需要用到ESP_DEBUG */
27 
28 /* Exported typedef -----------------------------------------------------------*/
29 
31 typedef enum
32 {
33  DEVICE_FAN = 0x00,
34  DEVICE_LIGHT = 0x01,
35  DEVICE_CUTRAIN = 0x02,
36  DEVICE_AC = 0x03
37 } Device;
38 
40 typedef enum
41 {
42  MID_SET_FAN = 0x0,
43  MID_SET_LIGHT = 0x1,
45  MID_SET_AC = 0x3,
57 
59 typedef struct
60 {
66 
68 typedef struct
69 {
75 } RoomMessage;
76 
78 typedef struct
79 {
82  uint8 fanStatus[6];
84  uint8 lightStatus[6];
86  uint8 curtainStatus[6];
88  uint8 acStatus[6];
89 } RoomStatus;
90 
91 /* Exported constants --------------------------------------------------------*/
92 #define cn_app_bands "5,8,20"
93 #define cn_app_plmn "46011";
94 #define cn_app_apn "1,\"IP\",\"HUAWEI.COM\""
95 
96 /* 信息来源:华为IoT平台-应用-对接信息-设备接入信息 */
97 #define HUAWEI_IOT_SERVER "49.4.85.232"
98 #define HUAWEI_IOT_PORT "5683"
101 /* Exported function -----------------------------------------------*/
102 void StudyRoom_UpdataData(uint8 *msg_string);
104 
105 #endif /* __APP_STUDY_ROOM_H__ */
106 /********************************** END OF FILE *******************************/
107 
108 typedef unsigned char int8u;
109 typedef char int8s;
110 typedef unsigned short int16u;
111 typedef short int16s;
112 typedef unsigned char int24u;
113 typedef char int24s;
114 typedef int int32s;
115 typedef char string;
116 typedef char array;
117 typedef char varstring;
118 typedef char variant;
119 
120 short int Lux;
121 
122 // typedef struct
123 // {
124 // int8u messageId;
125 // int8u room;
126 // int8u fanNo;
127 // int8u fanGear;
128 // } tag_app_SET_FAN;
129 
130 // typedef struct
131 // {
132 // int8u messageId;
133 // int8u room;
134 // int8u acNo;
135 // int8u acTemp;
136 // } tag_app_SET_AC;
137 
138 #define Swap16(A) ((((uint16)(A)&0xff00) >> 8) | (((uint16)(A)&0x00ff) << 8))
139 #define Swap32(A) \
140  ((((uint32)(A)&0xff000000) >> 24) | (((uint32)(A)&0x00ff0000) >> 8) | (((uint32)(A)&0x0000ff00) << 8) | (((uint32)(A)&0x000000ff) << 24))
141 
Definition: app_study_room.h:54
char string
Definition: app_study_room.h:115
uint8 lightNum
Definition: app_study_room.h:83
uint8 deviceType
Definition: app_study_room.h:61
Definition: app_study_room.h:35
uint8 messageId
Definition: app_study_room.h:70
Definition: app_study_room.h:42
uint8 temp
Definition: app_study_room.h:72
Definition: app_study_room.h:52
uint8 deviceNo
Definition: app_study_room.h:63
uint8 curtainNum
Definition: app_study_room.h:85
DecodeMessageId
编解码插件messageId枚举体
Definition: app_study_room.h:40
unsigned char int8u
Definition: app_study_room.h:108
uint8 noise
Definition: app_study_room.h:74
Definition: app_study_room.h:50
unsigned char int24u
Definition: app_study_room.h:112
uint8 acNum
Definition: app_study_room.h:87
short int Lux
Definition: app_study_room.h:120
Definition: app_study_room.h:36
unsigned char uint8
Definition: c_types.h:43
unsigned short int16u
Definition: app_study_room.h:110
uint8 crowdDensity
Definition: app_study_room.h:71
Definition: app_study_room.h:49
Definition: app_study_room.h:44
uint8 fanNum
Definition: app_study_room.h:81
char int24s
Definition: app_study_room.h:113
Device
用电器类型枚举体
Definition: app_study_room.h:31
Definition: app_study_room.h:47
char variant
Definition: app_study_room.h:118
void StudyRoom_UpdataData(uint8 *msg_string)
更新本地数据
Definition: app_study_room.c:139
Definition: app_study_room.h:33
short int16s
Definition: app_study_room.h:111
char array
Definition: app_study_room.h:116
Definition: app_study_room.h:43
Definition: app_study_room.h:53
uint8 roomNo
Definition: app_study_room.h:62
uint8 deviceSwitch
Definition: app_study_room.h:64
int int32s
Definition: app_study_room.h:114
uint8 humi
Definition: app_study_room.h:73
室内环境信息结构体
Definition: app_study_room.h:68
Definition: app_study_room.h:45
室内用电器状态信息结构体
Definition: app_study_room.h:78
char int8s
Definition: app_study_room.h:109
uint8 messageId
Definition: app_study_room.h:80
char varstring
Definition: app_study_room.h:117
uint8 * StudyRoom_GetStatusHex(uint8 room_no)
将一个房间所有用电器的状态转成 Hex 字符串
Definition: app_study_room.c:174
云端下发的用电器控制信息
Definition: app_study_room.h:59
Definition: app_study_room.h:55
Definition: app_study_room.h:34
Definition: app_study_room.h:48