10#ifndef ZEPHYR_SUBSYS_BLUETOOTH_MESH_PROXY_MSG_H_
11#define ZEPHYR_SUBSYS_BLUETOOTH_MESH_PROXY_MSG_H_
13#define PDU_TYPE(data) (data[0] & BIT_MASK(6))
14#define CFG_FILTER_SET 0x00
15#define CFG_FILTER_ADD 0x01
16#define CFG_FILTER_REMOVE 0x02
17#define CFG_FILTER_STATUS 0x03
19#define BT_MESH_PROXY_NET_PDU 0x00
20#define BT_MESH_PROXY_BEACON 0x01
21#define BT_MESH_PROXY_CONFIG 0x02
22#define BT_MESH_PROXY_PROV 0x03
24#define PDU_HDR(sar, type) (sar << 6 | (type & BIT_MASK(6)))
26struct bt_mesh_proxy_role;
28typedef int (*proxy_send_cb_t)(uint16_t conn_handle,
29 const void *data, uint16_t len);
31typedef void (*proxy_recv_cb_t)(
struct bt_mesh_proxy_role *role);
33struct bt_mesh_proxy_role {
42 struct k_work_delayable sar_timer;
46struct bt_mesh_proxy_client {
47 struct bt_mesh_proxy_role *cli;
49 uint16_t filter[MYNEWT_VAL(BLE_MESH_PROXY_FILTER_SIZE)];
55 struct ble_npl_callout send_beacons;
58int bt_mesh_proxy_msg_recv(
struct bt_mesh_proxy_role *role,
59 const void *buf, uint16_t len);
60int bt_mesh_proxy_msg_send(
struct bt_mesh_proxy_role *role, uint8_t type,
struct os_mbuf *msg);
61void bt_mesh_proxy_msg_init(
struct bt_mesh_proxy_role *role);
62void bt_mesh_proxy_role_cleanup(
struct bt_mesh_proxy_role *role);
63struct bt_mesh_proxy_role *bt_mesh_proxy_role_setup(uint16_t conn_handle,
65 proxy_recv_cb_t recv);
66struct bt_mesh_proxy_client *find_client(uint16_t conn_handle);