Lines Matching +full:0 +full:x00 +full:- +full:positive
2 * Copyright (c) 2022-2024 Libre Solar Technologies GmbH
3 * Copyright (c) 2022-2024 tado GmbH
6 * LoRaMac-node firmware repository https://github.com/Lora-net/LoRaMac-node
9 * SPDX-License-Identifier: Apache-2.0
32 * This implementation only supports TS004-1.0.0.
48 FRAG_TRANSPORT_CMD_PKG_VERSION = 0x00,
49 FRAG_TRANSPORT_CMD_FRAG_STATUS = 0x01,
50 FRAG_TRANSPORT_CMD_FRAG_SESSION_SETUP = 0x02,
51 FRAG_TRANSPORT_CMD_FRAG_SESSION_DELETE = 0x03,
52 FRAG_TRANSPORT_CMD_DATA_FRAGMENT = 0x08,
67 /** Number of fragments of the data block for this session, max. 2^14-1 */
76 /** Random delay for some responses between 0 and 2^(BlockAckDelay + 4) */
78 /** Used fragmentation algorithm (0 for forward error correction) */
84 /** Application-specific descriptor for the data block, e.g. firmware version */
108 uint8_t tx_pos = 0; in frag_transport_package_callback()
109 uint8_t rx_pos = 0; in frag_transport_package_callback()
110 int ans_delay = 0; in frag_transport_package_callback()
118 if (sizeof(tx_buf) - tx_pos < FRAG_TRANSPORT_MAX_ANS_LEN) { in frag_transport_package_callback()
130 uint8_t frag_status = rx_buf[rx_pos++] & 0x07; in frag_transport_package_callback()
131 uint8_t participants = frag_status & 0x01; in frag_transport_package_callback()
137 uint8_t missing_frag = CLAMP(ctx.nb_frag - ctx.nb_frag_received, 0, 255); in frag_transport_package_callback()
139 uint8_t memory_error = 0; in frag_transport_package_callback()
145 if (participants == 1 || missing_frag > 0) { in frag_transport_package_callback()
147 tx_buf[tx_pos++] = ctx.nb_frag_received & 0xFF; in frag_transport_package_callback()
149 (index << 6) | ((ctx.nb_frag_received >> 8) & 0x3F); in frag_transport_package_callback()
151 tx_buf[tx_pos++] = memory_error & 0x01; in frag_transport_package_callback()
163 uint8_t frag_session = rx_buf[rx_pos++] & 0x3F; in frag_transport_package_callback()
169 ctx.nb_frag_received = 0; in frag_transport_package_callback()
182 "padding: %u, control: 0x%x, descriptor: 0x%.8x", in frag_transport_package_callback()
193 if (ctx.frag_algo > 0) { in frag_transport_package_callback()
195 status |= BIT(0); in frag_transport_package_callback()
212 if ((status & 0x1F) == 0) { in frag_transport_package_callback()
216 * from writing byte-wise 0xFF to the entire flash. Instead, erase in frag_transport_package_callback()
238 uint8_t index = rx_buf[rx_pos++] & 0x03; in frag_transport_package_callback()
239 uint8_t status = 0x00; in frag_transport_package_callback()
260 uint16_t frag_counter = frag_index_n & 0x3FFF; in frag_transport_package_callback()
261 uint8_t index = (frag_index_n >> 14) & 0x03; in frag_transport_package_callback()
284 frag_counter, ctx.nb_frag, frag_counter - ctx.nb_frag_received, in frag_transport_package_callback()
287 if (decoder_process_status >= 0) { in frag_transport_package_callback()
288 /* Positive status corresponds to number of lost (but recovered) in frag_transport_package_callback()
289 * fragments. Value >= 0 means the transport is done. in frag_transport_package_callback()
311 if (tx_pos > 0) { in frag_transport_package_callback()
328 return 0; in lorawan_frag_transport_run()