You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Weird Behavior with v2.0 for the setValue() and notify() #314
Hey I'm basically just trying to set the value on a characteristic and then notify in a loop to transfer large amounts of data. In this case wifi networks. And that all worked before without issue but now in v2.0 it seems to be failing. It almost seems like it only ever calls the notify() once even though I am looping through it to transfer lots of data.
Not sure if this is intentional and I was just always calling it wrong or if there is something wrong here with the notify()
This is 1.4
/** * @brief Send a notification or indication. * @param[in] is_notification if true sends a notification, false sends an indication.*/voidNimBLECharacteristic::notify(bool is_notification) {
notify(m_value.data(), m_value.length(), is_notification);
} // notify/** * @brief Send a notification or indication. * @param[in] value A std::vector<uint8_t> containing the value to send as the notification value. * @param[in] is_notification if true sends a notification, false sends an indication.*/voidNimBLECharacteristic::notify(const std::vector<uint8_t>& value, bool is_notification) {
notify(value.data(), value.size(), is_notification);
} // notify
This is 2.2
**
* @brief Send a notification.
* @param[in] connHandle Connection handle to send an individual notification, orBLE_HS_CONN_HANDLE_NONE to send
* the notification to all subscribed clients.
* @return True if the notification was sent successfully, false otherwise.
*/boolNimBLECharacteristic::notify(uint16_t connHandle) const {
returnsendValue(nullptr, 0, true, connHandle);
} // notify/** * @brief Send a notification. * @param[in] value A pointer to the data to send. * @param[in] length The length of the data to send. * @param[in] connHandle Connection handle to send an individual notification, or BLE_HS_CONN_HANDLE_NONE to send * the notification to all subscribed clients. * @return True if the notification was sent successfully, false otherwise.*/boolNimBLECharacteristic::notify(constuint8_t* value, size_t length, uint16_t connHandle) const {
returnsendValue(value, length, true, connHandle);
} // indicate
This should work the same way, the only difference now is that the stack reads the value of the characteristic via a callback when calling notify rather than directly sending the value from the call.
There are templates in the header to handle sending vectors etc..
Weird - well I fixed the issue by directly calling them. I can try to debug more later and see why it doesn't work on the previous implementation vs the new.
Activity
michaelboeding commentedon Mar 7, 2025
Seems I got this working by calling the following
Not sure if this is intentional and I was just always calling it wrong or if there is something wrong here with the
notify()This is 1.4
This is 2.2
h2zero commentedon Mar 12, 2025
This should work the same way, the only difference now is that the stack reads the value of the characteristic via a callback when calling
notifyrather than directly sending the value from the call.There are templates in the header to handle sending vectors etc..
michaelboeding commentedon Mar 13, 2025
Weird - well I fixed the issue by directly calling them. I can try to debug more later and see why it doesn't work on the previous implementation vs the new.