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

Is there a fixed length for NimbleDescriptor setValue()? #195

Open
RootDev4 opened this issue Aug 30, 2024 · 1 comment
Open

Is there a fixed length for NimbleDescriptor setValue()? #195

RootDev4 opened this issue Aug 30, 2024 · 1 comment

Comments

@RootDev4
Copy link

Hello everyone,

NimBLEDescriptor *ble_description = ble_data_characteristic->createDescriptor(NimBLEUUID((uint16_t)0x2901), NIMBLE_PROPERTY::READ); ble_description->setValue("foobar"); NimBLE2904 *ble_characteristic_descriptor = (NimBLE2904*)ble_data_characteristic->createDescriptor(NimBLEUUID((uint16_t)0x2904), NIMBLE_PROPERTY::READ); ble_characteristic_descriptor->setFormat(NimBLE2904::FORMAT_UTF8);

Setting the value to “fooba” (5 Bytes or less) or to "foobar1" (7 Bytes or more) for the descriptor results in an empty value ("No value") for 0x2904 descriptor in the LightBlue app. However, if I set it to “foobar” (6 Bytes), it works.

Maybe it's a problem with LightBlue? Or does setValue() need a length of exactly 6 bytes?
Does anyone have an idea?

@h2zero
Copy link
Owner

h2zero commented Sep 15, 2024

The 2904 value should not be set to anything other than what can be specified through the special member functions for it. Calling setValue is not supported.

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

No branches or pull requests

2 participants