Zephyr Project API 4.0.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
bt_l2cap_server Struct Reference

L2CAP Server structure. More...

#include <l2cap.h>

Data Fields

uint16_t psm
 Server PSM.
 
bt_security_t sec_level
 Required minimum security level.
 
int(* accept )(struct bt_conn *conn, struct bt_l2cap_server *server, struct bt_l2cap_chan **chan)
 Server accept callback.
 
sys_snode_t node
 

Detailed Description

L2CAP Server structure.

Field Documentation

◆ accept

int(* bt_l2cap_server::accept) (struct bt_conn *conn, struct bt_l2cap_server *server, struct bt_l2cap_chan **chan)

Server accept callback.

This callback is called whenever a new incoming connection requires authorization.

Warning
It is the responsibility of this callback to zero out the parent of the chan object.
Parameters
connThe connection that is requesting authorization
serverPointer to the server structure this callback relates to
chanPointer to received the allocated channel
Returns
0 in case of success or negative value in case of error.
-ENOMEM if no available space for new channel.
-EACCES if application did not authorize the connection.
-EPERM if encryption key size is too short.

◆ node

sys_snode_t bt_l2cap_server::node

◆ psm

uint16_t bt_l2cap_server::psm

Server PSM.

For LE, possible values: 0 A dynamic value will be auto-allocated when bt_l2cap_server_register() is called.

0x0001-0x007f Standard, Bluetooth SIG-assigned fixed values.

0x0080-0x00ff Dynamically allocated. May be pre-set by the application before server registration (not recommended however), or auto-allocated by the stack if the app gave 0 as the value.

For BR, possible values:

The PSM field is at least two octets in length. All PSM values shall have the least significant bit of the most significant octet equal to 0 and the least significant bit of all other octets equal to 1.

0 A dynamic value will be auto-allocated when bt_l2cap_br_server_register() is called.

0x0001-0x0eff Standard, Bluetooth SIG-assigned fixed values.

‍0x1000 Dynamically allocated. May be pre-set by the application before server registration (not recommended however), or auto-allocated by the stack if the app gave 0 as the value.

◆ sec_level

bt_security_t bt_l2cap_server::sec_level

Required minimum security level.


The documentation for this struct was generated from the following file: