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

Separate the concept of minlen and len in GattAttr #122

Merged
merged 1 commit into from
Nov 29, 2015
Merged

Separate the concept of minlen and len in GattAttr #122

merged 1 commit into from
Nov 29, 2015

Conversation

andresag01
Copy link

In previous versions of BLE_API the GattCharacteristic initLen parameter is named minLen as well. When the characteristic is committed to the SoftDevice the value of initial length is also used as the minimum length of the characteristic value. Furthermore, the test (max_length == min_length) is used to determine whether the characteristic value has variable length. This is slightly confusing and also causes problems if the user wishes to use a characteristic with variable length but the initial length is equal to max length.

To solve this problem the characteristic is now always committed to the SoftDevice as variable. Furthermore, the API only maintains the current length and the max length i.e. the field initialLen in the GattAttribute is removed. Finally, the constructor for the GattCharacteristic was modified to reflect these changes.

NOTES:

  • This change requires updates to ble-nrf51822.
  • Ideally we would like the characteristics to be declared as 'variable' only when necessary, but this requires changing the signature of the GattCharacteristic and GattAttribute constructures. Therefore, it will be part of a separate pull request.

In previous versions of BLE_API the GattCharacteristic initLen parameter is
named minLen as well. When the characteristic is committed to the SoftDevice
the value of initial length is also used as the minimum length of the
characteristic value. Furthermore, the test (max_length == min_length) is used
to determine whether the characteristic value has variable length. This is
slightly confusing and also causes problems if the user wishes to use a
characteristic with variable length but the initial lenght is equal to max
length.

To solve this problem the characteristic is now always committed to the
SoftDevice as variable. Furthermore, the API only maintains the current lenght
and the max length i.e. the field initialLen in the GattAttribute is removed.
Finally, the constructor for the GattCharacteristic was modified to reflect
these changes.

*NOTES:*
* This change requires updates to ble-nrf51822.
* Ideally we would like the characteristics to be declared as 'variable' only
when necessary, but this requires changing the signature of the
GattCharacteristic and GattAttribute constructures. Therefore, it will be part
of a separate pull request.
@andresag01
Copy link
Author

@rgrover

rgrover added a commit that referenced this pull request Nov 29, 2015
Separate the concept of minlen and len in GattAttr
@rgrover rgrover merged commit d45033b into ARMmbed:develop Nov 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants