-
Notifications
You must be signed in to change notification settings - Fork 0
/
loramac_utils.h
50 lines (36 loc) · 1.3 KB
/
loramac_utils.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
* Copyright (C) 2020 Université Grenoble Alpes
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup pkg_semtech_loramac
* @{
*
* @file
* @brief Utility functions for Semtech LoRaMac library.
*
* @author Didier Donsez <[email protected]>
*
* @}
*/
#ifndef LORAMAC_UTILS_H
#define LORAMAC_UTILS_H
#include <inttypes.h>
#ifdef __cplusplus
extern "C"
{
#endif
char *loramac_utils_err_message(uint8_t errCode);
uint8_t loramac_utils_join_retry_loop(semtech_loramac_t *loramac, uint8_t initDataRate, uint32_t nextRetryTime, uint32_t maxNextRetryTime);
uint8_t loramac_utils_abp_join_retry_loop(semtech_loramac_t *loramac, uint8_t initDataRate, uint32_t nextRetryTime, uint32_t maxNextRetryTime);
void loramac_utils_forge_euis_and_key(uint8_t *deveui, uint8_t *appeui, uint8_t *appkey, const uint8_t* secret);
/*
* Sleep a period according the current Data Rate
*/
void loramac_utils_sleep_adaptative_period_dr(semtech_loramac_t* loramac, uint32_t tx_period_at_dr0);
const char* loramac_utils_get_lorawan_network(const uint32_t devaddr);
void printf_ba(const uint8_t* ba, size_t len);
#endif