iOS AILinkBleSDK - 蓝牙SDK
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

ELHygrothermographBleHeader.h 7.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. //
  2. // ELHygrothermographBleHeader.h
  3. // AILinkBleSDK
  4. //
  5. // Created by cliCk on 2021/5/8.
  6. // Copyright © 2021 IOT. All rights reserved.
  7. //
  8. #ifndef ELHygrothermographBleHeader_h
  9. #define ELHygrothermographBleHeader_h
  10. /** 温湿度计 ble head type 枚举定义 */
  11. typedef NS_ENUM (NSInteger, TH_BleHeadType) {
  12. /** App获取设备状态 */
  13. TH_BleHeadType_App_GetDevState = 0x01 ,
  14. /** 设备定时返回设备状态 */
  15. TH_BleHeadType_MCU_ReturnDevState = 0x02 ,
  16. /** App设备变化阀值 */
  17. TH_BleHeadType_App_SetDevThreshold = 0x03 ,
  18. /** 设备定时返回阀值 */
  19. TH_BleHeadType_MCU_ReturnDevThreshold = 0x04 ,
  20. /** App读取设备的历史数据 */
  21. TH_BleHeadType_App_GetDevRecordData = 0x05 ,
  22. /** 设备返回历史数据 */
  23. TH_BleHeadType_MCU_ReturnRecordData = 0x06 ,
  24. /** 设置采样频率和保存频率 */
  25. TH_BleHeadType_APP_SetSamplingFrequency = 0x07 ,
  26. /** 设备返回采样频率和保存频率 */
  27. TH_BleHeadType_MCU_ReturnSamplingFrequency = 0x08 ,
  28. /** App返回收到历史数据反馈 */
  29. TH_BleHeadType_App_DataFeedback = 0x09 ,
  30. /** APP设置、读取温湿度校准 */
  31. TH_BleHeadType_App_SetOrGetCalibrationNum = 0x0A ,
  32. /** MCU返回温湿度校准值 */
  33. TH_BleHeadType_MCU_ReturnCalibrationNum = 0x0B ,
  34. /** APP获取设备信息 */
  35. // TH_BleHeadType_App_GetDevInfo = 0x10 ,
  36. /** 设备返回设备信息 */
  37. TH_BleHeadType_MCU_ReturnDevInfo = 0x11 ,
  38. /** APP获取设备报警功能 设备回复报警功能信息 */
  39. TH_BleHeadType_AlarmDataInfo = 0x12 ,
  40. /** APP设置设备报警功能 */
  41. TH_BleHeadType_App_SetAlarmDataInfo = 0x13 ,
  42. /** APP设置设备wifi/4G例行上报时间 */
  43. TH_BleHeadType_App_Set_Wifi_4G_UploadTime = 0x14 ,
  44. /** 设备返回设备wifi/4G例行上报时间 */
  45. TH_BleHeadType_MCU_Return_Wifi_4G_UploadTime = 0x15 ,
  46. /** APP获取wifi网络状态 */
  47. TH_BleHeadType_App_GetWiFiStatus = 0x16 ,
  48. /** 设备返回wifi网络状态 */
  49. TH_BleHeadType_MCU_ReturnWiFiStatus = 0x17 ,
  50. /// APP设置/读取设备蜂鸣器功能
  51. TH_BleHeadType_App_SetOrGetBuzzerState = 0x20 ,
  52. /// 设备返回蜂鸣器状态
  53. TH_BleHeadType_MCU_ReturnBuzzerState = 0x021 ,
  54. /// APP设置/读取设备闹钟功能
  55. TH_BleHeadType_App_SetOrGetAlarmClock = 0x22 ,
  56. /// 设备返回闹钟
  57. TH_BleHeadType_MCU_ReturnAlarmClock = 0x23 ,
  58. /// APP设置/读取设备整点报时功能
  59. TH_BleHeadType_App_SetOrUpdateReportPunctually = 0X24 ,
  60. /// 设备返回整点报时功能
  61. TH_BleHeadType_MCU_ReturnReportPunctually = 0x25 ,
  62. /// 7.4.10 APP设置/读取设备小夜灯
  63. TH_BleHeadType_App_SetOrGetNightLightState = 0x26 ,
  64. /// 设备返回小夜灯状态
  65. TH_BleHeadType_MCU_ReturnNightLightState = 0x27 ,
  66. /// 7.4.11 APP设置/读取背光亮度
  67. TH_BleHeadType_App_SetOrGetGroundLightState = 0x28 ,
  68. /// 设备返回背光状态
  69. TH_BleHeadType_MCU_ReturnGroundLightState = 0x29 ,
  70. /// 7.4.12 APP设置/读取单位
  71. TH_BleHeadType_App_SetOrGetUnit = 0x2A ,
  72. /// 设备返回单位
  73. TH_BleHeadType_MCU_ReturnUnit = 0x2B ,
  74. /// 7.4.13 APP寻物功能
  75. TH_BleHeadType_App_Lost = 0x2C ,
  76. /// 返回寻物功能状态
  77. TH_BleHeadType_MCU_ReturnLost = 0x2D ,
  78. /// 7.4.14 App绑定设备
  79. TH_BleHeadType_Binding_Status = 0x2E ,
  80. /// BM设备定时返回设备状态
  81. TH_BleHeadType_BM_MCU_ReturnDevState = 0x31 ,
  82. /// BM设备返回历史记录
  83. TH_BleHeadType_BM_MCU_ReturnRecordData = 0x32 ,
  84. /// 清除BM里面的历史记录
  85. TH_BleHeadType_App_ClearRecordData = 0x40 ,
  86. /// 返回清除记录结果
  87. TH_BleHeadType_MCU_ClearRecordDataState = 0x41 ,
  88. /// 查询BM是否支持历史记录
  89. TH_BleHeadType_App_GetSupportRecordData = 0x42,
  90. /// BM回应是否支持历史记录
  91. TH_BleHeadType_App_ReturnSupportRecordData = 0x43,
  92. /// app获取设备支持功能
  93. TH_BleHeadType_App_GetSupportFeatures = 0x80 ,
  94. /// 设备返回支持功能
  95. TH_BleHeadType_MCU_ReturnSupportFeatures = 0x81 ,
  96. };
  97. /** 温湿度计设备类型定义 */
  98. typedef NS_ENUM (NSInteger, Hygrothermograph_DevType) {
  99. Hygrothermograph_DevType_Ble = 0x00 ,
  100. Hygrothermograph_DevType_Ble_WiFi = 0x01 ,
  101. Hygrothermograph_DevType_Ble_4G = 0x02 ,
  102. };
  103. /** 温湿度计Wi-Fi连接状态枚举定义 */
  104. typedef NS_ENUM(NSInteger, Hygrothermograph_ConnectStateType) {
  105. /** 未配置AP */
  106. Hygrothermograph_ConnectStateType_UnSetup = 0x00 ,
  107. /** 连接AP失败,连接时密码错误、AP信号不好、主动断开都会是这个状态 */
  108. Hygrothermograph_ConnectStateType_ConnectFailed = 0x01 ,
  109. /** 连接的AP信号不好 */
  110. Hygrothermograph_ConnectStateType_BadSignal = 0x02 ,
  111. /** 成功连接上AP */
  112. Hygrothermograph_ConnectStateType_Connecd = 0x03 ,
  113. /** 正在连接AP */
  114. Hygrothermograph_ConnectStateType_Connecting = 0x04 ,
  115. };
  116. /** 温湿度计工作状态枚举定义 */
  117. typedef NS_ENUM(NSInteger, Hygrothermograph_WorkStateType) {
  118. /** 唤醒 */
  119. Hygrothermograph_WorkStateType_Wake = 0x00 ,
  120. /** 进入休眠 */
  121. Hygrothermograph_WorkStateType_Sleep = 0x01 ,
  122. /** 模块准备就绪 */
  123. Hygrothermograph_WorkStateType_Ready = 0x02 ,
  124. };
  125. /** 温湿度计配网失败原因枚举定义 */
  126. typedef NS_ENUM(NSInteger, Hygrothermograph_FailedType) {
  127. /** 未知原因 */
  128. Hygrothermograph_FailedType_Unknow = 0x00 ,
  129. /** AP信号差 */
  130. Hygrothermograph_FailedType_APSignalPoor = 0x01 ,
  131. /** 密码错误 */
  132. Hygrothermograph_FailedType_PasswordWrong = 0x02 ,
  133. /** 获取不到IP */
  134. Hygrothermograph_FailedType_CantGetIP = 0x03 ,
  135. };
  136. /// 设备状态枚举定义
  137. typedef NS_ENUM(NSInteger, TH_DevStateType) {
  138. /// APP读取时上报(若BM模块有历史功能,收到该指令不保存历史)
  139. TH_DevStateType_ReadReport = 0x00 ,
  140. /// 普通上报(前后两次差值超过设定值(灵敏度),MCU主动上报)(若BM模块有历史功能,收到该指令保存历史)
  141. TH_DevStateType_NormalReport = 0x01 ,
  142. /// 报警上报(当前值超出报警范围值,MCU主动上报)(若BM模块有历史功能,收到该指令保存历史)
  143. TH_DevStateType_AlarmReport = 0x02 ,
  144. };
  145. /// 闹钟状态枚举定义
  146. typedef NS_ENUM(NSInteger, TH_AlarmClockState) {
  147. /// 增加闹钟
  148. TH_AlarmClockState_Add = 0x00 ,
  149. /// 删除闹钟(不需要处理时间值)
  150. TH_AlarmClockState_Del = 0x01 ,
  151. /// 停止该闹钟(停止对应的编号闹钟,不需要处理时间值)
  152. TH_AlarmClockState_Stop = 0x02 ,
  153. /// 获取设备已存在的闹钟(编号模式时间都设为0)
  154. TH_AlarmClockState_Get = 0x03 ,
  155. };
  156. /// 闹钟模式
  157. typedef NS_ENUM(NSInteger, TH_AlarmClockMode) {
  158. /// 只触发一次
  159. TH_AlarmClockMode_Once = 0x00 ,
  160. /// 每天都触发
  161. TH_AlarmClockMode_Everyday = 0x01 ,
  162. };
  163. /// 温湿度计支持的设备功能
  164. typedef NS_ENUM(NSInteger, TH_Dev_SupportFeatures) {
  165. /// 温湿度校准
  166. TH_Dev_SupportFeatures_Calibration = 0 ,
  167. /// 蜂鸣器报警
  168. TH_Dev_SupportFeatures_BuzzerAlarm = 1 ,
  169. /// 闹钟功能
  170. TH_Dev_SupportFeatures_AlarmClock = 2 ,
  171. /// 整点报时
  172. TH_Dev_SupportFeatures_ReportPunctually = 3 ,
  173. /// 小夜灯
  174. TH_Dev_SupportFeatures_NightLight = 4 ,
  175. /// 背光亮度
  176. TH_Dev_SupportFeatures_GroundLight = 5 ,
  177. /// 寻物功能(APP点击寻物时,设备蜂鸣器会响)
  178. TH_Dev_SupportFeatures_Lost = 6 ,
  179. /// 接收 APP 下发指令
  180. TH_Dev_SupportFeatures_ReceiveCommand = 7 ,
  181. /// 温度单位切换
  182. TH_Dev_SupportFeatures_TemperatureUnitSwitch = 8 ,
  183. /// 温度报警
  184. TH_Dev_SupportFeatures_TemperatureAlarm = 9 ,
  185. /// 湿度报警
  186. TH_Dev_SupportFeatures_HumidityAlarm = 10 ,
  187. };
  188. #endif /* ELHygrothermographBleHeader_h */