|
1 | 1 | /*
|
2 |
| - * SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD |
| 2 | + * SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD |
3 | 3 | *
|
4 | 4 | * SPDX-License-Identifier: Apache-2.0
|
5 | 5 | */
|
|
13 | 13 |
|
14 | 14 | using namespace esp_modem;
|
15 | 15 |
|
| 16 | +#ifdef CONFIG_IDF_TARGET_LINUX |
| 17 | +#define PRIsize_t "lu" |
| 18 | +#else |
| 19 | +#define PRIsize_t "u" |
| 20 | +#endif |
| 21 | + |
16 | 22 | #ifdef CONFIG_ESP_MODEM_CMUX_DEFRAGMENT_PAYLOAD
|
17 | 23 | /**
|
18 | 24 | * @brief Define this to defragment partially received data of CMUX payload
|
@@ -245,7 +251,7 @@ bool CMux::on_header(CMuxFrame &frame)
|
245 | 251 |
|
246 | 252 | bool CMux::on_payload(CMuxFrame &frame)
|
247 | 253 | {
|
248 |
| - ESP_LOGD("CMUX", "Payload frame: dlci:%02x type:%02x payload:%d available:%d", dlci, type, payload_len, frame.len); |
| 254 | + ESP_LOGD("CMUX", "Payload frame: dlci:%02x type:%02x payload:%" PRIsize_t " available:%" PRIsize_t, dlci, type, payload_len, frame.len); |
249 | 255 | if (frame.len < payload_len) { // payload
|
250 | 256 | state = cmux_state::PAYLOAD;
|
251 | 257 | if (!data_available(frame.ptr, frame.len)) { // partial read
|
@@ -312,7 +318,7 @@ bool CMux::on_cmux_data(uint8_t *data, size_t actual_len)
|
312 | 318 | auto data_end = buffer.get() + buffer.size;
|
313 | 319 | data_to_read = payload_len + 2; // 2 -- CMUX protocol footer
|
314 | 320 | if (data + data_to_read >= data_end) {
|
315 |
| - ESP_LOGW("CUMX", "Failed to defragment longer payload (payload=%d)", payload_len); |
| 321 | + ESP_LOGW("CUMX", "Failed to defragment longer payload (payload=%" PRIsize_t ")", payload_len); |
316 | 322 | // If you experience this error, your device uses longer payloads while
|
317 | 323 | // the configured buffer is too small to defragment the payload properly.
|
318 | 324 | // To resolve this issue you can:
|
|
0 commit comments