Bluetooth PAN Profile
- group BT_PAN
Provide BT PAN profile interfaces.
Typedefs
-
typedef enum t_bt_pan_event T_BT_PAN_EVENT
BT PAN event type for T_BT_PAN_CBACK.
-
typedef struct t_bt_pan_event_param_conn_ind T_BT_PAN_EVENT_PARAM_CONN_IND
BT PAN event parameter PAN connection indication.
-
typedef struct t_bt_pan_event_param_conn_cmpl T_BT_PAN_EVENT_PARAM_CONN_CMPL
BT PAN event parameter PAN connection completed.
-
typedef struct t_bt_pan_event_param_conn_fail T_BT_PAN_EVENT_PARAM_CONN_FAIL
BT PAN event parameter PAN connection fail.
-
typedef struct t_bt_pan_event_param_disconn_cmpl T_BT_PAN_EVENT_PARAM_DISCONN_CMPL
BT PAN event parameter PAN disconnection completed.
-
typedef struct t_bt_pan_event_param_setup_conn_ind T_BT_PAN_EVENT_PARAM_SETUP_CONN_IND
BT PAN event parameter PAN setup connection indication.
-
typedef struct t_bt_pan_event_param_setup_conn_rsp T_BT_PAN_EVENT_PARAM_SETUP_CONN_RSP
BT PAN event parameter PAN setup connection response.
-
typedef struct t_bt_pan_event_param_filter_net_type_set_ind T_BT_PAN_EVENT_PARAM_FILTER_NET_TYPE_SET_IND
BT PAN event parameter PAN filter network type set indication.
-
typedef struct t_bt_pan_event_param_filter_net_type_set_rsp T_BT_PAN_EVENT_PARAM_FILTER_NET_TYPE_SET_RSP
BT PAN event parameter PAN filter network type set response.
-
typedef struct t_bt_pan_event_param_filter_multi_addr_set_ind T_BT_PAN_EVENT_PARAM_FILTER_MULTI_ADDR_SET_IND
BT PAN event parameter PAN filter multicast address set indication.
-
typedef struct t_bt_pan_event_param_filter_multi_addr_set_rsp T_BT_PAN_EVENT_PARAM_FILTER_MULTI_ADDR_SET_RSP
BT PAN event parameter PAN filter multicast address set response.
-
typedef struct t_bt_pan_event_param_ethernet_packet_ind T_BT_PAN_EVENT_PARAM_ETHERNET_PACKET_IND
BT PAN event parameter PAN ethernet packet indication.
-
typedef union t_bt_pan_event_param T_BT_PAN_EVENT_PARAM
BT PAN event parameter.
-
typedef enum t_bt_pan_role T_BT_PAN_ROLE
BT PAN supported features.
-
typedef void (*T_BT_PAN_CBACK)(T_BT_PAN_EVENT event_type, void *event_buf, uint16_t buf_len)
BT PAN event callback prototype.
- Param event_type:
[in] BT PAN event type.
- Param event_buf:
[in] Event buffer address.
- Param buf_len:
[in] Event buffer length.
Enums
-
enum t_bt_pan_event
BT PAN event type for T_BT_PAN_CBACK.
Values:
-
enumerator BT_PAN_EVENT_CONN_IND
Indicate PAN connection indication T_BT_PAN_EVENT_PARAM_CONN_IND.
-
enumerator BT_PAN_EVENT_CONN_CMPL
Indicate PAN connection complete T_BT_PAN_EVENT_PARAM_CONN_CMPL.
-
enumerator BT_PAN_EVENT_CONN_FAIL
Indicate PAN connection fail T_BT_PAN_EVENT_PARAM_CONN_FAIL.
-
enumerator BT_PAN_EVENT_DISCONN_CMPL
Indicate PAN disconnection complete T_BT_PAN_EVENT_PARAM_DISCONN_CMPL.
-
enumerator BT_PAN_EVENT_SETUP_CONN_IND
Indicate PAN setup connection indication T_BT_PAN_EVENT_PARAM_SETUP_CONN_IND.
-
enumerator BT_PAN_EVENT_SETUP_CONN_RSP
Indicate PAN setup connection response T_BT_PAN_EVENT_PARAM_SETUP_CONN_RSP.
-
enumerator BT_PAN_EVENT_FILTER_NET_TYPE_SET_IND
Indicate PAN filter network type set indication T_BT_PAN_EVENT_PARAM_FILTER_NET_TYPE_SET_IND.
-
enumerator BT_PAN_EVENT_FILTER_NET_TYPE_SET_RSP
Indicate PAN filter network type set response T_BT_PAN_EVENT_PARAM_FILTER_NET_TYPE_SET_RSP.
-
enumerator BT_PAN_EVENT_FILTER_MULTI_ADDR_SET_IND
Indicate PAN filter multicast address set indication T_BT_PAN_EVENT_PARAM_FILTER_MULTI_ADDR_SET_IND.
-
enumerator BT_PAN_EVENT_FILTER_MULTI_ADDR_SET_RSP
Indicate PAN filter multicast address set response T_BT_PAN_EVENT_PARAM_FILTER_MULTI_ADDR_SET_RSP.
-
enumerator BT_PAN_EVENT_ETHERNET_PACKET_IND
Indicate PAN ethernet packet indication T_BT_PAN_EVENT_PARAM_ETHERNET_PACKET_IND.
-
enumerator BT_PAN_EVENT_CONN_IND
Functions
-
bool bt_pan_init(void)
Initialize PAN profile.
- Return values:
true – PAN profile was initialized successfully.
false – PAN profile was failed to initialize.
- Returns:
The status of initializing PAN profile.
-
void bt_pan_deinit(void)
De-initialize PAN profile.
-
bool bt_pan_cback_register(T_BT_PAN_CBACK cback)
BT PAN event callback register.
- Parameters:
cback – [in] Callback function T_BT_PAN_CBACK
- Return values:
true – BT PAN event callback was registered successfully.
false – BT PAN event callback was failed to register.
- Returns:
The status of BT PAN event callback register.
-
bool bt_pan_cback_unregister(T_BT_PAN_CBACK cback)
BT PAN event callback unregister.
- Parameters:
cback – [in] Callback function T_BT_PAN_CBACK
- Return values:
true – BT PAN event callback was unregistered successfully.
false – BT PAN event callback was failed to unregister.
- Returns:
The status of BT PAN event callback unregister.
-
bool bt_pan_connect_req(uint8_t local_addr[6], uint8_t remote_addr[6], T_BT_PAN_ROLE src_role, T_BT_PAN_ROLE dst_role)
Send a PAN connection request.
- Parameters:
local_addr – [in] Local BT address.
remote_addr – [in] Remote BT address.
src_role – [in] Source PAN role T_BT_PAN_ROLE.
dst_role – [in] Destination PAN role T_BT_PAN_ROLE.
- Return values:
true – PAN connection request was sent successfully.
false – PAN connection request was failed to send.
- Returns:
The status of sending the PAN connection request.
-
bool bt_pan_connect_cfm(uint8_t local_addr[6], uint8_t remote_addr[6], bool accept)
Send a PAN connection confirmation.
- Parameters:
local_addr – [in] Local BT address.
remote_addr – [in] Remote BT address.
accept – [in] Accept or reject the connection indication.
true Accept the connection indication.
false Reject the connection indication.
- Return values:
true – PAN connection confirmation was sent successfully.
false – PAN connection confirmation was failed to send.
- Returns:
The status of sending the PAN connection confirmation.
-
bool bt_pan_disconnect_req(uint8_t bd_addr[6])
Send a PAN disconnection request.
- Parameters:
bd_addr – [in] Remote BT address.
- Return values:
true – PAN disconnection request was sent successfully.
false – PAN disconnection request was failed to send.
- Returns:
The status of sending the PAN disconnection request.
-
bool bt_pan_setup_connection_req(uint8_t bd_addr[6], T_BT_PAN_ROLE src_role, T_BT_PAN_ROLE dst_role)
Send a PAN setup connection request.
- Parameters:
bd_addr – [in] Remote BT address.
src_role – [in] Source PAN role T_BT_PAN_ROLE.
dst_role – [in] Destination PAN role T_BT_PAN_ROLE.
- Return values:
true – PAN setup connection request was sent successfully.
false – PAN setup connection request was failed to send.
- Returns:
The status of sending the PAN setup connection request.
-
bool bt_pan_setup_connection_rsp(uint8_t bd_addr[6], uint16_t rsp_msg)
Send a PAN setup connection response.
- Parameters:
bd_addr – [in] Remote BT address.
rsp_msg – [in] Response message.
- Return values:
true – PAN setup connection response was sent successfully.
false – PAN setup connection response was failed to send.
- Returns:
The status of sending the PAN setup connection response.
-
bool bt_pan_filter_net_type_set(uint8_t bd_addr[6], uint16_t filter_num, uint16_t *start_array, uint16_t *end_array)
Send a PAN network type filter set message.
- Parameters:
bd_addr – [in] Remote BT address.
filter_num – [in] Number of filters.
start_array – [in] Network protocol type range start array.
end_array – [in] Network protocol type range end array.
- Return values:
true – PAN network type filter set message was sent successfully.
false – PAN network type filter set message was failed to send.
- Returns:
The status of sending the PAN network type filter set message.
-
bool bt_pan_filter_multi_addr_set(uint8_t bd_addr[6], uint16_t filter_num, uint8_t start_array[][6], uint8_t end_array[][6])
Send a PAN multicast address filter set message.
- Parameters:
bd_addr – [in] Remote BT address.
filter_num – [in] Number of filters.
start_array – [in] Multicast address start array.
end_array – [in] Multicast address end array.
- Return values:
true – PAN multicast address filter set message was sent successfully.
false – PAN multicast address filter set message was failed to send.
- Returns:
The status of sending the PAN multicast address filter set message.
-
bool bt_pan_send(uint8_t bd_addr[6], uint8_t *buf, uint16_t len)
Send a PAN ethernet packet.
- Parameters:
bd_addr – [in] Remote BT address.
buf – [in] Ethernet packet buffer.
len – [in] Length of ethernet packet.
- Return values:
true – PAN ethernet packet was sent successfully.
false – PAN ethernet packet was failed to send.
- Returns:
The status of sending the PAN ethernet packet.
-
struct t_bt_pan_event_param_conn_ind
BT PAN event parameter PAN connection indication.
Public Members
-
uint8_t bd_addr[6]
-
uint8_t bd_addr[6]
-
struct t_bt_pan_event_param_conn_cmpl
BT PAN event parameter PAN connection completed.
Public Members
-
uint8_t bd_addr[6]
-
uint8_t bd_addr[6]
-
struct t_bt_pan_event_param_conn_fail
BT PAN event parameter PAN connection fail.
-
struct t_bt_pan_event_param_disconn_cmpl
BT PAN event parameter PAN disconnection completed.
-
struct t_bt_pan_event_param_setup_conn_ind
BT PAN event parameter PAN setup connection indication.
-
struct t_bt_pan_event_param_setup_conn_rsp
BT PAN event parameter PAN setup connection response.
-
struct t_bt_pan_event_param_filter_net_type_set_ind
BT PAN event parameter PAN filter network type set indication.
-
struct t_bt_pan_event_param_filter_net_type_set_rsp
BT PAN event parameter PAN filter network type set response.
-
struct t_bt_pan_event_param_filter_multi_addr_set_ind
BT PAN event parameter PAN filter multicast address set indication.
-
struct t_bt_pan_event_param_filter_multi_addr_set_rsp
BT PAN event parameter PAN filter multicast address set response.
-
struct t_bt_pan_event_param_ethernet_packet_ind
BT PAN event parameter PAN ethernet packet indication.
-
union t_bt_pan_event_param
BT PAN event parameter.
Public Members
-
T_BT_PAN_EVENT_PARAM_CONN_IND pan_conn_ind
-
T_BT_PAN_EVENT_PARAM_CONN_CMPL pan_conn_cmpl
-
T_BT_PAN_EVENT_PARAM_CONN_FAIL pan_conn_fail
-
T_BT_PAN_EVENT_PARAM_DISCONN_CMPL pan_disconn_cmpl
-
T_BT_PAN_EVENT_PARAM_SETUP_CONN_IND pan_setup_conn_ind
-
T_BT_PAN_EVENT_PARAM_SETUP_CONN_RSP pan_setup_conn_rsp
-
T_BT_PAN_EVENT_PARAM_FILTER_NET_TYPE_SET_IND pan_filter_net_type_set_ind
-
T_BT_PAN_EVENT_PARAM_FILTER_NET_TYPE_SET_RSP pan_filter_net_type_set_rsp
-
T_BT_PAN_EVENT_PARAM_FILTER_MULTI_ADDR_SET_IND pan_filter_multi_addr_set_ind
-
T_BT_PAN_EVENT_PARAM_FILTER_MULTI_ADDR_SET_RSP pan_filter_multi_addr_set_rsp
-
T_BT_PAN_EVENT_PARAM_ETHERNET_PACKET_IND pan_ethernet_packet_ind
-
T_BT_PAN_EVENT_PARAM_CONN_IND pan_conn_ind
-
typedef enum t_bt_pan_event T_BT_PAN_EVENT