Skip to content
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

Terrible handling of initLen / minLen and variable length characteristics. #56

Closed
Timmmm opened this issue Oct 30, 2015 · 2 comments
Closed

Comments

@Timmmm
Copy link
Contributor

Timmmm commented Oct 30, 2015

(This is a duplicate of ARMmbed/ble#93 as it affects both projects.)

See: https://devzone.nordicsemi.com/question/34390/no-ble_gatt_hvx_notification-under-20-bytes/?answer=55637#post-id-55637

Basically there are two problems:

  1. The GattCharacteristic initLen parameter is randomly named minLen too. If you follow the code all the way through it actually does two things - it is the initial length (not minimum), and it determines whether the characteristic is variable length or not.
  2. The characteristic for nRF51822 code is only variable length if initLen != maxLen. This is really stupid because you might want the initial length to equal the maximum length but still have variable length. It also isn't documented anywhere.

I suggest the following solution:

  1. Add extra constructors with an extra parameter: bool variableLength.
  2. Name initLen to be initLen everywhere consistently (and not minLen).
  3. Deprecate the old constructors.
@rainierwolfcastle
Copy link

ARM Internal Ref: IOTSFW-1156

@andresag01
Copy link

I believe this has been solved in 3fb32e1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants