ArduinoBLE icon indicating copy to clipboard operation
ArduinoBLE copied to clipboard

Write method for returning the number of bytes transferred

Open fabik111 opened this issue 1 year ago • 2 comments

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.

fabik111 avatar Oct 03 '24 14:10 fabik111

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/LedControl
flash
% examples/Central/LedControl
RAM for global variables
% examples/Central/PeripheralExplorer
flash
% examples/Central/PeripheralExplorer
RAM for global variables
% examples/Central/Scan
flash
% examples/Central/Scan
RAM for global variables
% examples/Central/ScanCallback
flash
% examples/Central/ScanCallback
RAM for global variables
% examples/Central/SensorTagButton
flash
% examples/Central/SensorTagButton
RAM for global variables
% examples/Peripheral/Advertising/EnhancedAdvertising
flash
% examples/Peripheral/Advertising/EnhancedAdvertising
RAM for global variables
% examples/Peripheral/Advertising/RawDataAdvertising
flash
% examples/Peripheral/Advertising/RawDataAdvertising
RAM for global variables
% examples/Peripheral/BatteryMonitor
flash
% examples/Peripheral/BatteryMonitor
RAM for global variables
% examples/Peripheral/ButtonLED
flash
% examples/Peripheral/ButtonLED
RAM for global variables
% examples/Peripheral/CallbackLED
flash
% examples/Peripheral/CallbackLED
RAM for global variables
% examples/Peripheral/EncryptedBatteryMonitor
flash
% examples/Peripheral/EncryptedBatteryMonitor
RAM for global variables
% examples/Peripheral/LED
flash
% examples/Peripheral/LED
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
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

github-actions[bot] avatar Oct 03 '24 14:10 github-actions[bot]

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/LedControl
flash
% examples/Central/LedControl
RAM for global variables
% examples/Central/PeripheralExplorer
flash
% examples/Central/PeripheralExplorer
RAM for global variables
% examples/Central/Scan
flash
% examples/Central/Scan
RAM for global variables
% examples/Central/ScanCallback
flash
% examples/Central/ScanCallback
RAM for global variables
% examples/Central/SensorTagButton
flash
% examples/Central/SensorTagButton
RAM for global variables
% examples/Peripheral/Advertising/EnhancedAdvertising
flash
% examples/Peripheral/Advertising/EnhancedAdvertising
RAM for global variables
% examples/Peripheral/Advertising/RawDataAdvertising
flash
% examples/Peripheral/Advertising/RawDataAdvertising
RAM for global variables
% examples/Peripheral/BatteryMonitor
flash
% examples/Peripheral/BatteryMonitor
RAM for global variables
% examples/Peripheral/ButtonLED
flash
% examples/Peripheral/ButtonLED
RAM for global variables
% examples/Peripheral/CallbackLED
flash
% examples/Peripheral/CallbackLED
RAM for global variables
% examples/Peripheral/EncryptedBatteryMonitor
flash
% examples/Peripheral/EncryptedBatteryMonitor
RAM for global variables
% examples/Peripheral/LED
flash
% examples/Peripheral/LED
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
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

github-actions[bot] avatar Oct 25 '24 12:10 github-actions[bot]

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/LedControl
flash
% examples/Central/LedControl
RAM for global variables
% examples/Central/PeripheralExplorer
flash
% examples/Central/PeripheralExplorer
RAM for global variables
% examples/Central/Scan
flash
% examples/Central/Scan
RAM for global variables
% examples/Central/ScanCallback
flash
% examples/Central/ScanCallback
RAM for global variables
% examples/Central/SensorTagButton
flash
% examples/Central/SensorTagButton
RAM for global variables
% examples/Peripheral/Advertising/EnhancedAdvertising
flash
% examples/Peripheral/Advertising/EnhancedAdvertising
RAM for global variables
% examples/Peripheral/Advertising/RawDataAdvertising
flash
% examples/Peripheral/Advertising/RawDataAdvertising
RAM for global variables
% examples/Peripheral/BatteryMonitor
flash
% examples/Peripheral/BatteryMonitor
RAM for global variables
% examples/Peripheral/ButtonLED
flash
% examples/Peripheral/ButtonLED
RAM for global variables
% examples/Peripheral/CallbackLED
flash
% examples/Peripheral/CallbackLED
RAM for global variables
% examples/Peripheral/EncryptedBatteryMonitor
flash
% examples/Peripheral/EncryptedBatteryMonitor
RAM for global variables
% examples/Peripheral/LED
flash
% examples/Peripheral/LED
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
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

github-actions[bot] avatar Mar 10 '25 14:03 github-actions[bot]

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/LedControl
flash
% examples/Central/LedControl
RAM for global variables
% examples/Central/PeripheralExplorer
flash
% examples/Central/PeripheralExplorer
RAM for global variables
% examples/Central/Scan
flash
% examples/Central/Scan
RAM for global variables
% examples/Central/ScanCallback
flash
% examples/Central/ScanCallback
RAM for global variables
% examples/Central/SensorTagButton
flash
% examples/Central/SensorTagButton
RAM for global variables
% examples/Peripheral/Advertising/EnhancedAdvertising
flash
% examples/Peripheral/Advertising/EnhancedAdvertising
RAM for global variables
% examples/Peripheral/Advertising/RawDataAdvertising
flash
% examples/Peripheral/Advertising/RawDataAdvertising
RAM for global variables
% examples/Peripheral/BatteryMonitor
flash
% examples/Peripheral/BatteryMonitor
RAM for global variables
% examples/Peripheral/ButtonLED
flash
% examples/Peripheral/ButtonLED
RAM for global variables
% examples/Peripheral/CallbackLED
flash
% examples/Peripheral/CallbackLED
RAM for global variables
% examples/Peripheral/EncryptedBatteryMonitor
flash
% examples/Peripheral/EncryptedBatteryMonitor
RAM for global variables
% examples/Peripheral/LED
flash
% examples/Peripheral/LED
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
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

github-actions[bot] avatar Mar 20 '25 13:03 github-actions[bot]

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.

andreagilardoni avatar Mar 26 '25 12:03 andreagilardoni

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 avatar Mar 27 '25 08:03 pennam

@pennam Then we can exclude these functions from the discussion

andreagilardoni avatar Mar 27 '25 09:03 andreagilardoni

superseded by #392

pennam avatar Apr 11 '25 08:04 pennam