Changes in uspace/app/tester/hw/serial/serial1.c [e80188f:9d58539] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/tester/hw/serial/serial1.c
re80188f r9d58539 42 42 #include <async.h> 43 43 #include <ipc/services.h> 44 #include <loc.h> 44 #include <ipc/devman.h> 45 #include <devman.h> 45 46 #include <device/char_dev.h> 46 47 #include <str.h> … … 70 71 } 71 72 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);73 devman_handle_t handle; 74 int res = devman_fun_get_handle("/hw/pci0/00:01.0/com1/a", &handle, 75 IPC_FLAG_BLOCKING); 75 76 if (res != EOK) 76 return " Failed getting serial port service ID";77 78 async_sess_t *sess = loc_service_connect(EXCHANGE_SERIALIZE, svc_id,77 return "Could not get serial device handle"; 78 79 async_sess_t *sess = devman_device_connect(EXCHANGE_SERIALIZE, handle, 79 80 IPC_FLAG_BLOCKING); 80 81 if (!sess) 81 return " Failed connectingto serial device";82 return "Unable to connect to serial device"; 82 83 83 84 char *buf = (char *) malloc(cnt + 1); 84 85 if (buf == NULL) { 85 86 async_hangup(sess); 86 return "Failed allocatinginput buffer";87 return "Failed to allocate input buffer"; 87 88 } 88 89 … … 111 112 free(buf); 112 113 async_hangup(sess); 113 return "Failed settingserial communication parameters";114 } 115 116 TPRINTF("Trying reading%zu characters from serial device "117 "( svc_id=%" PRIun ")\n", cnt, svc_id);114 return "Failed to set serial communication parameters"; 115 } 116 117 TPRINTF("Trying to read %zu characters from serial device " 118 "(handle=%" PRIun ")\n", cnt, handle); 118 119 119 120 size_t total = 0; … … 129 130 free(buf); 130 131 async_hangup(sess); 131 return "Failed read ingfrom serial device";132 return "Failed read from serial device"; 132 133 } 133 134 … … 164 165 free(buf); 165 166 async_hangup(sess); 166 return "Failed writ ingto serial device";167 return "Failed write to serial device"; 167 168 } 168 169
Note:
See TracChangeset
for help on using the changeset viewer.