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>
33 @SYMTestCaseID SYSLIB-STDLIB-CT-1105
34 @SYMTestCaseDesc Tests for serial port
36 @SYMTestActions Tests for notification support
37 @SYMTestExpectedResults Test must not fail
43 int notify[2] = {0,0};
47 res = ioctl(port, COMMIOCTL_NOTIFYSUPPORTED, &supported);
48 printf("\nsupported notifies are %08lx\n",supported);
51 notify[0] = supported;
52 res = ioctl(port, COMMIOCTL_NOTIFY, ¬ify[0]);
53 printf("\n**Notify** res = %d params %d, %d, errno %d\n",res, notify[0], notify[1],errno);
59 @SYMTestCaseID SYSLIB-STDLIB-CT-1106
60 @SYMTestCaseDesc Tests for communication over the port
62 @SYMTestActions Tests for reading and writing to a port back
63 @SYMTestExpectedResults Test must not fail
76 int timeout = 5000; //5 seconds
79 printf("port is %d\n",port);
80 ioctl(port, COMMIOCTL_SETREADTHRESHOLD, &threshold);
81 ioctl(port, COMMIOCTL_SETREADTIMEOUT, &timeout);
86 err = read(port,rptr, 50);
90 err = write(port, wptr, strlen(wptr));
91 // printf("read %s, written %s\n", rptr, wptr);
107 start_posix_server(); /* calls SpawnPosixServer from C++ code */
109 port = open("IRCOM1:", 0);
111 t1 = create_thread(Watcher, "watcher");
112 t2 = create_thread(ping, "ping");