Page 1 of 1

Reading from COM3 c++

Posted: Thu Oct 26, 2006 10:19 pm
by legit
hey all,
Sorry to be a baby about this (just need some help getting off the ground) but I was wondering if anyone could give me an example of a ReadFile from the keypad on MX503's. I'd really appreciate it.
heres my CreateFile if that helps:

comPortOpen = CreateFile("COM3", GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);

thanks,
- legit

Posted: Fri Oct 27, 2006 11:19 am
by Ray
In the code i posted in this topic paste the following code just before CloseHandle line.

Code: Select all

   while (true)
   {
	   ReadFile(hCom,buffer,1,&br,NULL);
	   if (br != 0)
		   printf("%.2x\n",buffer[0]);
   }
It would print out all Characters recieved.