Skip to content

BLECharacteristic::subscribe() fails with iTag #20

Open
@gdsports

Description

@gdsports

My BLE central iTag program based on the SensorTag example fails at the simpleKeyCharacteristic.subscribe() step. I "fixed" the problem as shown below. The characteristics properties are not available at this point but I assume the correct way to handle this is to check for BLEWrite versus BLEWriteWithoutResponse. Without this change the subscribe() blocks for a few seconds then returns an error.

int BLERemoteDescriptor::writeValue

#if 0
  uint8_t resp[4];
  int respLength = ATT.writeReq(_connectionHandle, _handle, value, length, resp);

  if (!respLength) {
    return 0;
  }

  if (resp[0] == 0x01) {
    // error
    return 0;
  }

#else
  ATT.writeCmd(_connectionHandle, _handle, value, length);
#endif

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: imperfectionPerceived defect in any part of project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions