Jim:

Here is the entire AppStart function, which came from the starter.c file provided by 
Stationery for C, and which I have added to. I am using CodeWarrior for PCP R6. Keep 
in mind that I am new to Palm programming. My goal in this test program is to receive 
character via the serial port and display a count of the number of characters received.

static Err AppStart(void)
{
    StarterPreferenceType prefs;
    Word prefsSize;
    Err err;
    char error_str[31];


    // Read the saved preferences / saved-state information.
    prefsSize = sizeof(StarterPreferenceType);
    if (PrefGetAppPreferences(appFileCreator, appPrefID, &prefs, &prefsSize, true) != 
                noPreferenceFound)
    {
    }
                
    err = SysLibFind( "Serial Libray", &refnum );
    ErrFatalDisplayIf( err, "Serial library not found" );
        
    if ( err == 0 )
    {
            err = SerOpen( refnum, 0, 19200L );
        
            if ( err )
            {
                    if ( err == serErrAlreadyOpen )
                    {
                        SerClose( refnum );
                        serial_port_open_flag = false;
                    }
            }
            else
            {
                    serial_port_open_flag = true;
            }
    }

    StrIToA( error_str, (long)serial_port_open_flag );
    WinDrawChars ( error_str, StrLen( error_str ), 10, 110 );
        
   return 0;
}

Dave Heil
Preco Electronics
208-322-4288
[EMAIL PROTECTED]



At 5:48 PM -0700 2000/02/16, David Heil wrote: 
  
  I am using a Palm Vx running PalmOS 3.3, which means I have the New Serial Manager. 
According to the documentation, the New Serial Manager has a
  compatibility layer that allows calls to the older Serial Manager to function as 
expected. The problem that I can't seem to get past is that when you use the
  following statement to get the serial library reference number, it always returns 
with an error: sysErrLibNotFound 

  error = SysLibFind( "Serial Library", &refnum ); 


Show us more of the code. According to the line above you will not see 
sysErrLibNotFound returned. Puzzling. Are you modifying the low memory
library dispatch tables? What is the code doing prior to finding the library? Did you 
boot the device with the page-up key held down? 

Regards, 

Jim Schram 

3Com/Palm Computing Partner Engineering 


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html

Reply via email to