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

Changeset c4c6025 in mainline for uspace/srv/hid/isdv4_tablet/main.c


Ignore:
Timestamp:
2017-11-21T18:40:27Z (4 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master
Children:
74017ce, d51a0d6, ee44809
Parents:
afec1be
Message:

Add C API for serial port control.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/isdv4_tablet/main.c

    rafec1be rc4c6025  
    2727 */
    2828
    29 #include <char_dev_iface.h>
     29#include <async.h>
    3030#include <errno.h>
    31 #include <ipc/serial_ctl.h>
     31#include <fibril_synch.h>
     32#include <io/serial.h>
     33#include <ipc/mouseev.h>
    3234#include <loc.h>
     35#include <stddef.h>
    3336#include <stdio.h>
    34 #include <fibril_synch.h>
    35 #include <abi/ipc/methods.h>
    36 #include <ipc/mouseev.h>
    37 #include <inttypes.h>
    3837#include <task.h>
    3938
     
    179178        sysarg_t baud = 38400;
    180179        service_id_t svc_id;
     180        serial_t *serial;
    181181        char *serial_port_name = NULL;
    182182
     
    268268        if (!sess) {
    269269                fprintf(stderr, "Failed connecting to service\n");
    270         }
    271 
    272         async_exch_t *exch = async_exchange_begin(sess);
    273         rc = async_req_4_0(exch, SERIAL_SET_COM_PROPS, baud,
    274             SERIAL_NO_PARITY, 8, 1);
    275         async_exchange_end(exch);
    276 
     270                return 2;
     271        }
     272
     273        rc = serial_open(sess, &serial);
     274        if (rc != EOK) {
     275                fprintf(stderr, "Failed opening serial port\n");
     276                return 2;
     277        }
     278
     279        rc = serial_set_comm_props(serial, baud, SERIAL_NO_PARITY, 8, 1);
    277280        if (rc != EOK) {
    278281                fprintf(stderr, "Failed setting serial properties\n");
Note: See TracChangeset for help on using the changeset viewer.