ESP32 / ESP8266 & BME280 / SHT2x sensor with InfluxDB support
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

lora.h 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * lora.h
  3. *
  4. * ESP8266 / ESP32 Environmental Sensor
  5. *
  6. * ----------------------------------------------------------------------------
  7. * "THE BEER-WARE LICENSE" (Revision 42):
  8. * <xythobuz@xythobuz.de> wrote this file. As long as you retain this notice
  9. * you can do whatever you want with this stuff. If we meet some day, and you
  10. * think this stuff is worth it, you can buy me a beer in return. Thomas Buck
  11. * ----------------------------------------------------------------------------
  12. */
  13. #ifndef __ESP_ENV_LORA__
  14. #define __ESP_ENV_LORA__
  15. #ifdef FEATURE_LORA
  16. void lora_oled_init(void);
  17. void lora_oled_print(String s);
  18. void lora_init(void);
  19. void lora_run(void);
  20. enum lora_sml_type {
  21. LORA_SML_HELLO = 0,
  22. LORA_SML_SUM_WH,
  23. LORA_SML_T1_WH,
  24. LORA_SML_T2_WH,
  25. LORA_SML_SUM_W,
  26. LORA_SML_L1_W,
  27. LORA_SML_L2_W,
  28. LORA_SML_L3_W,
  29. LORA_SML_BAT_V,
  30. LORA_SML_NUM_MESSAGES
  31. };
  32. struct lora_sml_msg {
  33. uint8_t type; // enum lora_sml_type
  34. double value;
  35. uint32_t checksum;
  36. } __attribute__ ((packed));
  37. #ifdef FEATURE_SML
  38. void lora_sml_send(enum lora_sml_type msg, double value, unsigned long counter);
  39. #endif // FEATURE_SML
  40. double lora_get_mangled_bat(void);
  41. #endif // FEATURE_LORA
  42. #endif // __ESP_ENV_LORA__