9 #ifndef __SERVICE_LORA_H__ 10 #define __SERVICE_LORA_H__ 21 #include "pin_define.h" 23 #include "LoRaMacTypes.h" 24 #include "LmHandlerTypes.h" 25 #include "secure-element.h" 27 #define SERVICE_LORA_DLINK_BUFF_SIZE 256 29 #define LORAWAN_VERSION "LoRaWAN 1.0.3" 31 #define SERVICE_LORA_CHANNEL_ALL 0U 32 #define SERVICE_LORA_CHANNEL_0_63 0x00ff 33 #define SERVICE_LORA_CHANNEL_0_7 (1 << 0) 34 #define SERVICE_LORA_CHANNEL_8_15 (1 << 1) 35 #define SERVICE_LORA_CHANNEL_16_23 (1 << 2) 36 #define SERVICE_LORA_CHANNEL_24_31 (1 << 3) 37 #define SERVICE_LORA_CHANNEL_32_39 (1 << 4) 38 #define SERVICE_LORA_CHANNEL_40_47 (1 << 5) 39 #define SERVICE_LORA_CHANNEL_48_55 (1 << 6) 40 #define SERVICE_LORA_CHANNEL_56_63 (1 << 7) 41 #define SERVICE_LORA_CHANNEL_80_87 (1 << 10) 42 #define SERVICE_LORA_CHANNEL_88_95 (1 << 11) 274 SERVICE_LORA_US915_HYBRID = LORAMAC_REGION_US915_HYBRID,
299 #if defined(REGION_CN470) || defined(REGION_US915) || \ 300 defined(REGION_AU915) 301 int32_t service_lora_get_mask(uint16_t *mask);
303 int32_t service_lora_set_mask(uint16_t *mask,
bool commit);
348 int32_t
service_lora_join(int32_t param1, int32_t param2, int32_t param3, int32_t param4);
497 #endif // end SUPPORT_LORA 499 #endif // __SERVICE_LORA_H__ SERVICE_LORA_CLASS service_lora_get_real_class_from_stack(void)
Definition: service_lora.h:282
Definition: service_lora.h:56
Definition: service_lora.h:106
int32_t service_lora_set_timereq(uint8_t mode)
void(* service_lora_join_cb)(int32_t status)
Definition: service_lora.h:101
Definition: service_lora.h:184
Definition: service_lora.h:46
uint8_t * Buffer
Definition: service_lora.h:79
SERVICE_LORA_CONFIRM_MODE service_lora_get_cfm(void)
uint32_t service_lora_get_auto_join_max_cnt(void)
Definition: service_lora.h:118
Definition: service_lora.h:53
Definition: service_lora.h:192
Definition: service_lora.h:176
_SERVICE_LORA_DATA_RATE
Definition: service_lora.h:167
void(* service_lora_recv_cb)(SERVICE_LORA_RECEIVE_T *data)
Definition: service_lora.h:100
int32_t service_lora_set_dev_eui(uint8_t *buff, uint32_t len)
uint32_t service_lora_set_rx2dr(SERVICE_LORA_DATA_RATE datarate, bool commit)
int32_t service_lora_query_txPossible(int16_t len)
int32_t service_lora_get_app_key(uint8_t *buff, uint32_t len)
void service_lora_resume(void)
void service_lora_lptp_send_callback(int status)
Definition: service_lora.h:57
Definition: service_lora.h:173
int32_t service_lora_set_lbt_rssi(int16_t rssi)
void(* service_lora_send_cb)(int32_t status)
Definition: service_lora.h:102
int32_t service_lora_set_linkcheck(uint8_t mode)
Definition: service_lora.h:107
uint32_t service_lora_get_lorawan_version(char **version)
_TIMEREQ_STATE
Definition: service_lora.h:60
Definition: service_lora.h:113
Definition: service_lora.h:196
Definition: service_lora.h:157
Definition: service_lora.h:169
Definition: service_lora.h:122
Definition: service_lora.h:178
Definition: service_lora.h:119
Definition: service_lora.h:55
int32_t service_lora_set_rx2dl(uint32_t rx2dl, bool commit)
Definition: service_lora.h:252
_SERVICE_LORA_BAND
Definition: service_lora.h:227
int32_t service_lora_get_chs(void)
int32_t service_lora_set_ping_slot_periodicity(uint8_t periodicity)
Definition: service_lora.h:232
int32_t service_lora_join(int32_t param1, int32_t param2, int32_t param3, int32_t param4)
bool service_lora_get_join_start(void)
enum _SERVICE_LORA_BAND SERVICE_LORA_BAND
Definition: service_lora.h:66
Definition: service_lora.h:121
Definition: service_lora.h:248
Definition: service_lora.h:269
uint16_t GPS_coordinate
Definition: service_lora.h:127
int32_t service_lora_set_auto_join_period(uint32_t auto_join_period)
Definition: service_lora.h:174
uint32_t service_lora_get_beacon_freq(void)
Definition: service_lora.h:158
_SERVICE_LORA_WORK_MODE
Definition: service_lora.h:141
uint32_t service_lora_get_rx2freq(void)
void service_lora_suspend(void)
int32_t service_lora_set_dcs(uint8_t dutycycle, bool commit)
Definition: service_lora.h:175
uint32_t longitude
Definition: service_lora.h:129
uint8_t flag
Definition: service_lora.h:138
int32_t service_lora_send(uint8_t *buff, uint32_t len, SERVICE_LORA_SEND_INFO info, bool blocking)
int32_t service_lora_get_net_id(uint8_t *buff, uint32_t len)
Definition: service_lora.h:54
int32_t service_lora_get_che(void)
bool service_lora_get_cfs(void)
int32_t service_lora_set_rx1dl(uint32_t rx1dl, bool commit)
bool service_lora_get_njs(void)
SERVICE_LORA_BAND service_lora_get_band(void)
Definition: service_lora.h:200
LmHandlerErrorStatus_t LmHandlerPackageRegister(uint8_t id, void *params)
int32_t service_lora_register_join_cb(service_lora_join_cb callback)
Definition: service_lora.h:219
uint32_t service_lora_get_lbt_scantime()
enum _SERVICE_LORA_CLASS_B_STATE SERVICE_LORA_CLASS_B_STATE
uint8_t service_lora_get_timereq(void)
Definition: service_lora.h:152
Definition: service_lora.h:284
Definition: service_lora.h:134
Definition: service_lora.h:181
uint8_t service_lora_get_txpower(void)
Definition: service_lora.h:213
uint8_t RxDatarate
Definition: service_lora.h:75
Definition: service_lora.h:183
uint32_t net_ID
Definition: service_lora.h:130
enum _SERVICE_LORA_WORK_MODE SERVICE_LORA_WORK_MODE
int32_t service_lora_set_auto_join_max_cnt(uint32_t auto_join_period)
Definition: service_lora.h:180
Definition: service_lora.h:236
void LmHandlerPackagesProcess(void)
uint8_t service_lora_get_linkcheck(void)
Definition: service_lora.h:125
Definition: service_lora.h:179
uint32_t service_lora_get_rx2dl(void)
_SERVICE_LORA_CLASS
Definition: service_lora.h:209
enum _LINK_CHECK_MODE LINK_CHECK_MODE
int32_t service_lora_set_app_eui(uint8_t *buff, uint32_t len)
int32_t service_lora_set_nwm(SERVICE_LORA_WORK_MODE nwm)
int32_t service_lora_get_lbt()
Definition: service_lora.h:109
SERVICE_LORA_CLASS_B_STATE service_lora_get_class_b_state(void)
int32_t service_lora_register_send_cb(service_lora_send_cb callback)
int32_t service_lora_set_class(SERVICE_LORA_CLASS device_class, bool commit)
Definition: service_lora.h:212
uint32_t service_lora_set_rx2freq(uint32_t freq, bool commit)
int8_t Snr
Definition: service_lora.h:92
_SERVICE_LORA_MAC_CMD
Definition: service_lora.h:44
Definition: service_lora.h:115
bool service_lora_get_dcs(void)
uint8_t retry
Definition: service_lora.h:204
int32_t service_lora_get_dev_eui(uint8_t *buff, uint32_t len)
uint8_t service_lora_get_retry(void)
Definition: service_lora.h:220
int32_t service_lora_set_lora_default(void)
Definition: service_lora.h:120
Definition: service_lora.h:110
enum _SERVICE_LORA_MAC_CMD SERVICE_LORA_MAC_CMD
int32_t service_lora_set_join_start(bool join_start)
enum _SERVICE_LORA_DATA_RATE SERVICE_LORA_DATA_RATE
Definition: service_lora.h:190
int32_t service_lora_set_nwk_skey(uint8_t *buff, uint32_t len)
int32_t service_lora_init(SERVICE_LORA_BAND band)
Definition: service_lora.h:182
Definition: service_lora.h:164
int32_t service_lora_set_lbt_scantime(uint32_t time)
int16_t Rssi
Definition: service_lora.h:88
int32_t service_lora_set_chs(uint32_t frequency)
Definition: service_lora.h:240
Definition: service_lora.h:194
int32_t service_lora_lptp_send(uint8_t port, bool ack, uint8_t *p_data, uint16_t len)
Definition: service_lora.h:244
Definition: service_lora.h:63
int32_t service_lora_set_lbt(uint8_t enable)
bool retry_valid
Definition: service_lora.h:203
int32_t service_lora_get_local_time(char *local_time)
enum _AS923_SUB_BAND AS923_SUB_BAND
Definition: service_lora.h:256
_SERVICE_LORA_CLASS_B_STATE
Definition: service_lora.h:51
SERVICE_LORA_DATA_RATE service_lora_get_dr(void)
Definition: service_lora.h:116
enum _SERVICE_LORA_CONFIRM_MODE SERVICE_LORA_CONFIRM_MODE
uint8_t service_lora_get_ping_slot_periodicity(void)
uint8_t Port
Definition: service_lora.h:71
uint32_t service_lora_get_beacon_dr(void)
uint16_t len
Definition: service_lora.h:137
Definition: service_lora.h:221
struct sbeacon_bgw beacon_bgw_t
uint32_t DownLinkCounter
Definition: service_lora.h:97
int32_t service_lora_get_last_recv(uint8_t *port, uint8_t *buff, uint32_t len)
int32_t service_lora_set_app_skey(uint8_t *buff, uint32_t len)
SERVICE_LORA_JOIN_MODE service_lora_get_njm(void)
Definition: service_lora.h:114
Definition: service_lora.h:108
uint32_t service_lora_get_jn2dl(void)
int8_t service_lora_get_snr(void)
Definition: service_lora.h:280
uint32_t service_lora_get_beacon_time(void)
Definition: service_lora.h:62
bool LmHandlerPackageIsInitialized(uint8_t id)
Definition: service_lora.h:150
int32_t service_lora_set_dr(SERVICE_LORA_DATA_RATE dr, bool commit)
bool LmHandlerPackageIsRunning(uint8_t id)
int32_t service_lora_set_retry(uint8_t retry)
Definition: service_lora.h:47
Definition: service_lora.h:195
bool confirm_valid
Definition: service_lora.h:205
_SERVICE_LORA_TX_POWER
Definition: service_lora.h:104
int32_t service_lora_set_njm(SERVICE_LORA_JOIN_MODE njm, bool commit)
beacon_bgw_t service_lora_get_beacon_gwspecific(void)
int32_t service_lora_set_cfm(SERVICE_LORA_CONFIRM_MODE cfm)
int32_t service_lora_get_dev_addr(uint8_t *buff, uint32_t len)
uint8_t BufferSize
Definition: service_lora.h:83
Definition: service_lora.h:145
int32_t service_lora_get_McRoot_key(uint8_t *buff)
uint32_t latitude
Definition: service_lora.h:128
struct _SERVICE_LORA_SEND_INFO SERVICE_LORA_SEND_INFO
struct sdelay_send delay_send_t
SERVICE_LORA_WORK_MODE service_lora_get_nwm(void)
int32_t service_lora_set_jn2dl(uint32_t jn2dl, bool commit)
Definition: service_lora.h:191
int32_t service_lora_register_recv_cb(service_lora_recv_cb callback)
uint32_t service_lora_get_jn1dl(void)
Definition: service_lora.h:151
enum _SERVICE_LORA_TX_POWER SERVICE_LORA_TX_POWER
int32_t service_lora_set_pub_nwk_mode(bool pnm, bool commit)
Definition: service_lora.h:171
Definition: service_lora.h:189
void service_lora_systemMaxRxError(void)
Definition: service_lora.h:111
Definition: service_lora.h:260
bool service_lora_get_auto_join(void)
Definition: service_lora.h:193
bool service_lora_get_adr(void)
Definition: service_lora.h:177
int16_t service_lora_get_rssi(void)
Definition: service_lora.h:172
_LINK_CHECK_MODE
Definition: service_lora.h:148
Definition: service_lora.h:48
int16_t service_lora_get_lbt_rssi()
int32_t service_lora_set_txpower(uint8_t txp, bool commit)
Definition: service_lora.h:211
Definition: service_lora.h:170
int32_t service_lora_get_app_eui(uint8_t *buff, uint32_t len)
Definition: service_lora.h:144
int32_t service_lora_set_band(SERVICE_LORA_BAND band)
enum _SERVICE_LORA_CLASS SERVICE_LORA_CLASS
int32_t service_lora_set_auto_join(bool auto_join)
enum _SERVICE_LORA_CH_EIGHT_MODE SERVICE_LORA_CH_EIGHT_MODE
bool service_lora_get_pub_nwk_mode(void)
enum _SERVICE_LORA_JOIN_MODE SERVICE_LORA_JOIN_MODE
int32_t service_lora_get_app_skey(uint8_t *buff, uint32_t len)
int32_t service_lora_set_jn1dl(uint32_t jn1dl, bool commit)
Definition: service_lora.h:112
int32_t service_lora_set_che(uint8_t sub_band)
Definition: service_lora.h:163
SERVICE_LORA_CONFIRM_MODE confirm
Definition: service_lora.h:206
enum _TIMEREQ_STATE TIMEREQ_STATE
struct SERVICE_LORA_RECEIVE SERVICE_LORA_RECEIVE_T
uint32_t gateway_ID
Definition: service_lora.h:131
Definition: service_lora.h:117
Definition: service_lora.h:143
_SERVICE_LORA_CONFIRM_MODE
Definition: service_lora.h:155
uint32_t service_lora_get_rx1dl(void)
uint8_t port
Definition: service_lora.h:202
int32_t service_lora_set_dev_addr(uint8_t *buff, uint32_t len)
SERVICE_LORA_CLASS service_lora_get_class(void)
int32_t service_lora_get_nwk_skey(uint8_t *buff, uint32_t len)
int32_t service_lora_set_nwk_id(uint8_t *buff, uint32_t len)
int32_t service_lora_set_adr(bool adr, bool commit)
_AS923_SUB_BAND
Definition: service_lora.h:216
_SERVICE_LORA_JOIN_MODE
Definition: service_lora.h:161
SERVICE_LORA_DATA_RATE service_lora_get_rx2dr(void)
_SERVICE_LORA_CH_EIGHT_MODE
Definition: service_lora.h:187
Definition: service_lora.h:197
int32_t service_lora_set_app_key(uint8_t *buff, uint32_t len)
Definition: service_lora.h:218
uint32_t service_lora_get_auto_join_period(void)
Definition: service_lora.h:264