ESP32 / ESP8266 & BME280 / SHT2x sensor with InfluxDB support
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

lora.h 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. #ifdef LORA_CLIENT_CHECKSUM
  36. uint32_t checksum;
  37. #endif
  38. } __attribute__ ((packed));
  39. #ifdef FEATURE_SML
  40. void lora_sml_send(enum lora_sml_type msg, double value, unsigned long counter);
  41. void lora_sml_done(void);
  42. #endif // FEATURE_SML
  43. double lora_get_mangled_bat(void);
  44. #endif // FEATURE_LORA
  45. #endif // __ESP_ENV_LORA__