Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 0f816af6 in mainline


Ignore:
Timestamp:
2017-12-16T00:13:01Z (4 years ago)
Author:
Petr Mánek <petr.manek@…>
Branches:
lfn, master
Children:
17f8abc
Parents:
2bd04b2
Message:

usbdiag: tmon finally uses IPC to communicate with usbdiag driver through libusbdiag

Location:
uspace/app/tmon
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/tmon/list.c

    r2bd04b2 r0f816af6  
    3939#include <loc.h>
    4040#include <usb/diag/diag.h>
    41 #include <usb/diag/iface.h>
    42 #include <errno.h>
    4341#include "commands.h"
    4442
  • uspace/app/tmon/test.c

    r2bd04b2 r0f816af6  
    4141#include <str_error.h>
    4242#include <usb/diag/diag.h>
     43#include <usb/diag/iface.h>
    4344#include "commands.h"
    4445
     
    115116
    116117static int bulk_worker(devman_handle_t fun) {
     118        async_sess_t *sess = usb_diag_connect(fun);
     119        async_exch_t *exch = async_exchange_begin(sess);
     120
    117121        // TODO: do some testing
     122        int y;
     123        int rc = usb_diag_test(exch, 4200, &y);
     124
     125        if (rc) {
     126                printf(NAME ": %s\n", str_error(rc));
     127        } else {
     128                printf("The number is %d.\n", y);
     129        }
     130
     131        async_exchange_end(exch);
     132        usb_diag_disconnect(sess);
    118133        return 0;
    119134}
Note: See TracChangeset for help on using the changeset viewer.