1. Add an API to set Provisioner static oob value 2. Add an API to deinit BLE Mesh stack 3. Add an API to set Provisioner unicast address 4. Add an API to provision devices with fixed address 5. Add an API to store node composition data 6. Add an API to get node with device uuid 7. Add an API to get node with unicast address 8. Add an API to delete node with device uuid 9. Add an API to delete node with unicast address 10. Add an API for Provisioner to update local AppKey 11. Add an API for Provisioner to update local NetKey 12. Support Provisioner persistent functionality 13. Fix Provisioner entering IV Update procedure 14. Fix an issue which may cause client failing to send msg 15. Use bt_mesh.flags to indicate device role 16. Remove several useless macros 17. Callback RSSI of received mesh provisioning packets 18. Modify the Provisioner disable function 19. Change some log level from debug to info 20. Add parameters to Provisioner bind AppKey completion event 21. Fix node ignoring relay messages issue 22. Support using a specific partition for BLE Mesh 23. Fix compile warning when proxy related macros are disabled 24. Clean up BLE Mesh stack included header files 25. NULL can be input if client message needs no parameters 26. Fix compile warning when BT log is disabled 27. Initilize BLE Mesh stack local variables 28. Support using PSRAM for BLE Mesh mutex, queue and task 29. Add a menuconfig option to enable using memory from PSRAM 30. Clean up sdkconfig.defaults of BLE Mesh examples
103 lines
3.6 KiB
C
103 lines
3.6 KiB
C
// Copyright 2017-2019 Espressif Systems (Shanghai) PTE LTD
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
#ifndef _PROXY_CLIENT_H_
|
|
#define _PROXY_CLIENT_H_
|
|
|
|
#include "net.h"
|
|
#include "mesh_bearer_adapt.h"
|
|
|
|
#define BLE_MESH_PROXY_ADV_NET_ID 0x00
|
|
#define BLE_MESH_PROXY_ADV_NODE_ID 0x01
|
|
|
|
#define BLE_MESH_PROXY_NET_PDU 0x00
|
|
#define BLE_MESH_PROXY_BEACON 0x01
|
|
#define BLE_MESH_PROXY_CONFIG 0x02
|
|
#define BLE_MESH_PROXY_PROV 0x03
|
|
|
|
#define BLE_MESH_PROXY_CFG_FILTER_SET 0x00
|
|
#define BLE_MESH_PROXY_CFG_FILTER_ADD 0x01
|
|
#define BLE_MESH_PROXY_CFG_FILTER_REMOVE 0x02
|
|
#define BLE_MESH_PROXY_CFG_FILTER_STATUS 0x03
|
|
|
|
typedef union {
|
|
struct {
|
|
u8_t net_id[8];
|
|
u16_t net_idx;
|
|
} net_id;
|
|
struct {
|
|
u16_t src;
|
|
} node_id;
|
|
} bt_mesh_proxy_adv_ctx_t;
|
|
|
|
struct bt_mesh_proxy_net_pdu {
|
|
struct net_buf_simple *val;
|
|
};
|
|
|
|
struct bt_mesh_proxy_cfg_pdu {
|
|
u8_t opcode;
|
|
union {
|
|
struct cfg_filter_set {
|
|
u8_t filter_type;
|
|
} set;
|
|
struct cfg_addr_add {
|
|
u16_t *addr;
|
|
u16_t addr_num;
|
|
} add;
|
|
struct cfg_addr_remove {
|
|
u16_t *addr;
|
|
u16_t addr_num;
|
|
} remove;
|
|
};
|
|
};
|
|
|
|
typedef struct {
|
|
u8_t type;
|
|
union {
|
|
struct bt_mesh_proxy_net_pdu net;
|
|
struct bt_mesh_proxy_cfg_pdu cfg;
|
|
};
|
|
} bt_mesh_proxy_client_pdu_t;
|
|
|
|
int bt_mesh_proxy_prov_client_send(struct bt_mesh_conn *conn, u8_t type, struct net_buf_simple *msg);
|
|
|
|
int bt_mesh_provisioner_pb_gatt_enable(void);
|
|
int bt_mesh_provisioner_pb_gatt_disable(void);
|
|
|
|
int bt_mesh_proxy_client_enable(void);
|
|
int bt_mesh_proxy_client_disable(void);
|
|
|
|
typedef void (*proxy_client_recv_adv_cb_t)(const bt_mesh_addr_t *addr, u8_t type, bt_mesh_proxy_adv_ctx_t *ctx, s8_t rssi);
|
|
typedef void (*proxy_client_connect_cb_t)(const bt_mesh_addr_t *addr, u8_t conn_handle, u16_t net_idx);
|
|
typedef void (*proxy_client_disconnect_cb_t)(const bt_mesh_addr_t *addr, u8_t conn_handle, u16_t net_idx, u8_t reason);
|
|
typedef void (*proxy_client_recv_filter_status_cb_t)(u8_t conn_handle, u16_t src, u16_t net_idx, u8_t filter_type, u16_t list_size);
|
|
|
|
void bt_mesh_proxy_client_set_adv_recv_cb(proxy_client_recv_adv_cb_t cb);
|
|
void bt_mesh_proxy_client_set_conn_cb(proxy_client_connect_cb_t cb);
|
|
void bt_mesh_proxy_client_set_disconn_cb(proxy_client_disconnect_cb_t cb);
|
|
void bt_mesh_proxy_client_set_filter_status_cb(proxy_client_recv_filter_status_cb_t cb);
|
|
|
|
void bt_mesh_proxy_client_adv_ind_recv(struct net_buf_simple *buf, const bt_mesh_addr_t *addr, s8_t rssi);
|
|
|
|
int bt_mesh_proxy_client_connect(const u8_t addr[6], u8_t addr_type, u16_t net_idx);
|
|
int bt_mesh_proxy_client_disconnect(u8_t conn_handle);
|
|
|
|
bool bt_mesh_proxy_client_beacon_send(struct bt_mesh_subnet *sub);
|
|
bool bt_mesh_proxy_client_send(struct net_buf_simple *buf, u16_t dst);
|
|
int bt_mesh_proxy_client_send_cfg(u8_t conn_handle, u16_t net_idx, struct bt_mesh_proxy_cfg_pdu *pdu);
|
|
|
|
int bt_mesh_proxy_prov_client_init(void);
|
|
int bt_mesh_proxy_prov_client_deinit(void);
|
|
|
|
#endif /* _PROXY_CLIENT_H_ */
|