Hello All,

When I try to use NetServicesProfileGetInfo(UInt16 libRefNum,
NetServicesProfileInfoP infoP) API it is always returning NULL for infoP.

I believe initially since there won't be any profiles I added a profile
using NetServicesProfileAdd(). Even after adding a profile,
NetServicesProfileGetInfo() still returns NULL for infoP. The following is
the part of the code which does this. BTW, both the APIs does not return any
errors. libRefNum is certainly valid since other NetServicesAPI are
successful.

static void ProfilesFormInit( FormPtr frmP )
{
        Err                             err;
        NetServicesProfile      tmpProfile;
        int                             i;

        err = NetServicesProfileGetInfo( gNetStat.libRef, gNetStat.profileDBPtr );
        if( err != errNone )
        {
                FrmAlert(ProfileGetInfoAlert);
                return;
        }

        if (gNetStat.profileDBPtr != NULL)
        {
                for(i = 0; i < gNetStat.profileDBPtr->numProfiles; i++)
                {
                        err = NetServicesProfileRead( gNetStat.libRef, i, &tmpProfile);

                        if (err != errNone)
                        {
                                FrmAlert(ProfileGetInfoAlert);
                                return;
                        }
                }
        }
        else
        {
                MemSet((void *)&tmpProfile, sizeof(NetServicesProfile), 0);

                StrPrintF((char *)&(tmpProfile.profileName), "Test");   /**< ASCII 
string -
profile reference. */
                StrPrintF((char *)&(tmpProfile.SSID), "Test");                  /**< 
SSID associated
with this profile. */
                tmpProfile.ssidLength = 6;                                             
 /**< Length of bytes of the SSID. */
                tmpProfile.ipAllocType = IPAllocType_DHCP;              /**< 
DHCP/STATIC/IPIPA. */
                tmpProfile.preambleType = AUTO_PREAMBLE;                /**< Long or 
short preamble. */
                tmpProfile.keyIndex = 0;                                               
 /**< WEP key index.  Only valid if wep
active. */
                tmpProfile.authentication = AUTHENTICATION_ALGORITHM_SHARED_KEY; /**< 
OPEN
/ 64 bit / 128 bit. */
                tmpProfile.opMode = ESS;                                               
 /**< BSS, IBSS. */
                tmpProfile.channel = 0;                                                
 /**< DS Channel.  Only used for ad-hoc. */
                tmpProfile.reqIP = 0;                                                  
 /**< DS Channel.  Only used for ad-hoc. */
                tmpProfile.ipMask = 0;                                                 
 /**< DS Channel.  Only used for ad-hoc. */
                tmpProfile.ipGateway = 0;                                              
 /**< IP gateway. */
                tmpProfile.dhcpRequestDNS = 1;                                  /**< 0 
= DNS info static, 1 = DNS from
DHCP. */
                tmpProfile.ipPrimaryDNS = 0;                                    /**< 
IP primary DNS. */
                tmpProfile.ipSecondaryDNS = 0;                                  /**< 
IP secondary DNS. */
                StrPrintF((char *)&(tmpProfile.wep[0]), "1111111111");          /**< 
WEP keys. Up
to 5 keys. */

                err = NetServicesProfileAdd( gNetStat.libRef, &tmpProfile);

                if (err != errNone)
                {
                        FrmAlert(ProfileGetInfoAlert);
                        return;
                }
        }

}Is it possible to access (atleast Read access) the Profiles created using
Wifi Panel ?
I am aware of the NetServices sample in the Palm SG SDK. But this sample
does not use any Profiles related API. Is there any sample code that uses
Profiles related NetServices API, that people are willing to share ?

Any help is greatly appreciated.

TIA,

Shashi



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to