Skip to content

Commit

Permalink
feat usb: added some logs
Browse files Browse the repository at this point in the history
Signed-off-by: John Sanpe <[email protected]>
  • Loading branch information
sanpeqf committed Jun 11, 2024
1 parent 4e8f5cd commit da17dfd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/connection/usb/xdbd_connection_usb.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@


#define MODULE_NAME "xdbd_connection_usb"
#define bfdev_log_fmt(fmt) MODULE_NAME ": " fmt

#include "connection.h"
#include "xdbd.h"
#include <xdbd_event.h>
Expand Down Expand Up @@ -127,10 +131,12 @@ static int
usb_init_send(xdbd_usb_listening_t *uls)
{
if (write(uls->fd_ctr, &adb_descriptors, sizeof(adb_descriptors)) != sizeof(adb_descriptors)) {
bfdev_log_warn("send adb descriptors failed\n");
return XDBD_ERR;
}

if (write(uls->fd_ctr, &adb_strings, sizeof(adb_strings)) != sizeof(adb_strings)) {
bfdev_log_warn("send adb strings failed\n");
return XDBD_ERR;
}

Expand Down Expand Up @@ -172,16 +178,19 @@ int xdbd_event_open_usb_connection(xdbd_usb_listening_t *uls) {

uls->fd_ctr = xdbd_open((char *)uls->ctr.data, 0);
if (uls->fd_ctr < 0) {
bfdev_log_err("%s open failed: %m\n", uls->ctr.data);
return XDBD_ERR;
}

uls->fd_in = xdbd_open((char *)uls->in.data, 0);
if (uls->fd_in < 0) {
bfdev_log_err("%s open failed: %m\n", uls->in.data);
return XDBD_ERR;
}

uls->fd_out = xdbd_open((char *)uls->out.data, 0);
if (uls->fd_out < 0) {
bfdev_log_err("%s open failed: %m\n", uls->out.data);
return XDBD_ERR;
}

Expand Down

0 comments on commit da17dfd

Please sign in to comment.