![]() |
![]() |
![]() |
![]() |
.h declares the connection manager API. For more information on the connection manager, see the chapter Serial Communication in the Palm OS Programmer's Companion.
Err CncAddProfile(Char *name, UInt32 port, UInt32 baud, UInt16 volume, UInt16 handShake, Char *initString, Char *resetString, Boolean isModem, Boolean isPulse)
|   |
<-> |
Pointer to the profile name to be added. If the name is already taken in the Connection Panel then a duplication number is appended to it. The name added is returned here. |
|   |
-> |
The port identification used by the profile. |
|   |
-> |
The baud rate used by the profile. |
|   |
-> |
The volume setting for the device (for Modem only). |
|   |
-> |
Flow control setting (hardware handshaking). 0 specifies automatic (on at speeds > 2400 baud), 1 specifies always on, and 2 specifies always off. |
|   |
-> |
Pointer to the initialization string used by a modem (for Modem only). |
|   |
-> |
Pointer to the reset string used by a modem (for Modem only). |
|   |
-> |
true if Modem, false if Direct. |
|   |
-> |
true if Pulse dial, false if TouchTone. |
AddMyProfile(){    Char *myConNameP;    Err err;    myConNameP = MemPtrNew(cncProfileNameSize);    StrCopy(myConNameP, "Foobar");    err = CncAddProfile(myConNameP, `u328', 57600, 0, 0, "AT&FX4", 0, true, false);    MemPtrFree(myConNameP);}Err CncDeleteProfile(Char *name)
void DeleteProfile(Char *name)    {    Err err;    //Call Connection Manager to delete the     //named profile    err = CncDeleteProfile(name);    }Err CncGetProfileInfo(Char *name, UInt32 *port, UInt32 *baud, UInt16 *volume, UInt16 *handShake, Char *initString, Char *resetString, Boolean * isModem, Boolean * isPulse)
|   |
-> |
Pointer to the name of the profile to be returned. Passing in NULL causes this function to return the settings for the profile currently selected in the Connection Panel. |
|   |
<- |
Pointer to the port identifier that the profile uses. |
|   |
<- |
Pointer to the baud rate that has been set for this profile. |
|   |
<- |
Pointer to the volume of the device (applies only to modems). |
|   |
<- |
Pointer to the flow control setting (hardware handshaking). 0 indicates automatic (on at speeds > 2400 baud), 1 indicates always on, and 2 indicates always off. |
|   |
<- |
Pointer to the initialization string for the device (applies only to modems). |
|   |
<- |
Pointer to the reset string for the device (applies only to modems). |
|   |
<- |
Pointer to a Boolean value: true for Modem, false for Direct. |
|   |
<- |
Pointer to a Boolean value: true for Pulse dial, false for TouchTone. |
NULL if that information is not desired.
    {    UInt32 portID, baud;    UInt16 openPort;    // get port id    err = CncGetProfileInfo("Direct Serial", &portID, &baud, 0, 0, 0, 0, 0, 0);    if(!err)    { // open the port    SrmOpen(portID, baud, &openPort);    }    }Err CncGetProfileList(Char *** nameListP, UInt16 * count)
|   |
<- |
Pointer to a pointer to a list of profile names. |
|   |
<- |
Pointer to the number of profile names. |
    //Declared globally    Char ** globalProfileList;    ListType *listP;    UInt16 globalProfileCount;    void SetConnectionList()    {    //Get the list from the Connection Manager    err = CncGetProfileList(&globalProfileList, &globalProfileCount);    //Set the UI list    LstSetListChoices(listP, globalProfileList, globalProfileCount);    }    void StopApplication()    {    UInt16 i;    //Deallocate the connection list    For(i = 0; i < globalProfileCount; i++)    MemPtrFree(globalProfileList[ i ]);    MemPtrFree(globalProfileList);    }|   | ![]() |
![]() |
![]() |
![]() |
  |