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>
33 @SYMTestCaseID SYSLIB-STDLIB-CT-1100
34 @SYMTestCaseDesc Tests for writing to the serial port
36 @SYMTestActions Tests for writing a buffer of size 1000 bytes to the serial port
37 @SYMTestExpectedResults Test must not fail
46 Port = open("COM1:",0);
47 (void)ioctl(Port, COMMIOCTL_GETCONFIG, &sc);
49 sc.iParity = ParityNone;
50 (void)ioctl(Port, COMMIOCTL_SETCONFIG, &sc);
52 buffer = (char*)malloc(SIZE);
53 memset(buffer, '*', SIZE);
55 printf("writing monster block\n");
56 write(Port, buffer, SIZE);
59 printf("press a key\n");
62 printf("writing monster block again\n");
63 write(Port, buffer, SIZE);
76 Port = open("COM1:",0);
77 res = ioctl(Port, COMMIOCTL_GETCONFIG, &sc);
79 sc.iParity = ParityNone;
80 res = ioctl(Port, COMMIOCTL_SETCONFIG, &sc);
82 buffer = (char*)malloc(SIZE);
89 res = read(Port, p, 100);