Skip to content

Commit fb00b38

Browse files
committed
zephyr: configure FragDecoder using Kconfig
Change the #defines to use values from Zephyr's Kconfig. Signed-off-by: Martin Jäger <martin@libre.solar>
1 parent 1bf2120 commit fb00b38

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/apps/LoRaMac/common/LmHandler/packages/FragDecoder.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,35 @@ extern "C" {
4040
*
4141
* \remark This parameter has an impact on the memory footprint.
4242
*/
43+
#ifdef __ZEPHYR__
44+
#define FRAG_MAX_NB \
45+
(CONFIG_LORAWAN_FRAG_TRANSPORT_IMAGE_SIZE / CONFIG_LORAWAN_FRAG_TRANSPORT_MIN_FRAG_SIZE + 1)
46+
#else
4347
#define FRAG_MAX_NB 21
48+
#endif
4449

4550
/*!
4651
* Maximum fragment size that can be handled.
4752
*
4853
* \remark This parameter has an impact on the memory footprint.
4954
*/
55+
#ifdef __ZEPHYR__
56+
#define FRAG_MAX_SIZE CONFIG_LORAWAN_FRAG_TRANSPORT_MAX_FRAG_SIZE
57+
#else
5058
#define FRAG_MAX_SIZE 50
59+
#endif
5160

5261
/*!
5362
* Maximum number of extra frames that can be handled.
5463
*
5564
* \remark This parameter has an impact on the memory footprint.
5665
*/
66+
#ifdef __ZEPHYR__
67+
#define FRAG_MAX_REDUNDANCY \
68+
(FRAG_MAX_NB * CONFIG_LORAWAN_FRAG_TRANSPORT_MAX_REDUNDANCY / 100)
69+
#else
5770
#define FRAG_MAX_REDUNDANCY 5
71+
#endif
5872

5973
#define FRAG_SESSION_FINISHED ( int32_t )0
6074
#define FRAG_SESSION_NOT_STARTED ( int32_t )-2

0 commit comments

Comments
 (0)