Subversion Repositories HelenOS-historic

Rev

Rev 1441 | Rev 1449 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1441 Rev 1445
Line 303... Line 303...
303
    int res;
303
    int res;
304
    ipcarg_t result;
304
    ipcarg_t result;
305
    int phoneid;
305
    int phoneid;
306
 
306
 
307
    printf("Test: Starting connect...\n");
307
    printf("Test: Starting connect...\n");
308
    while ((phoneid = ipc_connect_me_to(PHONE_NS, SERVICE_KEYBOARD, 0)) < 0) {
308
    while ((phoneid = ipc_connect_me_to(PHONE_NS, SERVICE_CONSOLE, 0)) < 0) {
309
    };
309
    };
310
   
310
   
311
    printf("Test: Connected: %d\n", res);
311
    printf("Test: Connected: %d\n", res);
312
    printf("Test: pinging.\n");
312
    printf("Test: pinging.\n");
313
    while (1) {
313
/*  while (1) {
-
 
314
       
314
        res = ipc_call_sync(phoneid, KBD_GETCHAR, 0xbeef,&result);
315
        res = ipc_call_sync(phoneid, KBD_GETCHAR, 0xbeef,&result);
315
//      printf("Test: Retval: %d - received: %c\n", res, result);
316
//      printf("Test: Retval: %d - received: %c\n", res, result);
316
        printf("%c", result);
317
        printf("%c", result);
317
    }
318
    }
318
   
319
*/ 
319
    printf("Test: Hangin up\n");
320
    printf("Test: Hangin up\n");
320
    ipc_hangup(phoneid);
321
    ipc_hangup(phoneid);
321
}
322
}
322
 
323
 
323
static void test_async_kbd()
324
static void test_async_kbd()
Line 333... Line 334...
333
    };
334
    };
334
   
335
   
335
    printf("Test: Connected: %d\n", res);
336
    printf("Test: Connected: %d\n", res);
336
    printf("Test: pinging.\n");
337
    printf("Test: pinging.\n");
337
 
338
 
338
    aid = async_send_2(phoneid, KBD_GETCHAR, 0, 0, &kbddata);
-
 
-
 
339
 
339
    while (1) {
340
    while (1) {
340
        if (async_wait_timeout(aid, NULL, 1000000)) {
-
 
341
            printf("^");
-
 
342
            continue;
-
 
343
        }
-
 
344
        printf("%c", IPC_GET_ARG1(kbddata));
-
 
345
        aid = async_send_2(phoneid, KBD_GETCHAR, 0, 0, &kbddata);
-
 
346
    }
341
    }
347
   
342
   
348
    printf("Test: Hangin up\n");
343
    printf("Test: Hangin up\n");
349
    ipc_hangup(phoneid);
344
    ipc_hangup(phoneid);
350
}
345
}