#include #include "wisblock_cayenne.h" // Debug // Debug output set to 0 to disable app debug output #ifndef MY_DEBUG #define MY_DEBUG 1 #endif #if MY_DEBUG > 0 #define MYLOG(tag, ...) \ do \ { \ if (tag) \ Serial.printf("[%s] ", tag); \ Serial.printf(__VA_ARGS__); \ Serial.printf("\n"); \ } while (0); \ delay(100) #else #define MYLOG(...) #endif // Globals //extern char g_dev_name[]; //extern bool g_has_rak15001; //extern volatile bool sensor_heatup_finished; /** Custom flash parameters structure */ struct custom_param_s { uint8_t valid_flag = 0xAA; uint32_t send_interval = 0; }; /** Custom flash parameters */ extern custom_param_s custom_parameters; // Forward declarations void send_packet(void); bool init_status_at(void); bool init_interval_at(void); bool get_at_setting(void); bool save_at_setting(void); //void sensor_handler(void *); //void start_sensors(void *); //void read_send_sensors(void); //extern bool has_rak1901; //extern bool has_rak1906; extern bool has_rak12037; extern volatile bool sensor_reading_active; extern float g_last_temp; extern float g_last_humid; extern bool g_has_last_values; extern uint8_t t_h_discard_counter; // LoRaWAN stuff #include "wisblock_cayenne.h" // Cayenne LPP Channel numbers per sensor value #define LPP_CHANNEL_BATT 1 // Base Board #define LPP_CHANNEL_HUMID 2 // RAK1901 #define LPP_CHANNEL_TEMP 3 // RAK1901 #define LPP_CHANNEL_PRESS 4 // RAK1902 #define LPP_CHANNEL_LIGHT 5 // RAK1903 #define LPP_CHANNEL_CO2_2 35 // RAK12037 #define LPP_CHANNEL_CO2_Temp_2 36 // RAK12037 #define LPP_CHANNEL_CO2_HUMID_2 37 // RAK12037 extern WisCayenne g_solution_data; // Sensor functions //bool init_rak1901(void); //void read_rak1901(void); //void startup_rak1901(void); //void shutdown_rak1901(void); bool init_rak12037(void); void read_rak12037(void); void start_rak12037(void); void get_rak12037_values(float *values);