Update contrib.
2 * Copyright (c) 1997-2009 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.
20 #include <stdlib.h> /* definition of exit() */
24 #include <sys/unistd.h>
25 #include <sys/ioctl.h>
40 Port = open("COM1:",0);
41 (void)ioctl(Port, COMMIOCTL_GETCONFIG, &sc);
43 sc.iParity = ParityNone;
44 (void)ioctl(Port, COMMIOCTL_SETCONFIG, &sc);
46 buffer = (char*)malloc(SIZE);
47 memset(buffer, '*', SIZE);
49 write(Port, buffer, SIZE);
56 @SYMTestCaseID SYSLIB-STDLIB-CT-1101
57 @SYMTestCaseDesc Tests for reading from the serial port
59 @SYMTestActions Tests for reading into a buffer of size 1000 bytes from the serial port
60 @SYMTestExpectedResults Test must not fail
72 Port = open("COM2:",0);
73 res = ioctl(Port, COMMIOCTL_GETCONFIG, &sc);
75 sc.iParity = ParityNone;
76 res = ioctl(Port, COMMIOCTL_SETCONFIG, &sc);
78 buffer = (char*)malloc(SIZE);
85 res = ioctl(Port, COMMIOCTL_SETREADTIMEOUT, &x);
89 res = read(Port, p, 100);
92 printf("read block %d int addr %x, bytes %d\n",x,p,res);
102 res = ioctl(Port, COMMIOCTL_SETREADTHRESHOLD, &x);
105 printf("And again with a threshold of 100\n");
109 res = read(Port, p, 100);
112 printf("read block %d int addr %x, bytes %d\n",x,p,res);