-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
20 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
// ZettaScale Zenoh Team, <[email protected]> | ||
// | ||
|
||
#include <inttypes.h> | ||
#include <stdint.h> | ||
#include <string.h> | ||
|
||
|
@@ -108,7 +109,7 @@ size_t _z_serial_msg_deserialize(const uint8_t *src, size_t src_len, uint8_t *ds | |
|
||
uint32_t computed_crc = _z_crc32(dst, wire_size); | ||
if (received_crc != computed_crc) { | ||
_Z_DEBUG("CRC mismatch. Received: 0x%08lX, Computed: 0x%08lX", received_crc, computed_crc); | ||
_Z_DEBUG("CRC mismatch. Received: 0x%08" PRIu32 ", Computed: 0x%08" PRIu32, received_crc, computed_crc); | ||
return SIZE_MAX; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,26 +12,26 @@ | |
// ZettaScale Zenoh Team, <[email protected]> | ||
// | ||
|
||
#include "zenoh-pico/protocol/definitions/serial.h" | ||
|
||
#include <stdint.h> | ||
|
||
#include "zenoh-pico/protocol/definitions/serial.h" | ||
#include "zenoh-pico/system/common/platform.h" | ||
#include "zenoh-pico/system/common/serial.h" | ||
#include "zenoh-pico/system/link/serial.h" | ||
#include "zenoh-pico/utils/logging.h" | ||
#include "zenoh-pico/utils/pointers.h" | ||
#include "zenoh-pico/utils/result.h" | ||
|
||
#if Z_FEATURE_LINK_SERIAL == 1 | ||
|
||
#define SERIAL_CONNECT_THROTTLE_TIME_MS 250 | ||
|
||
z_result_t _z_connect_serial(const _z_sys_net_socket_t sock) { | ||
while (true) { | ||
uint8_t header = _Z_FLAG_SERIAL_INIT; | ||
|
||
_z_send_serial_internal(sock, header, NULL, 0); | ||
uint8_t tmp; | ||
size_t ret = _z_read_serial_internal(sock, &header, &tmp, sizeof(tmp)); | ||
size_t ret = _z_read_serial_internal(sock, &header, NULL, 0); | ||
if (ret == SIZE_MAX) { | ||
return _Z_ERR_TRANSPORT_RX_FAILED; | ||
} | ||
|
@@ -78,3 +78,4 @@ size_t _z_read_exact_serial(const _z_sys_net_socket_t sock, uint8_t *ptr, size_t | |
|
||
return n; | ||
} | ||
#endif // Z_FEATURE_LINK_SERIAL == 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters