-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Write method for returning the number of bytes transferred #371
base: master
Are you sure you want to change the base?
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
e358f2d
to
ac8ab19
Compare
This comment was marked as outdated.
This comment was marked as outdated.
ac8ab19
to
c81df43
Compare
This comment was marked as outdated.
This comment was marked as outdated.
517881c
to
166debb
Compare
Memory usage change @ 166debb
Click for full report table
Click for full report CSV
|
I would like to open a discussion about changing the behaviour of the function I would also like to open the same discussion for
This will help us shrink the code size and avoid repeating the definition of functions that are performing the same operation but slightly different. |
returning the length would change how the function is working |
@pennam Then we can exclude these functions from the discussion |
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 genericBLECharacteristic
returning the number of bytes transferred.It works both when the device is in peripheral and central mode.