1 /* Bluetooth Mesh */ 2 3 /* 4 * Copyright (c) 2017 Intel Corporation 5 * 6 * SPDX-License-Identifier: Apache-2.0 7 */ 8 9 enum bt_mesh_friend_pdu_type { 10 BT_MESH_FRIEND_PDU_SINGLE, 11 BT_MESH_FRIEND_PDU_PARTIAL, 12 BT_MESH_FRIEND_PDU_COMPLETE, 13 }; 14 15 bool bt_mesh_friend_match(u16_t net_idx, u16_t addr); 16 17 struct bt_mesh_friend *bt_mesh_friend_find(u16_t net_idx, u16_t lpn_addr, 18 bool valid, bool established); 19 20 void bt_mesh_friend_enqueue_rx(struct bt_mesh_net_rx *rx, 21 enum bt_mesh_friend_pdu_type type, 22 u64_t *seq_auth, struct net_buf_simple *sbuf); 23 bool bt_mesh_friend_enqueue_tx(struct bt_mesh_net_tx *tx, 24 enum bt_mesh_friend_pdu_type type, 25 u64_t *seq_auth, struct net_buf_simple *sbuf); 26 27 void bt_mesh_friend_clear_incomplete(struct bt_mesh_subnet *sub, u16_t src, 28 u16_t dst, u64_t *seq_auth); 29 30 void bt_mesh_friend_sec_update(u16_t net_idx); 31 32 void bt_mesh_friend_clear_net_idx(u16_t net_idx); 33 34 int bt_mesh_friend_poll(struct bt_mesh_net_rx *rx, struct net_buf_simple *buf); 35 int bt_mesh_friend_req(struct bt_mesh_net_rx *rx, struct net_buf_simple *buf); 36 int bt_mesh_friend_clear(struct bt_mesh_net_rx *rx, struct net_buf_simple *buf); 37 int bt_mesh_friend_clear_cfm(struct bt_mesh_net_rx *rx, 38 struct net_buf_simple *buf); 39 int bt_mesh_friend_sub_add(struct bt_mesh_net_rx *rx, 40 struct net_buf_simple *buf); 41 int bt_mesh_friend_sub_rem(struct bt_mesh_net_rx *rx, 42 struct net_buf_simple *buf); 43 44 int bt_mesh_friend_init(void); 45