Description
The network library runs on all Palm OS devices using OS 3.3 and higher.
It even runs on OS 5 devices, including the Tungsten T, Sony TG50 and others! The library is a compile-time library that you link into your product.
There is no separate PRC file to deliver to the users of your application. The library is royalty-free, meaning you can use it in
all your products no matter how many copies you sell. All you pay is a low upfront license fee. Click
here to read the full license agreement.
The network library is accompanied by a C header file that is reproduced below (with some deliberate errors). You
also get a fully working application (Net Sync) that uses the library. Net Sync is provided as a Metrowerks
CodeWarrior project.
#pragma mark ***** Error Codes
#define PE_ErrorClass 0x9000
#define PE_ErrNone errNone // Zero
#define PE_ErrParameter (PE_ErrorClass | 1) // Invalid parameter passed to function
#define PE_ErrOSIncompatible (PE_ErrorClass | 2) // Wrong OS version (only 3.3 and higher)
#define PE_ErrDatabaseReadWrite (PE_ErrorClass | 3) // Error reading / writing to network service
#define PE_ErrNoSuchRecord (PE_ErrorClass | 4) // Specified record doesn't exist
#define PE_ErrNoMemory (PE_ErrorClass | 5) // Insufficient memory
#pragma mark ***** Defines
#define PE_NEW_RECORD dmMaxRecordIndex // Create a new record
#define PE_SERVICE_NAME_LEN 32 // Max length of network service name
#define PE_CONN_NAME_LEN 22 // Max length of connection name
#pragma mark ***** Structures
typedef struct PE_ServiceListType
{
Char service[PE_SERVICE_NAME_LEN]; // name of service
Char connection[PE_CONN_NAME_LEN]; // name of connection the service uses
UInt16 recordNum; // the record number of the service
} PE_ServiceListType;
typedef struct PE_ServicePreferencesType
{
UInt32 interface; // 'slip', 'ppp-' or 'loop'
UInt32 ipAddr; // IP address if static
UInt32 primaryDNS; // Primary DNS server if static
UInt32 secondaryDNS; // Secondary DNS server if static
UInt32 closeWaitTime; // Wait before closing connection after NetLibClose
UInt16 inactivityTimer; // Wait before closing connection due to inactivity
UInt16 establishmentTimeout; // Time before giving up on connection establishment
UInt8 reserved; // Not used
UInt8 reserved2:6; // Not used
UInt8 useVJCompression:1; // Use VJ header compression
UInt8 useModem:1; // Use modem (phone number) to connect
MemHandle serviceNameH; // Name of the service
MemHandle usernameH; // Username
MemHandle passwordH; // Password
MemHandle loginScriptH; // Login script (each line is NULL terminated)
MemHandle connectionH; // Connection to use (from connection database)
} PE_ServicePreferencesType;
typedef struct PE_PhonePreferencesType
{
UInt16 reserved: 12; // reserved
UInt16 dialPrefixEnabled:1; // dial prefix string provided
UInt16 callWaitingEnabled:1; // call waiting string provided
UInt16 callingCardEnabled:1; // calling card string provided
UInt16 pulseDial:1; // pulse dial or touch-tone
MemHandle phoneNoH; // phone number
MemHandle prefixH; // dial prefix
MemHandle callWaitingH; // call waiting string
MemHandle callingCardH; // calling card number string
} PE_PhonePreferencesType;
#pragma mark ***** Functions
const Char *PE_GetLibraryVersion();
UInt16 PE_GetActiveService();
Err PE_SetActiveService(UInt16 recordNum);
UInt32 PE_GetRecordIDFromNumber(UInt16 recordNum);
Err PE_GetServiceList(UInt16 *numOfServices, PE_ServiceListType **serviceList);
Err PE_SaveService(UInt16 recordNum, UInt16 *newRecord, PE_ServicePreferencesType *service, \
PE_PhonePreferencesType *phone);
Err PE_LoadService(UInt16 recordNum, PE_ServicePreferencesType *service, \
PE_PhonePreferencesType *phone);
Err PE_FreeService(PE_ServicePreferencesType *service, PE_PhonePreferencesType *phone);
Click
here to return to the previous page.
© Whizoo 2008