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.

enum t_bt_pan_role

BT PAN supported features.

Values:

enumerator BT_PAN_ROLE_PANU
enumerator BT_PAN_ROLE_NAP
enumerator BT_PAN_ROLE_GN

Functions

bool bt_pan_init(void)

Initialize PAN profile.

Experimental Added Since 2.13.0.0:

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.

Experimental Added Since 2.13.0.0:

bool bt_pan_cback_register(T_BT_PAN_CBACK cback)

BT PAN event callback register.

Experimental Added Since 2.13.0.0:

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.

Experimental Added Since 2.13.0.0:

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.

Experimental Added Since 2.13.0.0:

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.

Experimental Added Since 2.13.0.0:

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.

Experimental Added Since 2.13.0.0:

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.

Experimental Added Since 2.13.0.0:

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.

Experimental Added Since 2.13.0.0:

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.

Experimental Added Since 2.13.0.0:

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.

Experimental Added Since 2.13.0.0:

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.

Experimental Added Since 2.13.0.0:

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]
struct t_bt_pan_event_param_conn_cmpl

BT PAN event parameter PAN connection completed.

Public Members

uint8_t bd_addr[6]
struct t_bt_pan_event_param_conn_fail

BT PAN event parameter PAN connection fail.

Public Members

uint8_t bd_addr[6]
uint16_t cause
struct t_bt_pan_event_param_disconn_cmpl

BT PAN event parameter PAN disconnection completed.

Public Members

uint8_t bd_addr[6]
uint16_t cause
struct t_bt_pan_event_param_setup_conn_ind

BT PAN event parameter PAN setup connection indication.

Public Members

uint8_t bd_addr[6]
uint16_t dst_uuid
uint16_t src_uuid
struct t_bt_pan_event_param_setup_conn_rsp

BT PAN event parameter PAN setup connection response.

Public Members

uint8_t bd_addr[6]
uint16_t rsp_msg
struct t_bt_pan_event_param_filter_net_type_set_ind

BT PAN event parameter PAN filter network type set indication.

Public Members

uint8_t bd_addr[6]
uint16_t filter_num
uint16_t *filter_start
uint16_t *filter_end
struct t_bt_pan_event_param_filter_net_type_set_rsp

BT PAN event parameter PAN filter network type set response.

Public Members

uint8_t bd_addr[6]
uint16_t rsp_msg
struct t_bt_pan_event_param_filter_multi_addr_set_ind

BT PAN event parameter PAN filter multicast address set indication.

Public Members

uint8_t bd_addr[6]
uint16_t filter_num
uint8_t (*filter_start)[6]
uint8_t (*filter_end)[6]
struct t_bt_pan_event_param_filter_multi_addr_set_rsp

BT PAN event parameter PAN filter multicast address set response.

Public Members

uint8_t bd_addr[6]
uint16_t rsp_msg
struct t_bt_pan_event_param_ethernet_packet_ind

BT PAN event parameter PAN ethernet packet indication.

Public Members

uint8_t bd_addr[6]
uint8_t *buf
uint16_t len
union t_bt_pan_event_param

BT PAN event parameter.