Re: Serial Port Communication in WinCE Emulator using eVC++
your code seems all right. still, i think that something in your hyperterminal configuration might be wrong.
did you already step through your code using the debugger? if writefile is executed without errors, then it's likely that there is a problem with the hyperterminal. you could also try using a terminal program which is capable of showing hex-formatted data (check out http://www.der-hammer.info/terminal/). maybe something is corrupted while communication and hyperterminal can't display it... that's only speculations.
on my machine, it works without platform builder.
Re: Serial Port Communication in WinCE Emulator using eVC++
Hi Leo,
Here in my machine, i selected com1 for emulator configuration settings.
When wince emulator is coming up it is wrting some data in to com port. But if I execute my program WriteFile is getting succeeded by setting the number of bytes written to proper value. But at the other side it is not displaying anything.
Please let me know if any preconfiguration settings are required for this. Please give your mail id if there is no problem, so that I can send my entire project to there.
Regards,
Santosh Kumar Voonna.
Re: Serial Port Communication in WinCE Emulator using eVC++
Hi Leo,
Here in my machine, i selected com1 for emulator configuration settings.
When wince emulator is coming up it is wrting some data in to com port. But if I execute my program WriteFile is getting succeeded by setting the number of bytes written to proper value. But at the other side it is not displaying anything.
Please let me know if any preconfiguration settings are required for this. Please give your mail id if there is no problem, so that I can send my entire project to there.
Regards,
Santosh Kumar Voonna.
Re: Serial Port Communication in WinCE Emulator using eVC++
Quote:
Originally Posted by santoshvoonna
Hi Leo,
Here in my machine, i selected com1 for emulator configuration settings.
When wince emulator is coming up it is wrting some data in to com port. But if I execute my program WriteFile is getting succeeded by setting the number of bytes written to proper value. But at the other side it is not displaying anything.
Please let me know if any preconfiguration settings are required for this. Please give your mail id if there is no problem, so that I can send my entire project to there.
Regards,
Santosh Kumar Voonna.
try to set the emulator com port 1 to "file:" and see if something is written then. if that works, there must be something wrong in the serial port configuration settings you specify in hyperterminal.
still, i'm quite sure that there actually IS something wrong with those settings. maybe you could post a screenshot of the hyperterminal properties-screen?
don't be angry, but i don't have the time to debug your project...
1 Attachment(s)
Re: Serial Port Communication in WinCE Emulator using eVC++
Hi Leo,
Since this is the fist time, I am not sure whether the way I am creating and executing the application is correct or not. Anyhow I am explaining the way I am creating the project and executing it. Please check and let me know if there is any problem in the process.
- Creating empty MFC project(Document based).
- Creating one menu item (ConfigAndReadFromComm) using resource.
- Adding the code as a handler for the menu item
- Building the project (With WINCE emulator debug option)
- Directly executing.
- Main thing is that every API is returning success and Write file is setting no of bytes written correctly.
- If I configure the platform mgr com settings to COM1
Whenever WINCE .NET image is coming up some data it is writing to comm port. Same behaviour I can observe if I click/move my mouse pointer on the document of the WIN CE application. Some data which i cant able to understand at all
- Finally
If I set the serial conf option to "file:" then I can see some statements over there. But those statements also I cant able to understand. Please look at the first few lines of the file
Debug Serial Init
SysInit: GDTBase=808b0040 IDTBase=808b94a0 KData=808c1800
Windows CE Kernel for i486 Built on Dec 16 2001 at 18:18:13
g_PageDir = 808c2000
RTC - Status Reg B - 0x02
X86Init done.
Checking if CPU = emulator...
Yes - CPU = emulator
Checking if CPU = emulator...
Yes - CPU = emulator
SENDING command id 0xE100 to CWinApp target.
SENDING command id 0xE100 to CWinApp target.
SENDING command id 0xE101 to CWinApp target.
SENDING command id 0xE103 to CSerTest4Doc target.
No handler for command ID 0xE123, disabling it.
No handler for command ID 0xE122, disabling it.
No handler for command ID 0xE125, disabling it.
SENDING command id 0xE140 to CWinApp target.
SENDING command id 0xE100 to CWinApp target.
SENDING command id 0xE101 to CWinApp target.
SENDING command id 0xE103 to CSerTest4Doc target.
No handler for command ID 0xE123, disabling it.
No handler for command ID 0xE122, disabling it.
No handler for command ID 0xE125, disabling it.
SENDING command id 0xE140 to CWinApp target.
SENDING command id 0xE100 to CWinApp target.
SENDING command id 0xE101 to CWinApp target.
SENDING command id 0xE103 to CSerTest4Doc target.
No handler for command ID 0xE123, disabling it.
No handler for command ID 0xE122, disabling it.
No handler for command ID 0xE125, disabling it.
SENDING command id 0xE140 to CWinApp target.
SENDING command id 0xE100 to CWinApp target.
SENDING command id 0xE101 to CWinApp target.
Awaiting your reply.
Regards,
Santosh Kumar Voonna.
Re: Serial Port Communication in WinCE Emulator using eVC++
santosh, i'm sorry that i have to say that i have no idea of what could be wrong except that you could still be having a problem in the communication settings of hyperterminal... i still got no information from you on which settings you are actually using!
Re: Serial Port Communication in WinCE Emulator using eVC++
Hi Leo,
Since this is the fist time, I am not sure whether the way I am creating and executing the application is correct or not. Anyhow I am explaining the way I am creating the project and executing it. Please check and let me know if there is any problem in the process.
- Creating empty MFC project(Document based).
- Creating one menu item (ConfigAndReadFromComm) using resource.
- Adding the code as a handler for the menu item
- Building the project (With WINCE emulator debug option)
- Directly executing.
- Main thing is that every API is returning success and Write file is setting no of bytes written correctly.
- If I configure the platform mgr com settings to COM1
Whenever WINCE .NET image is coming up some data it is writing to comm port. Same behaviour I can observe if I click/move my mouse pointer on the document of the WIN CE application. Some data which i cant able to understand at all
- Finally
If I set the serial conf option to "file:" then I can see some statements over there. But those statements also I cant able to understand. Please look at the first few lines of the file
Debug Serial Init
SysInit: GDTBase=808b0040 IDTBase=808b94a0 KData=808c1800
Windows CE Kernel for i486 Built on Dec 16 2001 at 18:18:13
g_PageDir = 808c2000
RTC - Status Reg B - 0x02
X86Init done.
Checking if CPU = emulator...
Yes - CPU = emulator
Checking if CPU = emulator...
Yes - CPU = emulator
SENDING command id 0xE100 to CWinApp target.
SENDING command id 0xE100 to CWinApp target.
SENDING command id 0xE101 to CWinApp target.
SENDING command id 0xE103 to CSerTest4Doc target.
No handler for command ID 0xE123, disabling it.
No handler for command ID 0xE122, disabling it.
No handler for command ID 0xE125, disabling it.
SENDING command id 0xE140 to CWinApp target.
SENDING command id 0xE100 to CWinApp target.
SENDING command id 0xE101 to CWinApp target.
SENDING command id 0xE103 to CSerTest4Doc target.
No handler for command ID 0xE123, disabling it.
No handler for command ID 0xE122, disabling it.
No handler for command ID 0xE125, disabling it.
SENDING command id 0xE140 to CWinApp target.
SENDING command id 0xE100 to CWinApp target.
SENDING command id 0xE101 to CWinApp target.
SENDING command id 0xE103 to CSerTest4Doc target.
No handler for command ID 0xE123, disabling it.
No handler for command ID 0xE122, disabling it.
No handler for command ID 0xE125, disabling it.
SENDING command id 0xE140 to CWinApp target.
SENDING command id 0xE100 to CWinApp target.
SENDING command id 0xE101 to CWinApp target.
Awaiting your reply.
Regards,
Santosh Kumar Voonna.
Re: Serial Port Communication in WinCE Emulator using eVC++
Hi,
I have some problems with my WinCe Pocket PC PDA: I must connect a USB device to the PDA to get some information from it by sending an AT command and reading the response.
The first problem is that the USB device manufacturer provides several driver DLL's and I am not sure which is the correct one for my iPAQ (ARM, MIPS, PPC, SHx and x86 are the possibilities, I have chosen PPC, 403 instead of 821, two more possibilities, but I don't really know about them).
Once I have copied the DLL to the PDA '/Window' directory, I plug in the USB device to the PDA and a dialog is supposed to appear to ask me for the DLL the PDA needs, the one copied before. No dialog appears, the PDA seems not to recognize the USB device, should it show anything when you plug in a USB device? May it be because the USB device need some power supply that the PDA can not give?
Another problem is to access to the COM port, I have installed a 'registry manager' and the USB serial port seems to be 'COM5:', so use the code given here to access to this port in CreateFile.
In the code appears:
-------------------------------------------------------------------------------------
CHAR pcVersion[20];
memset(pcVersion, '\0', 20);
DWORD dwByteCount = 0;
if (ReadFile(m_hComm, pcVersion, 20, &dwByteCount, NULL) != 0)
{
setErrMsg("Connection to reader established.");
}
WriteFile(m_hComm, "S", 1, &dwByteCount, NULL); // stop the scanmode ????
ReadFile(m_hComm, pcVersion, 20, &dwByteCount, NULL); // read the firmware version
-------------------------------------------------------------------------------------
The message "Connection to reader established" appears, but dwByteCount = 0. I have tried to modify the code to send an AT command and read the response:
------------------------------------------------------------------------------------
int writeOK = WriteFile(m_hComm, _T("at+L4"), 4, &dwByteCount, NULL);
int readOK = ReadFile(m_hComm, pcVersion, 4, &dwByteCount, NULL);
------------------------------------------------------------------------------------
writeOK != 0 (so it writes ok, doesn't it?) and dwByteCount = 4
readOK != 0 but dwByteCount = 0, so no data is read!!!!
I don't know if my PDA recognizes the USB device, if it can open the USB port and write but not read, or the device is not recognized and the write is wrong, so no read is possible...
I have installed the vxHpc in the PDA, and connected it to the USB port. I have tried to write something to see the response, but nothing seems to happen when I use the keyboard (nothing on screen and the cursor does not move!!!)
I would be greatful with any help, 'cause I am really stuck on it...
Thanks in advance