diff options
author | Damien George <damien.p.george@gmail.com> | 2019-11-29 15:26:57 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2019-12-05 11:30:35 +1100 |
commit | 84958a8fe14781d5f678f2d6310cbd324779f50c (patch) | |
tree | 7e050ed07d45d305ea2e994360e62c7fd0c55319 /docs | |
parent | 7aeafe2ae9f16af74d22604b3090641a664b2da2 (diff) |
extmod/modbluetooth: Allow setting ringbuf size via BLE.config(rxbuf=).
The size of the event ringbuf was previously fixed to compile-time config
value, but it's necessary to sometimes increase this for applications that
have large characteristic buffers to read, or many events at once.
With this commit the size can be set via BLE.config(rxbuf=512), for
example. This also resizes the internal event data buffer which sets the
maximum size of incoming data passed to the event handler.
Diffstat (limited to 'docs')
-rw-r--r-- | docs/library/ubluetooth.rst | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/docs/library/ubluetooth.rst b/docs/library/ubluetooth.rst index fd4c012d2..ddcd28d9e 100644 --- a/docs/library/ubluetooth.rst +++ b/docs/library/ubluetooth.rst @@ -32,14 +32,27 @@ Configuration The radio must be made active before using any other methods on this class. -.. method:: BLE.config(name) +.. method:: BLE.config('param') + BLE.config(param=value, ...) - Queries a configuration value by *name*. Currently supported values are: + Get or set configuration values of the BLE interface. To get a value the + parameter name should be quoted as a string, and just one parameter is + queried at a time. To set values use the keyword syntax, and one ore more + parameter can be set at a time. + + Currently supported values are: - ``'mac'``: Returns the device MAC address. If a device has a fixed address (e.g. PYBD) then it will be returned. Otherwise (e.g. ESP32) a random address will be generated when the BLE interface is made active. + - ``'rxbuf'``: Set the size in bytes of the internal buffer used to store + incoming events. This buffer is global to the entire BLE driver and so + handles incoming data for all events, including all characteristics. + Increasing this allows better handling of bursty incoming data (for + example scan results) and the ability for a central role to receive + larger characteristic values. + Event Handling -------------- |