Email:
sales@wcscnet.com


Competent Technical Support By Knowledgeable Engineers

View Cart

Checkout

RSS Feed
Home
Products
Services
Support
File Download
Testimonials
NewsLetters
Press Releases
Tutorials
WebLog (News)
WCSC Partners
Developer Tools

Register for WCSC email updates

Wires No More!
$159.99 a pair


Wireless Serial Adapter
(Bluetooth to RS232)

 

Credit Card Merchant Services

 
Combining nine-bit protocol with "8 bit / no parity / 1 stop bit" transmission.

Some device communicate with both the nine bit protocol as well as standard "8 bit / no parity / 1 stop bit" communications. The best way to accomplish this is to open the port as indicated in the documentation for nine-bit communication and create a function similar to the following to send the 8 bit data.

int WCSCVxDPutPacket8Bit(int VxDPID,int Count, char *Pkt)
{
int OldLCR;
int OldLSR;
int Cnt=Count;
int Idx=0;

//Save the UART's line status register
WCSCVxDGetRegister(VxDPID,LCR,&OldLCR);

//Write new UART's line status register to enable N/8/1
WCSCVxDPutRegister(VxDPID,LCR,0x3);

//Output the data
while(Cnt-- > 0)
	{
	while(1)
		{
		WCSCVxDGetRegister(VxDPID,LSR,&OldLSR);
		if (OldLSR & LSR_THRE)
			{
			WCSCVxDPutRegister(VxDPID,DATABUF,Pkt[Idx++]);
			Cnt--;
			break;
			}
		else
			Sleep(1);
		}
	}
//Restore the UART's line status register
WCSCVxDPutRegister(VxDPID,LCR,OldLCR);

return(Count);
}
 

 

Updated: 08/07/2008 

 

 
Copyright © 2008 by Willies Computer Software Co