1 /* 2 * Copyright (c) 2024 A Labs GmbH 3 * Copyright (c) 2024 tado GmbH 4 * 5 * SPDX-License-Identifier: Apache-2.0 6 */ 7 8 #ifndef TEST_SUBSYS_LORAWAN_FRAG_DECODER_SRC_FRAG_ENCODER_H_ 9 #define TEST_SUBSYS_LORAWAN_FRAG_DECODER_SRC_FRAG_ENCODER_H_ 10 11 #include <stdint.h> 12 #include <string.h> 13 14 /** 15 * Generate coded binary data according to LoRaWAN TS004-1.0.0 16 * 17 * @param uncoded Pointer to uncoded data buffer (e.g. firmware binary) 18 * @param uncoded_len Length of uncoded data in bytes 19 * @param coded Pointer to buffer for resulting coded data 20 * @param coded_size Size of the buffer for coded data 21 * @param frag_size Fragment size to be used 22 * @param redundant_frags Absolute number of redundant fragments to be generated 23 * 24 * @returns 0 for success or negative error code otherwise. 25 */ 26 int lorawan_frag_encoder(const uint8_t *uncoded, size_t uncoded_len, uint8_t *coded, 27 size_t coded_size, size_t frag_size, unsigned int redundant_frags); 28 29 #endif /* TEST_SUBSYS_LORAWAN_FRAG_DECODER_SRC_FRAG_ENCODER_H_ */ 30