ble_mesh: Expose header parsing outside net

This commit is contained in:
lly 2019-10-24 15:08:33 +08:00
parent cc772c1324
commit ca0bfb84d0
2 changed files with 13 additions and 0 deletions

View File

@ -1308,6 +1308,17 @@ done:
#endif /* CONFIG_BLE_MESH_NODE */
void bt_mesh_net_header_parse(struct net_buf_simple *buf,
struct bt_mesh_net_rx *rx)
{
rx->old_iv = (IVI(buf->data) != (bt_mesh.iv_index & 0x01));
rx->ctl = CTL(buf->data);
rx->ctx.recv_ttl = TTL(buf->data);
rx->seq = SEQ(buf->data);
rx->ctx.addr = SRC(buf->data);
rx->ctx.recv_dst = DST(buf->data);
}
int bt_mesh_net_decode(struct net_buf_simple *data, enum bt_mesh_net_if net_if,
struct bt_mesh_net_rx *rx, struct net_buf_simple *buf)
{

View File

@ -365,6 +365,8 @@ u32_t bt_mesh_next_seq(void);
void bt_mesh_net_start(void);
void bt_mesh_net_init(void);
void bt_mesh_net_header_parse(struct net_buf_simple *buf,
struct bt_mesh_net_rx *rx);
/* Friendship Credential Management */
struct friend_cred {