ble_mesh: Expose header parsing outside net

pull/4625/head
lly 2019-10-24 15:08:33 +08:00
rodzic 865434e6de
commit 906fb9d6e3
2 zmienionych plików z 13 dodań i 0 usunięć

Wyświetl plik

@ -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)
{

Wyświetl plik

@ -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 {