Skip to content

Commit

Permalink
Ignore response final extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierHecart committed Sep 11, 2023
1 parent bffc549 commit 97f85f8
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions src/protocol/codec/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,35 +413,14 @@ int8_t _z_response_final_encode(_z_wbuf_t *wbf, const _z_n_msg_response_final_t
return ret;
}

int8_t _z_response_final_decode_extension(_z_msg_ext_t *extension, void *ctx) {
int8_t ret = _Z_RES_OK;
_z_n_msg_response_t *msg = (_z_n_msg_response_t *)ctx;
switch (_Z_EXT_FULL_ID(extension->_header)) {
case _Z_MSG_EXT_ENC_ZINT | 0x01: {
msg->_ext_qos._val = extension->_body._zint._val;
break;
}
case _Z_MSG_EXT_ENC_ZBUF | 0x02: {
_z_zbuf_t zbf = _z_zbytes_as_zbuf(extension->_body._zbuf._val);
ret = _z_timestamp_decode(&msg->_ext_timestamp, &zbf);
break;
}
default:
if (_Z_HAS_FLAG(extension->_header, _Z_MSG_EXT_FLAG_M)) {
ret = _z_msg_ext_unknown_error(extension, 0x0d);
}
}
return ret;
}

int8_t _z_response_final_decode(_z_n_msg_response_final_t *msg, _z_zbuf_t *zbf, uint8_t header) {
(void)(header);

*msg = (_z_n_msg_response_final_t){0};
int8_t ret = _Z_RES_OK;
ret |= _z_zint_decode(&msg->_request_id, zbf);
if (_Z_HAS_FLAG(header, _Z_FLAG_Z_Z)) {
_Z_RETURN_IF_ERR(_z_msg_ext_decode_iter(zbf, _z_response_final_decode_extension, msg));
_Z_RETURN_IF_ERR(_z_msg_ext_skip_non_mandatories(zbf, 0x1a));
}
return ret;
}
Expand Down

0 comments on commit 97f85f8

Please sign in to comment.