Lines Matching +full:github +full:- +full:token
6 * LoRaMac-node firmware repository https://github.com/Lora-net/LoRaMac-node
9 * SPDX-License-Identifier: Apache-2.0
25 * This implementation only supports TS003-2.0.0, as the previous revision TS003-1.0.0
45 /** Work item for regular (re-)sync requests (uplink messages) */
47 /** Continuously incremented token to map clock sync answers and requests */
70 * @returns number of bytes written or -ENOSPC in case of error
77 return -ENOSPC; in clock_sync_serialize_device_time()
90 /* add +-30s jitter to nominal periodicity as required by the spec */ in clock_sync_calc_periodicity()
91 return K_SECONDS(ctx.periodicity - 30 + sys_rand32_get() % 61); in clock_sync_calc_periodicity()
106 if (sizeof(tx_buf) - tx_pos < MAX_CLOCK_SYNC_ANS_LEN) { in clock_sync_package_callback()
129 uint8_t token = rx_buf[rx_pos++] & 0x0F; in clock_sync_package_callback() local
131 if (token == ctx.req_token) { in clock_sync_package_callback()
136 LOG_DBG("AppTimeAns time_correction %d (token %d)", in clock_sync_package_callback()
137 time_correction, token); in clock_sync_package_callback()
139 LOG_WRN("AppTimeAns with outdated token %d", token); in clock_sync_package_callback()
152 sizeof(tx_buf) - tx_pos); in clock_sync_package_callback()
189 return -EBUSY; in clock_sync_app_time_req()
194 sizeof(tx_buf) - tx_pos); in clock_sync_app_time_req()
199 LOG_DBG("Sending clock sync AppTimeReq (token %d)", ctx.req_token); in clock_sync_app_time_req()
211 ctx.nb_transmissions--; in clock_sync_resync_handler()
227 return -EAGAIN; in lorawan_clock_sync_get()