AWS IoT Firmware
Firmware code for AWS IoT Devices
device_config.hpp
1 
14 #ifndef _HANDLER_CONFIG_HPP
15 #define _HANDLER_CONFIG_HPP
16 
17 #include "parent_handler.hpp"
18 #include "power_ctrl_handler.hpp"
19 #include "temp_sensor_handler.hpp"
20 
21 /****************MQTT Config****************************/
25 #define SUBSCRIBE_TOPIC "/pcReq"
26 
29 #define PUBLISH_TOPIC "/pcRes"
30 
31 /****************Pinout Config**************************/
32 
36 #define PC_CTRL_PIN 5 // D1
37 
41 #define PC_BUTTON_PIN 4 // D2
42 
46 #define ANALOG_PIN 0
47 
48 /****************Device Handler Config*****************/
49 
54 #define TOTAL_HANDLER 2
55 
61 #define REGISTER_INTERRUPT() \
62  do { \
63  mgos_gpio_set_button_handler(PC_BUTTON_PIN, \
64  MGOS_GPIO_PULL_UP, \
65  MGOS_GPIO_INT_EDGE_NEG, \
66  BUTTON_DEBOUNCE_MS, \
67  PowerCtrlHandler::buttonInterruptHandler, \
68  NULL); \
69  } while (0)
70 
75 #define INITIALIZE_HANDLER() \
76  static PowerCtrlHandler pwrController; \
77  static TempSensorHandler tempHandler; \
78  static ParentHandler* _handlerList[TOTAL_HANDLER] = {&pwrController, &tempHandler};
79 
80 #endif
81 
header file for TempSensorHandler class of the pc controller device
contain class declaration for the ParentHandler class