1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- #include <string.h>
- #include "ant_conn.h"
- #include "ble_serialization.h"
- #include "cond_field_serialization.h"
- #include "ant_struct_serialization.h"
- #include "app_util.h"
- uint32_t ant_channel_assign_req_dec(uint8_t const * const p_buf,
- uint32_t packet_len,
- uint8_t * const p_channel,
- uint8_t * const p_type,
- uint8_t * const p_network,
- uint8_t * const p_ext_assign)
- {
- uint32_t index = SER_CMD_DATA_POS;
- uint32_t err_code;
- SER_ASSERT_NOT_NULL(p_buf);
- SER_ASSERT_NOT_NULL(p_channel);
- SER_ASSERT_NOT_NULL(p_type);
- SER_ASSERT_NOT_NULL(p_network);
- SER_ASSERT_NOT_NULL(p_ext_assign);
- err_code = uint8_t_dec(p_buf, packet_len, &index, p_channel);
- SER_ASSERT(err_code == NRF_SUCCESS, err_code);
- err_code = uint8_t_dec(p_buf, packet_len, &index, p_type);
- SER_ASSERT(err_code == NRF_SUCCESS, err_code);
- err_code = uint8_t_dec(p_buf, packet_len, &index, p_network);
- SER_ASSERT(err_code == NRF_SUCCESS, err_code);
- err_code = uint8_t_dec(p_buf, packet_len, &index, p_ext_assign);
- SER_ASSERT(err_code == NRF_SUCCESS, err_code);
- SER_ASSERT_LENGTH_EQ(index, packet_len);
- return err_code;
- }
- uint32_t ant_channel_assign_rsp_enc(uint32_t return_code,
- uint8_t * const p_buf,
- uint32_t * const p_buf_len)
- {
- uint32_t index = 0;
- return op_status_enc(SVC_ANT_CHANNEL_ASSIGN, return_code, p_buf, p_buf_len, &index);
- }
|