#ifndef THREAD_LORA_H
#define THREAD_LORA_H
#include <stdlib.h>
#include "message_list.h"
#include "os_port.h"
/***************HEADER FILES****************/
#include <string.h>
#include <syslog.h>
#include "ipc_session.h"
#include "lnxall_list.h"
#include "dy_utils/dy_common.h"
#include "dy_utils/dy_ds.h"
#include "dy_utils/kv_array.h"
#include "dy_utils/dy_ipc.h"
#include "dy_utils/led.h"
/******************************************/

#define LoRa_CRC_INIT 0x90

typedef struct
{
    lora_addr_t addr;
    uint8_t code;
    uint8_t size;
    uint8_t *data;
    uint8_t crc8_transf;
    uint8_t crc8_cal;
}PackType;

typedef struct {
    int frq_band;					//Lora总线的模式，0：debug，1：test，2：release，默认使2
    int frq_code;                   //0~15,
    int gw_lora_addr;               //gateway lora addr x.1
}lora_cfg_t;

#define PACKED __attribute__((packed))

int thread_lora_start(void *opt);
void thread_lora_stop(void);
void service_lora_enable(bool enable);
#endif // THREAD_LORA_H
