Skip to content
11 changes: 11 additions & 0 deletions include/bluetooth/gatt.h
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,17 @@ struct bt_gatt_notify_params {
int bt_gatt_notify_cb(struct bt_conn *conn,
struct bt_gatt_notify_params *params);

/** @brief Notify multiple attribute value change.
*
* @param conn Connection object.
* @param num_params Number of notification parameters.
* @param params Array of notification parameters.
*
* @return 0 in case of success or negative value in case of error.
*/
int bt_gatt_notify_multiple(struct bt_conn *conn, u16_t num_params,
struct bt_gatt_notify_params *params);

/** @brief Notify attribute value change.
*
* Send notification of attribute value change, if connection is NULL notify
Expand Down
25 changes: 25 additions & 0 deletions include/bluetooth/l2cap.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ typedef enum bt_l2cap_chan_status {
*/
BT_L2CAP_STATUS_SHUTDOWN,

/** @brief Channel encryption pending status */
BT_L2CAP_STATUS_ENCRYPT_PENDING,

/* Total number of status - must be at the end of the enum */
BT_L2CAP_NUM_STATUS,
} __packed bt_l2cap_chan_status_t;
Expand Down Expand Up @@ -257,6 +260,13 @@ struct bt_l2cap_chan_ops {
* @param status The channel status
*/
void (*status)(struct bt_l2cap_chan *chan, atomic_t *status);

/* @brief Channel released callback
*
* If this callback is set it is called when the stack has release all
* references to the channel object.
*/
void (*released)(struct bt_l2cap_chan *chan);
};

/** @def BT_L2CAP_CHAN_SEND_RESERVE
Expand Down Expand Up @@ -335,6 +345,21 @@ int bt_l2cap_server_register(struct bt_l2cap_server *server);
*/
int bt_l2cap_br_server_register(struct bt_l2cap_server *server);

/** @brief Connect Enhanced Credit Based L2CAP channels
*
* Connect up to 5 L2CAP channels by PSM, once the connection is completed
* each channel connected() callback will be called. If the connection is
* rejected disconnected() callback is called instead.
*
* @param conn Connection object.
* @param chans Array of channel objects.
* @param psm Channel PSM to connect to.
*
* @return 0 in case of success or negative value in case of error.
*/
int bt_l2cap_ecred_chan_connect(struct bt_conn *conn,
struct bt_l2cap_chan **chans, u16_t psm);

/** @brief Connect L2CAP channel
*
* Connect L2CAP channel by PSM, once the connection is completed channel
Expand Down
4 changes: 4 additions & 0 deletions include/bluetooth/uuid.h
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,10 @@ struct bt_uuid_128 {
* @brief Database Hash
*/
#define BT_UUID_GATT_DB_HASH BT_UUID_DECLARE_16(0x2b2a)
/** @def BT_UUID_GATT_SERVER_FEATURES
* @brief Server Supported Features
*/
#define BT_UUID_GATT_SERVER_FEATURES BT_UUID_DECLARE_16(0x2b3a)

/*
* Protocol UUIDs
Expand Down
55 changes: 55 additions & 0 deletions subsys/bluetooth/host/Kconfig.gatt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,49 @@ config BT_ATT_TX_MAX
amount the calls will block until an existing queued PDU gets
sent.

config BT_EATT
bool "Enhanced ATT Bearers support [EXPERIMENTAL]"
depends on BT_L2CAP_DYNAMIC_CHANNEL
help
This option enables support for Enhanced ATT bearers support. When
enabled additional L2CAP channels can be connected as bearers enabling
multiple outstanding request.

if BT_EATT

config BT_EATT_MAX
int "Maximum number of Enhanced ATT bearers"
default 3
range 1 16

help
Number of Enhanced ATT bearers available.

config BT_EATT_RX_MTU
int "Maximum supported Enhanced ATT MTU for incoming data"
default 70
range 70 519
depends on BT_EATT
help
Maximum size incoming PDUs on EATT bearers, value shall include L2CAP
headers and SDU length, maximum is limited to 512 bytes payload, which
is the maximum size for a GATT attribute, plus 1 byte for ATT opcode.
This option influences the stack buffer size and by that may also
limit the outgoing MTU.

config BT_EATT_SEC_LEVEL
int "Enhanced ATT bearer security level"
default 1
range 1 4
help
L2CAP server required security level of EATT bearers:
Level 1 (BT_SECURITY_L1) = No encryption or authentication required
Level 2 (BT_SECURITY_L2) = Only encryption required
Level 3 (BT_SECURITY_L3) = Encryption and authentication required
Level 4 (BT_SECURITY_L4) = Secure connection required

endif # BT_EATT

config BT_GATT_SERVICE_CHANGED
bool "GATT Service Changed support"
default y
Expand All @@ -59,6 +102,16 @@ config BT_GATT_CACHING
characteristics which can be used by clients to detect if anything has
changed on the GATT database.

if BT_GATT_CACHING

config BT_GATT_NOTIFY_MULTIPLE
bool "GATT Notify Multiple Characteristic Values support"
depends on BT_GATT_CACHING
default y
help
This option enables support for the GATT Notify Multiple
Characteristic Values procedure.

config BT_GATT_ENFORCE_CHANGE_UNAWARE
bool "GATT Enforce change-unaware state"
depends on BT_GATT_CACHING
Expand All @@ -71,6 +124,8 @@ config BT_GATT_ENFORCE_CHANGE_UNAWARE
In case the service cannot deal with sudden errors (-EAGAIN) then it
shall not use this option.

endif # BT_GATT_CACHING

config BT_GATT_CLIENT
bool "GATT client support"
help
Expand Down
2 changes: 2 additions & 0 deletions subsys/bluetooth/host/Kconfig.l2cap
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ menu "L2CAP Options"
config BT_L2CAP_RX_MTU
int "Maximum supported L2CAP MTU for incoming data"
default 200 if BT_BREDR
default BT_EATT_RX_MTU if BT_EATT
default 65 if BT_SMP
default 23
range 70 1300 if BT_EATT
range 65 1300 if BT_SMP
range 23 1300
depends on BT_HCI_ACL_FLOW_CONTROL
Expand Down
Loading