Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix u16 little endian encoding #263

Merged
merged 1 commit into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/protocol/codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ int8_t _z_uint8_decode(uint8_t *u8, _z_zbuf_t *zbf) {
int8_t _z_uint16_encode(_z_wbuf_t *wbf, uint16_t u16) {
int8_t ret = _Z_RES_OK;

ret |= _z_wbuf_write(wbf, ((u16 >> 8) & 0xFF));
ret |= _z_wbuf_write(wbf, (u16 & 0xFF));
ret |= _z_wbuf_write(wbf, ((u16 >> 8) & 0xFF));

return ret;
}
Expand All @@ -163,9 +163,9 @@ int8_t _z_uint16_decode(uint16_t *u16, _z_zbuf_t *zbf) {

uint8_t u8;
ret |= _z_uint8_decode(&u8, zbf);
*u16 |= u8 << 8;
ret |= _z_uint8_decode(&u8, zbf);
*u16 |= u8;
ret |= _z_uint8_decode(&u8, zbf);
*u16 |= u8 << 8;

return ret;
}
Expand Down
6 changes: 3 additions & 3 deletions zenohpico.pc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ prefix=/usr/local
Name: zenohpico
Description:
URL:
Version: 0.10.20230920dev
Cflags: -I${prefix}/
Libs: -L${prefix}/ -lzenohpico
Version: 0.11.20231012dev
Cflags: -I${prefix}/include
Libs: -L${prefix}/lib -lzenohpico