Changeset e80188f in mainline
- Timestamp:
- 2012-04-04T17:25:49Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e882e3a
- Parents:
- aa91105
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/tester/hw/serial/serial1.c
raa91105 re80188f 42 42 #include <async.h> 43 43 #include <ipc/services.h> 44 #include <ipc/devman.h> 45 #include <devman.h> 44 #include <loc.h> 46 45 #include <device/char_dev.h> 47 46 #include <str.h> … … 71 70 } 72 71 73 devman_handle_t handle;74 int res = devman_fun_get_handle("/hw/pci0/00:01.0/com1/a", &handle,75 IPC_FLAG_BLOCKING);72 service_id_t svc_id; 73 int res = loc_service_get_id("devices/\\hw\\pci0\\00:01.0\\com1\\a", 74 &svc_id, IPC_FLAG_BLOCKING); 76 75 if (res != EOK) 77 return " Could not get serial device handle";78 79 async_sess_t *sess = devman_device_connect(EXCHANGE_SERIALIZE, handle,76 return "Failed getting serial port service ID"; 77 78 async_sess_t *sess = loc_service_connect(EXCHANGE_SERIALIZE, svc_id, 80 79 IPC_FLAG_BLOCKING); 81 80 if (!sess) 82 return " Unable to connectto serial device";81 return "Failed connecting to serial device"; 83 82 84 83 char *buf = (char *) malloc(cnt + 1); 85 84 if (buf == NULL) { 86 85 async_hangup(sess); 87 return "Failed to allocateinput buffer";86 return "Failed allocating input buffer"; 88 87 } 89 88 … … 112 111 free(buf); 113 112 async_hangup(sess); 114 return "Failed to setserial communication parameters";115 } 116 117 TPRINTF("Trying to read%zu characters from serial device "118 "( handle=%" PRIun ")\n", cnt, handle);113 return "Failed setting serial communication parameters"; 114 } 115 116 TPRINTF("Trying reading %zu characters from serial device " 117 "(svc_id=%" PRIun ")\n", cnt, svc_id); 119 118 120 119 size_t total = 0; … … 130 129 free(buf); 131 130 async_hangup(sess); 132 return "Failed read from serial device";131 return "Failed reading from serial device"; 133 132 } 134 133 … … 165 164 free(buf); 166 165 async_hangup(sess); 167 return "Failed writ eto serial device";166 return "Failed writing to serial device"; 168 167 } 169 168
Note:
See TracChangeset
for help on using the changeset viewer.