#ifndef LORA_UTL_H #define LORA_UTL_H #include /* * TX_INTERVAL * * Description: * Macro defining the time interval in milliseconds between successive * transmissions of data packets over the LoRa network. * * Example: * #define TX_INTERVAL (300000) // Transmit every 300 seconds (5 minutes) * * Notes: * - Consider factors such as battery life, network traffic, * and application requirements when choosing the TX_INTERVAL. * - Frequent transmissions may consume more power and increase * the risk of network congestion. */ #define TX_INTERVAL (10000) /* * Frequency Band */ #define LORA_BAND (LORA_REGION_IN865) /* * Spreading Factor 6, 7, 8, 9, 10, 11, 12 */ #define LORA_SF 7 /* * P2P bandwidth in kHz (0 = 125, 1 = 250, 2 = 500, 3 = 7.8, 4 = 10.4, 5 = 15.63, 6 = 20.83, 7 = 31.25, 8 = 41.67, 9 = 62.5). */ #define LORA_BANDWIDTH 0 /* * P2P Code Rate (0=4/5, 1=4/6, 2=4/7, 3=4/8) */ #define LORA_CODING_RATE 0 /* * Preamble Length 2-65535 */ #define LORA_PREAMBLE_LENGTH 10 /* * LoRa TX Power 5 - 22 */ #define LORA_TX_POWER 20 //#define ENABLE_ENCRYPTION /* * Defining frequency bands for LoRa * IN865 is 865000000 as in 865000000 Hz */ #define LORA_REGION_IN865 865000000 #define LORA_REGION_EU868 868000000 void send_cb(void); void encode_payload(float temperature, float humidity, uint8_t *payload); void init_lora(); #endif