Hi all,
I have a problem to communicate with serial port(COM3:). I am able
to open the handle but cannot send any data.
1. I connected my motoroala handset to PC through datacable.
2. I installed valid driver to detec the motorla(V400) handset
3. I tested the handset through Hypertermal and succssfully sending
any data.
4. I opened the Control Panel -> Phone and Model window and clicked
the modem tab and I saw that the Motorola handset( Motorola USB modem
) is attached through COM3: port fo the PC
5. Then I created a sample C# program to communicate with handeset
through COM3 port . the code is like this:
string text = "AT+CKPD=";
int byteCnt = oEnc.GetByteCount(
text.ToCharArray(),0,text.Length,true);
byte[] Buffer = new byte[byteCnt];
int byteEncodeCount = oEnc.GetBytes( text.ToCharArray
),0,text.Length,Buffer,0,true);
hSerialPort = Serial.CreateFile( handleName, Serial.GENERIC_READ |
Serial.GENERIC_WRITE, 0 ,IntPtr.Zero,
Serial.OPEN_EXISTING, Serial.FILE_FLAG_OVERLAPPED, IntPtr.Zero
);
if( hSerialPort.ToString() == "-1" )
{
Console.WriteLine( "Un available");
}
int ch = 1;
if( ch == 1 )
Success = Serial.WriteFile( hSerialPort,Buffer,
Buffer.Length, out BytesWritten, IntPtr.Zero );
When i debug the code the Serial.WriteFile method is return false
value. and I got the system error code using
Marshal.GetLastwin32Error(), it is giving 126 error code. I searched
in internet description of the 126 error , it says module not found.
I don't know what to do. I am imporing only Kernel32.dll in my
sample program. is anything i have to do..?
please help me on the problem..
Thanks & Regards
kiran kumar
vemulakiran@gmail.com
Floyd Burger - 29 Apr 2005 16:03 GMT
Some of these devices can only be accessed using TAPI. When you tried with
HyperTerminal did you open COM3 or the TAPI device by name? Have you tried
with other serial communications libraries? I use TransPort from
www.componentscience.net and am pretty happy with it.

Signature
Floyd
> Hi all,
> I have a problem to communicate with serial port(COM3:). I am able
[quoted text clipped - 43 lines]
> kiran kumar
> vemulakiran@gmail.com