Skip to content

Commit

Permalink
Minor bugfix from ByteArray updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
kdewald committed Oct 30, 2024
1 parent 6ee30d8 commit e5b9012
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 2 additions & 0 deletions examples/simpleble-android/.idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion examples/simpleble-android/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions simpleble/src/backends/android/PeripheralBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ ByteArray PeripheralBase::read(BluetoothUUID const& service, BluetoothUUID const
}

auto value = _btGattCallback.wait_flag_characteristicReadPending(characteristic_obj.getObject());
return ByteArray(value.begin(), value.end());
return ByteArray(value);
}

void PeripheralBase::write_request(BluetoothUUID const& service, BluetoothUUID const& characteristic,
Expand Down Expand Up @@ -159,7 +159,7 @@ void PeripheralBase::notify(BluetoothUUID const& service, BluetoothUUID const& c

_btGattCallback.set_callback_onCharacteristicChanged(characteristic_obj.getObject(),
[callback](std::vector<uint8_t> data) {
ByteArray payload(data.begin(), data.end());
ByteArray payload(data);
callback(payload);
});
bool success = _gatt.setCharacteristicNotification(characteristic_obj, true);
Expand All @@ -186,7 +186,7 @@ void PeripheralBase::indicate(BluetoothUUID const& service, BluetoothUUID const&

_btGattCallback.set_callback_onCharacteristicChanged(characteristic_obj.getObject(),
[callback](std::vector<uint8_t> data) {
ByteArray payload(data.begin(), data.end());
ByteArray payload(data);
callback(payload);
});
bool success = _gatt.setCharacteristicNotification(characteristic_obj, true);
Expand Down Expand Up @@ -237,7 +237,7 @@ ByteArray PeripheralBase::read(BluetoothUUID const& service, BluetoothUUID const
}

auto value = _btGattCallback.wait_flag_descriptorReadPending(descriptor_obj.getObject().get());
return ByteArray(value.begin(), value.end());
return ByteArray(value);
}

void PeripheralBase::write(BluetoothUUID const& service, BluetoothUUID const& characteristic,
Expand Down

0 comments on commit e5b9012

Please sign in to comment.