I am currently writing a specialized application for use on our Symbol
SPT-1740 devices that will allow me to read and write the current/default
network connection. This program will be used to allow us to easily
configure different "canned" network settings as needed without having to go
into the Network Preferences Panel and set several values each time we need
to make a change (i.e. IP address, DHCP, etc).
--- Platform ---
I am using Palm OS v3.5.2 on the SPT-1740, Code Warrior version 7.1 and the
Palm 3.5 SDK. The Symbol SDK I am using is version 3.0. The spt1740.lib file
I have is dated 06/06/2000 with a time of 11:24am.
--- Background ---
I need to have the ability to determine what the current default network
service is (it's name) on the unit and then be able to read the settings for
that service (Static IP Address, DHCP, etc). The Network Preferences Panel
always loads with the default service highlighted in its drop down list box,
so I know there must be a way to determine the current service name. Once I
determine the current service name I need to read its settings.
I originally tried to use the following code to detect the current service
name, but this code does not work.
static Err GetCurrentServiceName(char *ServiceName, UInt16 maxLen)
{
Err err;
UInt16 vLen;
UInt32 creator;
UInt16 instance;
// Get creator of default interface...
vLen = sizeof(creator);
err = NetLibSettingGet(AppNetRefnum, netSettingDefaultIFCreator, &creator,
&vLen);
if ( err )
return (err);
// Get instance of default interface...
vLen = sizeof(instance);
err = NetLibSettingGet(AppNetRefnum, netSettingDefaultIFInstance,
&instance, &vLen);
if ( err )
return (err);
vLen = maxLen;
err = NetLibIFSettingGet(AppNetRefnum, creator, instance,
netIFSettingServiceName, ServiceName, &vLen);
return (err);
}
Using the above function I receive a netErrTimeout error code from the last
NetLibIFSettingGet() function call. I am calling these NetLib function
calls when NetLib is closed.
The modified version of this function shown below does what I need.
However, it never detects when the "Spectrum 24" service is the default.
static Err GetCurrentServiceName(char *ServiceName, UInt16 maxLen)
{
Err err;
UInt16 vLen;
vLen = maxLen;
err = NetLibIFSettingGet(AppNetRefnum, netIFCreatorPPP, 0,
netIFSettingServiceName, ServiceName, &vLen);
return (err);
}
--- My Problem ---
When I call this function it always returns the name of the "last" service
that was the default before I changed it to Spectrum 24. For example, if I
set the default service in the Network Preferences Panel to "Aimnet", then
set it to "Earthlink", then set it to "Spectrum 24" this function will
return "Earthlink" (the last setting before S24).
I am searching for a way to read the name of the current network service
that will include Spectrum 24 when it is the default.
(I know this appears to be a Symbol specific problem. I am sending this
message to both the symbol-forum and the palm-dev-forum because I am hoping
that this NetLib question will reach a wider audience this way.)
I currently am working with Symbol tech support to solve this problem but am
not having a lot of success. I thought I would post this question to the NG
in an effort to find a solution or perhaps a faster solution.
Thanks.
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/