PAN
The purpose of this document is to give an overview of the Personal Area Networking Profile. PAN profile describes how two or more Bluetooth enabled devices can form an ad-hoc network and how the same mechanism can be used to access a remote network through a network access point.
Terminology and Concepts
PAN Role
Network Access Points - A NAP is a unit that contains one or more Bluetooth radio devices and acts as a bridge, proxy, or router between a Bluetooth network and some other network technology.
Group Ad-hoc Networks - A Bluetooth device that supports the GN service is able to forward ethernet packets to each of the connected Bluetooth devices, the PAN users, as needed.
PAN Users - PANU is the Bluetooth device that uses either the NAP or the GN service. PANU supports the client role for both the NAP and GN roles, and direct PANU to PANU communication.
PAN Scenarios
For the PAN profile, three general scenarios are discussed:
Network Access Points
Group Ad-hoc Networks
PANU-PANU
NAP-PANU
A PANU connects to a NAP in order to gain access to an advertised network service.

NAP-PANU
GN-PANU
A PANU connects to a GN to create an ad-hoc network with other Bluetooth devices.

GN-PANU
PANU-PANU
In this scenario, a point to point connection between two PANUs allows direct communication between these two nodes only.
PAN Profile Stack
The figures below show the protocols and entities used in each of the three roles defined by the PAN profile.

Network Access Point Profile Stack

Group Ad-hoc Network Profile Stack

PANU to PANU Profile Stack
Feature Set
The functions provided by PAN APIs are as below:
Connecting and Disconnecting: Including functions to connect/disconnect PAN.
Setting Filters: Including functions to set filters to control which Network Protocol types shall be filtered and not transmitted.
Sending and Receiving Data: Including functions to send ethernet data.
Provided APIs
This figure shows the relationship between applications, PAN, and Bluetooth host. Above the horizon line is developed by the applications. Below the horizon line is developed by Realtek.

PAN Struct
The table below shows a simple description of PAN APIs. PAN related APIs are provided in the sdk\inc\framework\bt\bt_pan.h
.
Header File |
Description |
API Reference |
---|---|---|
|
Connect PAN, send ethernet data etc. |
Functions
PAN Init
void app_pan_init(void)
{
bt_sdp_record_add((void *)panu_sdp_record);
bt_pan_init();
bt_pan_cback_register(app_pan_bt_cback);
}
PAN Service Discovery
Service discover procedure is shown below:

PAN SDP Discovery
PAN Connect

PAN Connect Request

PAN Setup Connection Request

PAN Setup Connection Response

PAN Disconnect Request

PAN Connect_confirm
static void app_pan_bt_cback(T_BT_PAN_EVENT event_type, void *event_buf, uint16_t buf_len)
{
T_BT_PAN_EVENT_PARAM *param = event_buf;
T_APP_BR_LINK *p_link;
bool handle = true;
switch (event_type)
{
case BT_PAN_EVENT_CONN_IND:
{
p_link = app_find_br_link(param->pan_conn_ind.bd_addr);
if (p_link != NULL)
{
bt_pan_connect_cfm(p_link->bd_addr, true);
}
}
break;
}
PAN Set Filter

PAN Filter Network Type Set Request

PAN Filter Multicast Address Set Request
PAN Send Ethernet Packet

PAN Send Ethernet Packet
Sample Projects
SDK provides a corresponding demo application for developers’ reference in development. The BR/EDR PAN gives a simple example on how to use PAN.