File: serial2.cpp

package info (click to toggle)
icomlib 1.0.1-4
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,652 kB
  • ctags: 1,363
  • sloc: cpp: 4,849; makefile: 536; sh: 181; ansic: 145
file content (18 lines) | stat: -rw-r--r-- 430 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <stdio.h>

#include <pcrdef.h>
#include <pcomm.h>

void main ()
{
	PComm *elmo = new PComm ("/dev/ttyS0");
	char message[255];
	elmo->PCTell(PCRSQLO);
	fprintf(stderr, "sizeof(message): %i\n", sizeof(message));
	elmo->PCHear(message);
	fprintf(stderr, "I heard this \"%s\" in main()\n", message);
	sleep(5);
	elmo->PCTell(PCRSQLC);
	elmo->PCHear(message);
	fprintf(stderr, "I heard this \"%s\" in main()2\n", message);
}