Skip to content

Commit e83b12c

Browse files
prasad-alatkarsjanc
authored andcommitted
NimBLE host: Make LE data length set API public
* Add public API `ble_gap_set_data_len` to set data length in controller.
1 parent 904a93f commit e83b12c

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

nimble/host/include/host/ble_gap.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1801,6 +1801,22 @@ int ble_gap_wl_set(const ble_addr_t *addrs, uint8_t white_list_count);
18011801
int ble_gap_update_params(uint16_t conn_handle,
18021802
const struct ble_gap_upd_params *params);
18031803

1804+
/**
1805+
* Configure LE Data Length in controller (OGF = 0x08, OCF = 0x0022).
1806+
*
1807+
* @param conn_handle Connection handle.
1808+
* @param tx_octets The preferred value of payload octets that the Controller
1809+
* should use for a new connection (Range
1810+
* 0x001B-0x00FB).
1811+
* @param tx_time The preferred maximum number of microseconds that the local Controller
1812+
* should use to transmit a single link layer packet
1813+
* (Range 0x0148-0x4290).
1814+
*
1815+
* @return 0 on success,
1816+
* other error code on failure.
1817+
*/
1818+
int ble_gap_set_data_len(uint16_t conn_handle, uint16_t tx_octets, uint16_t tx_time);
1819+
18041820
/**
18051821
* Initiates the GAP security procedure.
18061822
*

nimble/host/src/ble_gap.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5535,6 +5535,11 @@ ble_gap_update_params(uint16_t conn_handle,
55355535
#endif
55365536
}
55375537

5538+
int ble_gap_set_data_len(uint16_t conn_handle, uint16_t tx_octets, uint16_t tx_time)
5539+
{
5540+
return ble_hs_hci_util_set_data_len(conn_handle, tx_octets, tx_time);
5541+
}
5542+
55385543
/*****************************************************************************
55395544
* $security *
55405545
*****************************************************************************/

0 commit comments

Comments
 (0)