Re: Serial port communications with iPaq; max baud rate ?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: A.B. (someone_at_somewhere.com)
Date: 05/01/04


Date: Sat, 1 May 2004 16:41:24 -0400

I have some code done but it doesn't work right... I get the following error
output oof my program (see source below):

GetCommState OK
 Making custom settings...
Error setting COM state, error 437384220

-------------------------------------------Source
Code----------------------------------------------------------------

//*** GLOBAL VARIABLES ***
HANDLE hSerialPort; //for serial communications
DCB dcbPort; //Init the device control block (for serial port)

BOOL CSDOscopeDlg::OnInitDialog()
{

 CDialog::OnInitDialog();

 // Set the icon for this dialog. The framework does this automatically
 // when the application's main window is not a dialog
 SetIcon(m_hIcon, TRUE); // Set big icon
 SetIcon(m_hIcon, FALSE); // Set small icon

 CenterWindow(GetDesktopWindow()); // center to the hpc screen

 //open serial port (COM1)
 hSerialPort = CreateFile(_T("COM1:"), GENERIC_READ | GENERIC_WRITE, 0,
NULL, OPEN_EXISTING, 0, NULL); //NOTE: I.R. comm = COM3:

 //Init the settings for the dcbPort (device control block) structure
    if(GetCommState(hSerialPort, &dcbPort) == false)
  TRACE(_T("GetCommState Failed\n Can not use COM Port\n"));//debug message
    else
 {
  TRACE(_T("GetCommState OK\n Making custom settings...\n"));//debug message

  dcbPort.BaudRate = CBR_115200; //set baud rate
  dcbPort.ByteSize = 8; //Set Bytes
  dcbPort.Parity = NOPARITY; //Set Parity
  dcbPort.StopBits = ONESTOPBIT; //Set stop bit

  //Set the port state
  if(SetCommState(hSerialPort, &dcbPort) != 0)
  {
   TRACE(_T("Error setting COM state, error %u\n",GetLastError()));//debug
message
  }
  else
   TRACE(_T("COM state set OK\n"));//debug message
 }

 return TRUE; // return TRUE unless you set the focus to a control
}

"Al" <anonymous@discussions.microsoft.com> wrote in message
news:BC93706F-E3EB-42FF-8884-E5B6361C463B@microsoft.com...
> I'm connecting a microcontroller to the iPaq using the serial port (I
purchased a cable from HP that splits the proprietary 22pin connector into
USB & RS232 connections).
>
> There are just a few sticking points:
> 1) Using eVC++4 & MFC, how do I open a COM port?
> 2) the maximum baud rate of the iPaq serial port? I know this sounds like
a silly question, and a lot of people are going to think 115K, but the
microcontroller I'm using is capable of up to 2Mbaud... so I'm hoping the
iPaq 4155 doesn't stick to the antique 115K.
>
> THANKYOU!!



Relevant Pages

  • Re: Serial port communications with iPaq; max baud rate ?
    ... > I'm connecting a microcontroller to the iPaq using the serial port (I ... microcontroller I'm using is capable of up to 2Mbaud... ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: Serial port communications with iPaq; max baud rate ?
    ... found a great website for the serial communications... ... > I'm connecting a microcontroller to the iPaq using the serial port (I ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: Problems setting up Remote Web Workplace (RWW)
    ... PC) or is "local" always the PC connected by LAN cable to the SBS server? ... > You need to adjust the settings of the local machine. ... to the server or the one in my home connecting to the SBS LAN via dial-up? ... Guess this ActiveX is some stuff that gets downloaded the 1st time from the ...
    (microsoft.public.windows.server.sbs)
  • RS232 Redirector Program in C using Linux
    ... developing linux aps as well as in the serial port), ... failed to get current settings ... the int handler ... nbytes = write; ...
    (comp.os.linux.development.apps)
  • Re: Bluetooth : how to get started?
    ... If you want the iPaq or desktop to connect to you then you'll have to ... expose an SDP record for the serial port profile. ... COM6 which you assigned to Bluetooth. ...
    (microsoft.public.windowsce.platbuilder)