Changeset f66ca57f in mainline for uspace/srv/hid/isdv4_tablet/main.c
- Timestamp:
- 2012-08-15T15:10:53Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- affaf2e
- Parents:
- 1499564
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/isdv4_tablet/main.c
r1499564 rf66ca57f 35 35 #include <abi/ipc/methods.h> 36 36 #include <ipc/mouseev.h> 37 #include <inttypes.h> 37 38 38 39 #include "isdv4.h" 39 40 40 #define NAME " wacomdump"41 #define NAME "isdv4_tablet" 41 42 42 43 static async_sess_t *client_sess = NULL; … … 46 47 static void syntax_print(void) 47 48 { 48 fprintf(stderr, "Usage: wacomdump [--baud=<baud>] [--print-events] [device_service]\n");49 fprintf(stderr, "Usage: %s [--baud=<baud>] [--print-events] [device_service]\n", NAME); 49 50 } 50 51 … … 175 176 sysarg_t baud = 38400; 176 177 service_id_t svc_id; 178 char *serial_port_name = NULL; 177 179 178 180 int arg = 1; … … 205 207 206 208 if (argc > arg) { 207 rc = loc_service_get_id(argv[arg], &svc_id, 0); 209 serial_port_name = argv[arg]; 210 rc = loc_service_get_id(serial_port_name, &svc_id, 0); 208 211 if (rc != EOK) { 209 212 fprintf(stderr, "Cannot find device service %s\n", … … 238 241 239 242 svc_id = svc_ids[0]; 243 244 rc = loc_service_get_name(svc_id, &serial_port_name); 245 if (rc != EOK) { 246 fprintf(stderr, "Failed getting name of serial service\n"); 247 return 1; 248 } 249 240 250 free(svc_ids); 241 251 } … … 248 258 249 259 fibril_mutex_initialize(&client_mutex); 260 261 printf(NAME ": Using serial port %s\n", serial_port_name); 250 262 251 263 async_sess_t *sess = loc_service_connect(EXCHANGE_SERIALIZE, svc_id, … … 301 313 302 314 service_id_t service_id; 303 rc = loc_service_register("mouse/wacom", &service_id); 304 if (rc != EOK) { 305 printf(NAME ": Unable to register device mouse/wacom.\n"); 315 char *service_name; 316 rc = asprintf(&service_name, "mouse/isdv4-%" PRIun, svc_id); 317 if (rc < 0) { 318 printf(NAME ": Unable to create service name\n"); 319 return rc; 320 } 321 322 rc = loc_service_register(service_name, &service_id); 323 if (rc != EOK) { 324 printf(NAME ": Unable to register service %s.\n", service_name); 306 325 return rc; 307 326 }
Note:
See TracChangeset
for help on using the changeset viewer.