Skip to content

microADB: using timer to check usb hotplug event - #40

Open
Donny9 wants to merge 1 commit into
spiriou:masterfrom
Donny9:timer
Open

microADB: using timer to check usb hotplug event#40
Donny9 wants to merge 1 commit into
spiriou:masterfrom
Donny9:timer

Conversation

@Donny9

@Donny9 Donny9 commented Nov 14, 2023

Copy link
Copy Markdown
Contributor

microADB: using timer to check usb hotplug event

let's setup timer to check usb hotplug, and keep adbd always alive.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
Comment thread hal/hal_uv_client_usb.c
int ret;
int fd;

ret = uv_pipe_init(uv_default_loop(), &client->read_pipe, 0);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

it's better to use the uv loop from client instead of uv_default_loop().

Comment thread hal/hal_uv_client_usb.c
Comment on lines +32 to +35
#ifdef CONFIG_ADBD_USB_HOTPLUG_BYTIMER
uv_timer_t timer;
#endif
char path[0];

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I would prefer to handle the hotplug timer outside of the hal_uv_client_usb file. This new hotplug timer could periodically check for "/dev/adb0" file, and call adb_uv_usb_setup(adbd, "/dev/adb0") when required to setup usb port.

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