Changeset 0f816af6 in mainline for uspace/app/tmon/test.c


Ignore:
Timestamp:
2017-12-16T00:13:01Z (6 years ago)
Author:
Petr Mánek <petr.manek@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
17f8abc
Parents:
2bd04b2
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.