Changeset c4c6025 in mainline for uspace/app/sportdmp/sportdmp.c
- Timestamp:
- 2017-11-21T18:40:27Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 74017ce, d51a0d6, ee44809
- Parents:
- afec1be
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/sportdmp/sportdmp.c
rafec1be rc4c6025 29 29 #include <char_dev_iface.h> 30 30 #include <errno.h> 31 #include <i pc/serial_ctl.h>31 #include <io/serial.h> 32 32 #include <loc.h> 33 33 #include <stdio.h> … … 44 44 sysarg_t baud = 9600; 45 45 service_id_t svc_id; 46 serial_t *serial; 46 47 47 48 int arg = 1; … … 113 114 async_sess_t *sess = loc_service_connect(svc_id, INTERFACE_DDF, 114 115 IPC_FLAG_BLOCKING); 115 if ( !sess) {116 if (sess == NULL) { 116 117 fprintf(stderr, "Failed connecting to service\n"); 118 return 2; 117 119 } 118 120 119 async_exch_t *exch = async_exchange_begin(sess); 120 rc = async_req_4_0(exch, SERIAL_SET_COM_PROPS, baud, 121 SERIAL_NO_PARITY, 8, 1); 122 async_exchange_end(exch); 121 rc = serial_open(sess, &serial); 122 if (rc != EOK) { 123 fprintf(stderr, "Failed opening serial port\n"); 124 return 2; 125 } 123 126 127 rc = serial_set_comm_props(serial, baud, SERIAL_NO_PARITY, 8, 1); 124 128 if (rc != EOK) { 125 129 fprintf(stderr, "Failed setting serial properties\n"); … … 147 151 148 152 free(buf); 153 serial_close(serial); 154 async_hangup(sess); 149 155 return 0; 150 156 }
Note:
See TracChangeset
for help on using the changeset viewer.