Skip to content

Conversation

@bobwzy
Copy link
Contributor

@bobwzy bobwzy commented Mar 21, 2025

  • Send a deviceReset cmd when create the device.

@bobwzy bobwzy requested a review from hchataing March 21, 2025 22:19
@bobwzy bobwzy force-pushed the device-reset branch 2 times, most recently from 7800940 to aa2b0d6 Compare March 25, 2025 20:27
tests/helper.py Outdated


async def init(host: Host):
await host.expect_control(uci.CoreDeviceResetRsp(status=uci.Status.OK))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please test with AOSP to make sure that the HAL is behaving as expected ?
Receiving the notification on init seems fine, but receiving a response for a command that was never sent looks dangerous.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with aosp and uwb cts tests and looks it works well.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the response is ignored ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still can you please check if it is possible to avoid sending that response ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems set is_reset to true when adding the device resolve the problem?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well that is just removing the logic for checking for device reset...
I feel that the more appropriate approach should be the modify the HAL to emit the Device Reset command on startup instead..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But if we send the Device Reset command on startup on the HAL side, it will receive the response when the hal is open, which is not what we wanted.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the HCI HAL implementation I am intercepting the response before it is sent to host:
https://cs.android.com/android/platform/superproject/main/+/main:device/google/cuttlefish/guest/hals/bluetooth/src/hci.rs

@bobwzy bobwzy requested a review from hchataing March 25, 2025 22:13
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

Successfully merging this pull request may close these issues.

2 participants