Update contrib.
2 * Copyright (c) 1997-2007 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
19 #include <stdlib.h> /* definition of exit() */
23 #include <sys/unistd.h>
24 #include <sys/ioctl.h>
30 @SYMTestCaseID SYSLIB-STDLIB-CT-1107
31 @SYMTestCaseDesc Tests for serial port
33 @SYMTestActions Tests for notification support
34 @SYMTestExpectedResults Test must not fail
40 int notify[2] = {0,0};
44 res = ioctl(port, COMMIOCTL_NOTIFYSUPPORTED, &supported);
45 printf("\nsupported notifies are %08lx\n",supported);
48 notify[0] = supported;
49 res = ioctl(port, COMMIOCTL_NOTIFY, ¬ify[0]);
50 printf("\n**Notify** res = %d params %d, %d, errno %d\n",res, notify[0], notify[1],errno);
56 @SYMTestCaseID SYSLIB-STDLIB-CT-1108
57 @SYMTestCaseDesc Tests for serial port
59 @SYMTestActions Tests for writing and reading to a port
60 @SYMTestExpectedResults Test must not fail
72 int timeout = 5000; //5 seconds
78 printf("port is %d\n",port);
79 ioctl(port, COMMIOCTL_SETREADTHRESHOLD, &threshold);
80 ioctl(port, COMMIOCTL_SETREADTIMEOUT, &timeout);
85 err = write(port, wptr, strlen(wptr));
88 err = read(port,rptr, 50);
92 // printf ("read %s, written %s\n",rptr, wptr);
108 start_posix_server(); /* calls SpawnPosixServer from C++ code */
110 port = open("IRCOM1:", 0);
112 t1 = create_thread(Watcher, "watcher");
113 t2 = create_thread(pong, "pong");