Skip to content

Using NimBLERemoteCharacteristic::getValue() in callbacks for NimBLERemoteCharacteristic::subscribe() #778

@Laxilef

Description

@Laxilef

Hi,

I looked at PR #49 but couldn't figure out if I can use method NimBLERemoteCharacteristic::getValue() in callbacks?
The PR says that we should pass a timestamp to prevent re-reading, but is this relevant now?

Or can we just use such an expression now?

pChar->subscribe(true, [](NimBLERemoteCharacteristic* pChar, uint8_t* pData, size_t length, bool isNotify) {
  // ...
  auto value = pChar->getValue<short>();
  // ...
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions