136 const uint64_t bw = airtime_detail::bandwidth_hz(mod.bw);
137 const uint64_t sf = std::to_underlying(mod.sf);
138 const uint32_t n_payload = airtime_detail::payload_symbols(
139 mod.sf, mod.cr, pkt.header, pkt.crc_on, mod.low_data_rate_optimize, payload_length
144 const uint64_t n_symbol_x4 = (
static_cast<uint64_t
>(pkt.preamble_length) + n_payload) * 4 + 17;
149 const uint64_t numerator = n_symbol_x4 * (uint64_t{1} << sf) * 1'000'000ull;
150 const uint64_t denominator = 4ull * bw;
151 const uint64_t us = (numerator + denominator / 2) / denominator;
152 return std::chrono::microseconds{
static_cast<int64_t
>(us)};