Write method for returning the number of bytes transferred
The current writeValue method, used for writing the value of a characteristic, returns an integer value.
This value is used as a Boolean to indicate the success or the failure of the writing operation, without giving any indication about the amount of bytes actually transferred (in case of subscription) or "loaded" into the characteristic (in case of a readable characteristic).
Considering that the MTU, the amount of transferable data, is decided by the central and varies device by device, it is impossible for the user to determinate how many bytes are transferred and upon that to take an action.
In this PR a write method is added for the generic BLECharacteristic returning the number of bytes transferred.
It works both when the device is in peripheral and central mode.
Memory usage change @ e358f2d4ed9baaf13d032c11cb9ab17ed7392280
| Board | flash | % | RAM for global variables | % |
|---|---|---|---|---|
arduino:mbed_nano:nano33ble |
:small_red_triangle: 0 - +64 | 0.0 - +0.01 | 0 - 0 | 0.0 - 0.0 |
arduino:mbed_nano:nanorp2040connect |
:small_red_triangle: +8 - +8 | 0.0 - 0.0 | 0 - 0 | 0.0 - 0.0 |
arduino:megaavr:uno2018:mode=on |
:small_red_triangle: +52 - +52 | +0.11 - +0.11 | 0 - 0 | 0.0 - 0.0 |
arduino:renesas_uno:unor4wifi |
:small_red_triangle: +16 - +32 | +0.01 - +0.01 | 0 - 0 | 0.0 - 0.0 |
arduino:samd:mkrwifi1010 |
:small_red_triangle: +8 - +8 | 0.0 - 0.0 | 0 - 0 | 0.0 - 0.0 |
arduino:samd:nano_33_iot |
:small_red_triangle: +8 - +8 | 0.0 - 0.0 | 0 - 0 | 0.0 - 0.0 |
Click for full report table
| Board | examples/Central/LedControlflash |
% | examples/Central/LedControlRAM for global variables |
% | examples/Central/PeripheralExplorerflash |
% | examples/Central/PeripheralExplorerRAM for global variables |
% | examples/Central/Scanflash |
% | examples/Central/ScanRAM for global variables |
% | examples/Central/ScanCallbackflash |
% | examples/Central/ScanCallbackRAM for global variables |
% | examples/Central/SensorTagButtonflash |
% | examples/Central/SensorTagButtonRAM for global variables |
% | examples/Peripheral/Advertising/EnhancedAdvertisingflash |
% | examples/Peripheral/Advertising/EnhancedAdvertisingRAM for global variables |
% | examples/Peripheral/Advertising/RawDataAdvertisingflash |
% | examples/Peripheral/Advertising/RawDataAdvertisingRAM for global variables |
% | examples/Peripheral/BatteryMonitorflash |
% | examples/Peripheral/BatteryMonitorRAM for global variables |
% | examples/Peripheral/ButtonLEDflash |
% | examples/Peripheral/ButtonLEDRAM for global variables |
% | examples/Peripheral/CallbackLEDflash |
% | examples/Peripheral/CallbackLEDRAM for global variables |
% | examples/Peripheral/EncryptedBatteryMonitorflash |
% | examples/Peripheral/EncryptedBatteryMonitorRAM for global variables |
% | examples/Peripheral/LEDflash |
% | examples/Peripheral/LEDRAM for global variables |
% |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
arduino:mbed_nano:nano33ble |
0 | 0.0 | 0 | 0.0 | 64 | 0.01 | 0 | 0.0 | 64 | 0.01 | 0 | 0.0 | 64 | 0.01 | 0 | 0.0 | 64 | 0.01 | 0 | 0.0 | 64 | 0.01 | 0 | 0.0 | 0 | 0.0 | 0 | 0.0 | 64 | 0.01 | 0 | 0.0 | 64 | 0.01 | 0 | 0.0 | 64 | 0.01 | 0 | 0.0 | 0 | 0.0 | 0 | 0.0 | 64 | 0.01 | 0 | 0.0 |
arduino:mbed_nano:nanorp2040connect |
8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 |
arduino:megaavr:uno2018:mode=on |
52 | 0.11 | 0 | 0.0 | 52 | 0.11 | 0 | 0.0 | 52 | 0.11 | 0 | 0.0 | 52 | 0.11 | 0 | 0.0 | 52 | 0.11 | 0 | 0.0 | 52 | 0.11 | 0 | 0.0 | 52 | 0.11 | 0 | 0.0 | 52 | 0.11 | 0 | 0.0 | 52 | 0.11 | 0 | 0.0 | 52 | 0.11 | 0 | 0.0 | 52 | 0.11 | 0 | 0.0 | 52 | 0.11 | 0 | 0.0 |
arduino:renesas_uno:unor4wifi |
32 | 0.01 | 0 | 0.0 | 16 | 0.01 | 0 | 0.0 | 16 | 0.01 | 0 | 0.0 | 16 | 0.01 | 0 | 0.0 | 32 | 0.01 | 0 | 0.0 | 16 | 0.01 | 0 | 0.0 | 16 | 0.01 | 0 | 0.0 | 16 | 0.01 | 0 | 0.0 | 32 | 0.01 | 0 | 0.0 | 16 | 0.01 | 0 | 0.0 | 16 | 0.01 | 0 | 0.0 | 32 | 0.01 | 0 | 0.0 |
arduino:samd:mkrwifi1010 |
8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 |
arduino:samd:nano_33_iot |
8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 |
Click for full report CSV
Board,examples/Central/LedControl<br>flash,%,examples/Central/LedControl<br>RAM for global variables,%,examples/Central/PeripheralExplorer<br>flash,%,examples/Central/PeripheralExplorer<br>RAM for global variables,%,examples/Central/Scan<br>flash,%,examples/Central/Scan<br>RAM for global variables,%,examples/Central/ScanCallback<br>flash,%,examples/Central/ScanCallback<br>RAM for global variables,%,examples/Central/SensorTagButton<br>flash,%,examples/Central/SensorTagButton<br>RAM for global variables,%,examples/Peripheral/Advertising/EnhancedAdvertising<br>flash,%,examples/Peripheral/Advertising/EnhancedAdvertising<br>RAM for global variables,%,examples/Peripheral/Advertising/RawDataAdvertising<br>flash,%,examples/Peripheral/Advertising/RawDataAdvertising<br>RAM for global variables,%,examples/Peripheral/BatteryMonitor<br>flash,%,examples/Peripheral/BatteryMonitor<br>RAM for global variables,%,examples/Peripheral/ButtonLED<br>flash,%,examples/Peripheral/ButtonLED<br>RAM for global variables,%,examples/Peripheral/CallbackLED<br>flash,%,examples/Peripheral/CallbackLED<br>RAM for global variables,%,examples/Peripheral/EncryptedBatteryMonitor<br>flash,%,examples/Peripheral/EncryptedBatteryMonitor<br>RAM for global variables,%,examples/Peripheral/LED<br>flash,%,examples/Peripheral/LED<br>RAM for global variables,%
arduino:mbed_nano:nano33ble,0,0.0,0,0.0,64,0.01,0,0.0,64,0.01,0,0.0,64,0.01,0,0.0,64,0.01,0,0.0,64,0.01,0,0.0,0,0.0,0,0.0,64,0.01,0,0.0,64,0.01,0,0.0,64,0.01,0,0.0,0,0.0,0,0.0,64,0.01,0,0.0
arduino:mbed_nano:nanorp2040connect,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0
arduino:megaavr:uno2018:mode=on,52,0.11,0,0.0,52,0.11,0,0.0,52,0.11,0,0.0,52,0.11,0,0.0,52,0.11,0,0.0,52,0.11,0,0.0,52,0.11,0,0.0,52,0.11,0,0.0,52,0.11,0,0.0,52,0.11,0,0.0,52,0.11,0,0.0,52,0.11,0,0.0
arduino:renesas_uno:unor4wifi,32,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,32,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,32,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,32,0.01,0,0.0
arduino:samd:mkrwifi1010,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0
arduino:samd:nano_33_iot,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0
Memory usage change @ ac8ab197cd183b7ddbd2a3eb35ac210a10bbaa51
| Board | flash | % | RAM for global variables | % |
|---|---|---|---|---|
arduino:mbed_nano:nano33ble |
:small_red_triangle: 0 - +64 | 0.0 - +0.01 | 0 - 0 | 0.0 - 0.0 |
arduino:mbed_nano:nanorp2040connect |
:small_red_triangle: +8 - +8 | 0.0 - 0.0 | 0 - 0 | 0.0 - 0.0 |
arduino:megaavr:uno2018:mode=on |
:small_red_triangle: +52 - +52 | +0.11 - +0.11 | 0 - 0 | 0.0 - 0.0 |
arduino:renesas_uno:unor4wifi |
:small_red_triangle: +16 - +32 | +0.01 - +0.01 | 0 - 0 | 0.0 - 0.0 |
arduino:samd:mkrwifi1010 |
:small_red_triangle: +8 - +8 | 0.0 - 0.0 | 0 - 0 | 0.0 - 0.0 |
arduino:samd:nano_33_iot |
:small_red_triangle: +8 - +8 | 0.0 - 0.0 | 0 - 0 | 0.0 - 0.0 |
Click for full report table
| Board | examples/Central/LedControlflash |
% | examples/Central/LedControlRAM for global variables |
% | examples/Central/PeripheralExplorerflash |
% | examples/Central/PeripheralExplorerRAM for global variables |
% | examples/Central/Scanflash |
% | examples/Central/ScanRAM for global variables |
% | examples/Central/ScanCallbackflash |
% | examples/Central/ScanCallbackRAM for global variables |
% | examples/Central/SensorTagButtonflash |
% | examples/Central/SensorTagButtonRAM for global variables |
% | examples/Peripheral/Advertising/EnhancedAdvertisingflash |
% | examples/Peripheral/Advertising/EnhancedAdvertisingRAM for global variables |
% | examples/Peripheral/Advertising/RawDataAdvertisingflash |
% | examples/Peripheral/Advertising/RawDataAdvertisingRAM for global variables |
% | examples/Peripheral/BatteryMonitorflash |
% | examples/Peripheral/BatteryMonitorRAM for global variables |
% | examples/Peripheral/ButtonLEDflash |
% | examples/Peripheral/ButtonLEDRAM for global variables |
% | examples/Peripheral/CallbackLEDflash |
% | examples/Peripheral/CallbackLEDRAM for global variables |
% | examples/Peripheral/EncryptedBatteryMonitorflash |
% | examples/Peripheral/EncryptedBatteryMonitorRAM for global variables |
% | examples/Peripheral/LEDflash |
% | examples/Peripheral/LEDRAM for global variables |
% |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
arduino:mbed_nano:nano33ble |
0 | 0.0 | 0 | 0.0 | 64 | 0.01 | 0 | 0.0 | 64 | 0.01 | 0 | 0.0 | 64 | 0.01 | 0 | 0.0 | 64 | 0.01 | 0 | 0.0 | 0 | 0.0 | 0 | 0.0 | 64 | 0.01 | 0 | 0.0 | 0 | 0.0 | 0 | 0.0 | 0 | 0.0 | 0 | 0.0 | 64 | 0.01 | 0 | 0.0 | 64 | 0.01 | 0 | 0.0 | 64 | 0.01 | 0 | 0.0 |
arduino:mbed_nano:nanorp2040connect |
8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 |
arduino:megaavr:uno2018:mode=on |
52 | 0.11 | 0 | 0.0 | 52 | 0.11 | 0 | 0.0 | 52 | 0.11 | 0 | 0.0 | 52 | 0.11 | 0 | 0.0 | 52 | 0.11 | 0 | 0.0 | 52 | 0.11 | 0 | 0.0 | 52 | 0.11 | 0 | 0.0 | 52 | 0.11 | 0 | 0.0 | 52 | 0.11 | 0 | 0.0 | 52 | 0.11 | 0 | 0.0 | 52 | 0.11 | 0 | 0.0 | 52 | 0.11 | 0 | 0.0 |
arduino:renesas_uno:unor4wifi |
32 | 0.01 | 0 | 0.0 | 16 | 0.01 | 0 | 0.0 | 16 | 0.01 | 0 | 0.0 | 16 | 0.01 | 0 | 0.0 | 32 | 0.01 | 0 | 0.0 | 32 | 0.01 | 0 | 0.0 | 16 | 0.01 | 0 | 0.0 | 16 | 0.01 | 0 | 0.0 | 32 | 0.01 | 0 | 0.0 | 16 | 0.01 | 0 | 0.0 | 16 | 0.01 | 0 | 0.0 | 32 | 0.01 | 0 | 0.0 |
arduino:samd:mkrwifi1010 |
8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 |
arduino:samd:nano_33_iot |
8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 |
Click for full report CSV
Board,examples/Central/LedControl<br>flash,%,examples/Central/LedControl<br>RAM for global variables,%,examples/Central/PeripheralExplorer<br>flash,%,examples/Central/PeripheralExplorer<br>RAM for global variables,%,examples/Central/Scan<br>flash,%,examples/Central/Scan<br>RAM for global variables,%,examples/Central/ScanCallback<br>flash,%,examples/Central/ScanCallback<br>RAM for global variables,%,examples/Central/SensorTagButton<br>flash,%,examples/Central/SensorTagButton<br>RAM for global variables,%,examples/Peripheral/Advertising/EnhancedAdvertising<br>flash,%,examples/Peripheral/Advertising/EnhancedAdvertising<br>RAM for global variables,%,examples/Peripheral/Advertising/RawDataAdvertising<br>flash,%,examples/Peripheral/Advertising/RawDataAdvertising<br>RAM for global variables,%,examples/Peripheral/BatteryMonitor<br>flash,%,examples/Peripheral/BatteryMonitor<br>RAM for global variables,%,examples/Peripheral/ButtonLED<br>flash,%,examples/Peripheral/ButtonLED<br>RAM for global variables,%,examples/Peripheral/CallbackLED<br>flash,%,examples/Peripheral/CallbackLED<br>RAM for global variables,%,examples/Peripheral/EncryptedBatteryMonitor<br>flash,%,examples/Peripheral/EncryptedBatteryMonitor<br>RAM for global variables,%,examples/Peripheral/LED<br>flash,%,examples/Peripheral/LED<br>RAM for global variables,%
arduino:mbed_nano:nano33ble,0,0.0,0,0.0,64,0.01,0,0.0,64,0.01,0,0.0,64,0.01,0,0.0,64,0.01,0,0.0,0,0.0,0,0.0,64,0.01,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,64,0.01,0,0.0,64,0.01,0,0.0,64,0.01,0,0.0
arduino:mbed_nano:nanorp2040connect,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0
arduino:megaavr:uno2018:mode=on,52,0.11,0,0.0,52,0.11,0,0.0,52,0.11,0,0.0,52,0.11,0,0.0,52,0.11,0,0.0,52,0.11,0,0.0,52,0.11,0,0.0,52,0.11,0,0.0,52,0.11,0,0.0,52,0.11,0,0.0,52,0.11,0,0.0,52,0.11,0,0.0
arduino:renesas_uno:unor4wifi,32,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,32,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,32,0.01,0,0.0
arduino:samd:mkrwifi1010,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0
arduino:samd:nano_33_iot,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0
Memory usage change @ c81df43fceaf4c8d23f4ff3f96a63648d482a05e
| Board | flash | % | RAM for global variables | % |
|---|---|---|---|---|
arduino:mbed_nano:nano33ble |
:small_red_triangle: 0 - +64 | 0.0 - +0.01 | 0 - 0 | 0.0 - 0.0 |
arduino:mbed_nano:nanorp2040connect |
:small_red_triangle: +8 - +8 | 0.0 - 0.0 | 0 - 0 | 0.0 - 0.0 |
arduino:megaavr:uno2018:mode=on |
:small_red_triangle: +52 - +52 | +0.11 - +0.11 | 0 - 0 | 0.0 - 0.0 |
arduino:renesas_uno:unor4wifi |
:small_red_triangle: +16 - +32 | +0.01 - +0.01 | 0 - 0 | 0.0 - 0.0 |
arduino:samd:mkrwifi1010 |
:small_red_triangle: +8 - +8 | 0.0 - 0.0 | 0 - 0 | 0.0 - 0.0 |
arduino:samd:nano_33_iot |
:small_red_triangle: +8 - +8 | 0.0 - 0.0 | 0 - 0 | 0.0 - 0.0 |
Click for full report table
| Board | examples/Central/LedControlflash |
% | examples/Central/LedControlRAM for global variables |
% | examples/Central/PeripheralExplorerflash |
% | examples/Central/PeripheralExplorerRAM for global variables |
% | examples/Central/Scanflash |
% | examples/Central/ScanRAM for global variables |
% | examples/Central/ScanCallbackflash |
% | examples/Central/ScanCallbackRAM for global variables |
% | examples/Central/SensorTagButtonflash |
% | examples/Central/SensorTagButtonRAM for global variables |
% | examples/Peripheral/Advertising/EnhancedAdvertisingflash |
% | examples/Peripheral/Advertising/EnhancedAdvertisingRAM for global variables |
% | examples/Peripheral/Advertising/RawDataAdvertisingflash |
% | examples/Peripheral/Advertising/RawDataAdvertisingRAM for global variables |
% | examples/Peripheral/BatteryMonitorflash |
% | examples/Peripheral/BatteryMonitorRAM for global variables |
% | examples/Peripheral/ButtonLEDflash |
% | examples/Peripheral/ButtonLEDRAM for global variables |
% | examples/Peripheral/CallbackLEDflash |
% | examples/Peripheral/CallbackLEDRAM for global variables |
% | examples/Peripheral/EncryptedBatteryMonitorflash |
% | examples/Peripheral/EncryptedBatteryMonitorRAM for global variables |
% | examples/Peripheral/LEDflash |
% | examples/Peripheral/LEDRAM for global variables |
% |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
arduino:mbed_nano:nano33ble |
0 | 0.0 | 0 | 0.0 | 64 | 0.01 | 0 | 0.0 | 64 | 0.01 | 0 | 0.0 | 64 | 0.01 | 0 | 0.0 | 64 | 0.01 | 0 | 0.0 | 0 | 0.0 | 0 | 0.0 | 64 | 0.01 | 0 | 0.0 | 0 | 0.0 | 0 | 0.0 | 0 | 0.0 | 0 | 0.0 | 64 | 0.01 | 0 | 0.0 | 64 | 0.01 | 0 | 0.0 | 64 | 0.01 | 0 | 0.0 |
arduino:mbed_nano:nanorp2040connect |
8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 |
arduino:megaavr:uno2018:mode=on |
52 | 0.11 | 0 | 0.0 | 52 | 0.11 | 0 | 0.0 | 52 | 0.11 | 0 | 0.0 | 52 | 0.11 | 0 | 0.0 | 52 | 0.11 | 0 | 0.0 | 52 | 0.11 | 0 | 0.0 | 52 | 0.11 | 0 | 0.0 | 52 | 0.11 | 0 | 0.0 | 52 | 0.11 | 0 | 0.0 | 52 | 0.11 | 0 | 0.0 | 52 | 0.11 | 0 | 0.0 | 52 | 0.11 | 0 | 0.0 |
arduino:renesas_uno:unor4wifi |
32 | 0.01 | 0 | 0.0 | 16 | 0.01 | 0 | 0.0 | 16 | 0.01 | 0 | 0.0 | 16 | 0.01 | 0 | 0.0 | 32 | 0.01 | 0 | 0.0 | 32 | 0.01 | 0 | 0.0 | 16 | 0.01 | 0 | 0.0 | 16 | 0.01 | 0 | 0.0 | 32 | 0.01 | 0 | 0.0 | 16 | 0.01 | 0 | 0.0 | 16 | 0.01 | 0 | 0.0 | 32 | 0.01 | 0 | 0.0 |
arduino:samd:mkrwifi1010 |
8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 |
arduino:samd:nano_33_iot |
8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 | 8 | 0.0 | 0 | 0.0 |
Click for full report CSV
Board,examples/Central/LedControl<br>flash,%,examples/Central/LedControl<br>RAM for global variables,%,examples/Central/PeripheralExplorer<br>flash,%,examples/Central/PeripheralExplorer<br>RAM for global variables,%,examples/Central/Scan<br>flash,%,examples/Central/Scan<br>RAM for global variables,%,examples/Central/ScanCallback<br>flash,%,examples/Central/ScanCallback<br>RAM for global variables,%,examples/Central/SensorTagButton<br>flash,%,examples/Central/SensorTagButton<br>RAM for global variables,%,examples/Peripheral/Advertising/EnhancedAdvertising<br>flash,%,examples/Peripheral/Advertising/EnhancedAdvertising<br>RAM for global variables,%,examples/Peripheral/Advertising/RawDataAdvertising<br>flash,%,examples/Peripheral/Advertising/RawDataAdvertising<br>RAM for global variables,%,examples/Peripheral/BatteryMonitor<br>flash,%,examples/Peripheral/BatteryMonitor<br>RAM for global variables,%,examples/Peripheral/ButtonLED<br>flash,%,examples/Peripheral/ButtonLED<br>RAM for global variables,%,examples/Peripheral/CallbackLED<br>flash,%,examples/Peripheral/CallbackLED<br>RAM for global variables,%,examples/Peripheral/EncryptedBatteryMonitor<br>flash,%,examples/Peripheral/EncryptedBatteryMonitor<br>RAM for global variables,%,examples/Peripheral/LED<br>flash,%,examples/Peripheral/LED<br>RAM for global variables,%
arduino:mbed_nano:nano33ble,0,0.0,0,0.0,64,0.01,0,0.0,64,0.01,0,0.0,64,0.01,0,0.0,64,0.01,0,0.0,0,0.0,0,0.0,64,0.01,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,64,0.01,0,0.0,64,0.01,0,0.0,64,0.01,0,0.0
arduino:mbed_nano:nanorp2040connect,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0
arduino:megaavr:uno2018:mode=on,52,0.11,0,0.0,52,0.11,0,0.0,52,0.11,0,0.0,52,0.11,0,0.0,52,0.11,0,0.0,52,0.11,0,0.0,52,0.11,0,0.0,52,0.11,0,0.0,52,0.11,0,0.0,52,0.11,0,0.0,52,0.11,0,0.0,52,0.11,0,0.0
arduino:renesas_uno:unor4wifi,32,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,32,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,32,0.01,0,0.0
arduino:samd:mkrwifi1010,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0
arduino:samd:nano_33_iot,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0
Memory usage change @ 166debb0e59f46369049b738e6f004883e908bb2
| Board | flash | % | RAM for global variables | % |
|---|---|---|---|---|
arduino:mbed_nano:nano33ble |
:small_red_triangle: +72 - +136 | +0.01 - +0.01 | 0 - 0 | 0.0 - 0.0 |
arduino:mbed_nano:nanorp2040connect |
:small_red_triangle: +46 - +46 | 0.0 - 0.0 | 0 - 0 | 0.0 - 0.0 |
arduino:megaavr:uno2018:mode=on |
:small_red_triangle: +140 - +140 | +0.29 - +0.29 | 0 - 0 | 0.0 - 0.0 |
arduino:renesas_uno:unor4wifi |
:small_red_triangle: +72 - +88 | +0.03 - +0.03 | 0 - 0 | 0.0 - 0.0 |
arduino:samd:mkrwifi1010 |
:small_red_triangle: +48 - +48 | +0.02 - +0.02 | 0 - 0 | 0.0 - 0.0 |
arduino:samd:nano_33_iot |
:small_red_triangle: +48 - +48 | +0.02 - +0.02 | 0 - 0 | 0.0 - 0.0 |
Click for full report table
| Board | examples/Central/LedControlflash |
% | examples/Central/LedControlRAM for global variables |
% | examples/Central/PeripheralExplorerflash |
% | examples/Central/PeripheralExplorerRAM for global variables |
% | examples/Central/Scanflash |
% | examples/Central/ScanRAM for global variables |
% | examples/Central/ScanCallbackflash |
% | examples/Central/ScanCallbackRAM for global variables |
% | examples/Central/SensorTagButtonflash |
% | examples/Central/SensorTagButtonRAM for global variables |
% | examples/Peripheral/Advertising/EnhancedAdvertisingflash |
% | examples/Peripheral/Advertising/EnhancedAdvertisingRAM for global variables |
% | examples/Peripheral/Advertising/RawDataAdvertisingflash |
% | examples/Peripheral/Advertising/RawDataAdvertisingRAM for global variables |
% | examples/Peripheral/BatteryMonitorflash |
% | examples/Peripheral/BatteryMonitorRAM for global variables |
% | examples/Peripheral/ButtonLEDflash |
% | examples/Peripheral/ButtonLEDRAM for global variables |
% | examples/Peripheral/CallbackLEDflash |
% | examples/Peripheral/CallbackLEDRAM for global variables |
% | examples/Peripheral/EncryptedBatteryMonitorflash |
% | examples/Peripheral/EncryptedBatteryMonitorRAM for global variables |
% | examples/Peripheral/LEDflash |
% | examples/Peripheral/LEDRAM for global variables |
% |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
arduino:mbed_nano:nano33ble |
72 | 0.01 | 0 | 0.0 | 72 | 0.01 | 0 | 0.0 | 72 | 0.01 | 0 | 0.0 | 72 | 0.01 | 0 | 0.0 | 72 | 0.01 | 0 | 0.0 | 72 | 0.01 | 0 | 0.0 | 136 | 0.01 | 0 | 0.0 | 72 | 0.01 | 0 | 0.0 | 72 | 0.01 | 0 | 0.0 | 72 | 0.01 | 0 | 0.0 | 72 | 0.01 | 0 | 0.0 | 72 | 0.01 | 0 | 0.0 |
arduino:mbed_nano:nanorp2040connect |
46 | 0.0 | 0 | 0.0 | 46 | 0.0 | 0 | 0.0 | 46 | 0.0 | 0 | 0.0 | 46 | 0.0 | 0 | 0.0 | 46 | 0.0 | 0 | 0.0 | 46 | 0.0 | 0 | 0.0 | 46 | 0.0 | 0 | 0.0 | 46 | 0.0 | 0 | 0.0 | 46 | 0.0 | 0 | 0.0 | 46 | 0.0 | 0 | 0.0 | 46 | 0.0 | 0 | 0.0 | 46 | 0.0 | 0 | 0.0 |
arduino:megaavr:uno2018:mode=on |
140 | 0.29 | 0 | 0.0 | 140 | 0.29 | 0 | 0.0 | 140 | 0.29 | 0 | 0.0 | 140 | 0.29 | 0 | 0.0 | 140 | 0.29 | 0 | 0.0 | 140 | 0.29 | 0 | 0.0 | 140 | 0.29 | 0 | 0.0 | 140 | 0.29 | 0 | 0.0 | 140 | 0.29 | 0 | 0.0 | 140 | 0.29 | 0 | 0.0 | 140 | 0.29 | 0 | 0.0 | 140 | 0.29 | 0 | 0.0 |
arduino:renesas_uno:unor4wifi |
88 | 0.03 | 0 | 0.0 | 72 | 0.03 | 0 | 0.0 | 72 | 0.03 | 0 | 0.0 | 72 | 0.03 | 0 | 0.0 | 88 | 0.03 | 0 | 0.0 | 88 | 0.03 | 0 | 0.0 | 72 | 0.03 | 0 | 0.0 | 72 | 0.03 | 0 | 0.0 | 88 | 0.03 | 0 | 0.0 | 72 | 0.03 | 0 | 0.0 | 72 | 0.03 | 0 | 0.0 | 88 | 0.03 | 0 | 0.0 |
arduino:samd:mkrwifi1010 |
48 | 0.02 | 0 | 0.0 | 48 | 0.02 | 0 | 0.0 | 48 | 0.02 | 0 | 0.0 | 48 | 0.02 | 0 | 0.0 | 48 | 0.02 | 0 | 0.0 | 48 | 0.02 | 0 | 0.0 | 48 | 0.02 | 0 | 0.0 | 48 | 0.02 | 0 | 0.0 | 48 | 0.02 | 0 | 0.0 | 48 | 0.02 | 0 | 0.0 | 48 | 0.02 | 0 | 0.0 | 48 | 0.02 | 0 | 0.0 |
arduino:samd:nano_33_iot |
48 | 0.02 | 0 | 0.0 | 48 | 0.02 | 0 | 0.0 | 48 | 0.02 | 0 | 0.0 | 48 | 0.02 | 0 | 0.0 | 48 | 0.02 | 0 | 0.0 | 48 | 0.02 | 0 | 0.0 | 48 | 0.02 | 0 | 0.0 | 48 | 0.02 | 0 | 0.0 | 48 | 0.02 | 0 | 0.0 | 48 | 0.02 | 0 | 0.0 | 48 | 0.02 | 0 | 0.0 | 48 | 0.02 | 0 | 0.0 |
Click for full report CSV
Board,examples/Central/LedControl<br>flash,%,examples/Central/LedControl<br>RAM for global variables,%,examples/Central/PeripheralExplorer<br>flash,%,examples/Central/PeripheralExplorer<br>RAM for global variables,%,examples/Central/Scan<br>flash,%,examples/Central/Scan<br>RAM for global variables,%,examples/Central/ScanCallback<br>flash,%,examples/Central/ScanCallback<br>RAM for global variables,%,examples/Central/SensorTagButton<br>flash,%,examples/Central/SensorTagButton<br>RAM for global variables,%,examples/Peripheral/Advertising/EnhancedAdvertising<br>flash,%,examples/Peripheral/Advertising/EnhancedAdvertising<br>RAM for global variables,%,examples/Peripheral/Advertising/RawDataAdvertising<br>flash,%,examples/Peripheral/Advertising/RawDataAdvertising<br>RAM for global variables,%,examples/Peripheral/BatteryMonitor<br>flash,%,examples/Peripheral/BatteryMonitor<br>RAM for global variables,%,examples/Peripheral/ButtonLED<br>flash,%,examples/Peripheral/ButtonLED<br>RAM for global variables,%,examples/Peripheral/CallbackLED<br>flash,%,examples/Peripheral/CallbackLED<br>RAM for global variables,%,examples/Peripheral/EncryptedBatteryMonitor<br>flash,%,examples/Peripheral/EncryptedBatteryMonitor<br>RAM for global variables,%,examples/Peripheral/LED<br>flash,%,examples/Peripheral/LED<br>RAM for global variables,%
arduino:mbed_nano:nano33ble,72,0.01,0,0.0,72,0.01,0,0.0,72,0.01,0,0.0,72,0.01,0,0.0,72,0.01,0,0.0,72,0.01,0,0.0,136,0.01,0,0.0,72,0.01,0,0.0,72,0.01,0,0.0,72,0.01,0,0.0,72,0.01,0,0.0,72,0.01,0,0.0
arduino:mbed_nano:nanorp2040connect,46,0.0,0,0.0,46,0.0,0,0.0,46,0.0,0,0.0,46,0.0,0,0.0,46,0.0,0,0.0,46,0.0,0,0.0,46,0.0,0,0.0,46,0.0,0,0.0,46,0.0,0,0.0,46,0.0,0,0.0,46,0.0,0,0.0,46,0.0,0,0.0
arduino:megaavr:uno2018:mode=on,140,0.29,0,0.0,140,0.29,0,0.0,140,0.29,0,0.0,140,0.29,0,0.0,140,0.29,0,0.0,140,0.29,0,0.0,140,0.29,0,0.0,140,0.29,0,0.0,140,0.29,0,0.0,140,0.29,0,0.0,140,0.29,0,0.0,140,0.29,0,0.0
arduino:renesas_uno:unor4wifi,88,0.03,0,0.0,72,0.03,0,0.0,72,0.03,0,0.0,72,0.03,0,0.0,88,0.03,0,0.0,88,0.03,0,0.0,72,0.03,0,0.0,72,0.03,0,0.0,88,0.03,0,0.0,72,0.03,0,0.0,72,0.03,0,0.0,88,0.03,0,0.0
arduino:samd:mkrwifi1010,48,0.02,0,0.0,48,0.02,0,0.0,48,0.02,0,0.0,48,0.02,0,0.0,48,0.02,0,0.0,48,0.02,0,0.0,48,0.02,0,0.0,48,0.02,0,0.0,48,0.02,0,0.0,48,0.02,0,0.0,48,0.02,0,0.0,48,0.02,0,0.0
arduino:samd:nano_33_iot,48,0.02,0,0.0,48,0.02,0,0.0,48,0.02,0,0.0,48,0.02,0,0.0,48,0.02,0,0.0,48,0.02,0,0.0,48,0.02,0,0.0,48,0.02,0,0.0,48,0.02,0,0.0,48,0.02,0,0.0,48,0.02,0,0.0,48,0.02,0,0.0
I would like to open a discussion about changing the behaviour of the function writeValue instead of writing a new one I would still use the same and return the length instead of 1 or 0.
The reason is if there is an error we can return 0 and there is no breaking change in that, if there is no error we return the length which can be evaluated to true in a boolean expression. The only case where this could not work is if someone is directly comparing the result of write with 1, in which the expected behaviour is not preserved.
I would also like to open the same discussion for handleInd and handleInd which can be changed to the definition I put below. The behaviour is changed in the sense that the length is returned (which cannot be higher than a 16 bit, if I recall correctly). For the same reasons I described above I don't see a reason why this cannot work in the same way.
virtual bool handleNotify(uint16_t handle, const uint8_t* value, int length);
virtual bool handleInd(uint16_t handle, const uint8_t* value, int length);
virtual uint16_t handleNotify(uint16_t handle, const uint8_t* value, uint16_t length);
virtual uint16_t handleInd(uint16_t handle, const uint8_t* value, uint16_t length);
This will help us shrink the code size and avoid repeating the definition of functions that are performing the same operation but slightly different.
handleNotify and handleInd are returning a bool value that is not strictly related to the length, respectively
return (numNotifications > 0); and return (numIndications > 0);
returning the length would change how the function is working
@pennam Then we can exclude these functions from the discussion
superseded by #392