toggle wifi

  • Thread starter Thread starter a
  • Start date Start date
A

a

i need to use wifi and cf reader at same time, and cf reading freezes
pda if wifi is on.

so i need to toggle wifi off/on and found some code but it is not
working:

public class WLANController
{
#region DllImports etc...
Private Enum PowerState
{
PwrDeviceUnspecified = -1,
D0 = 0, // Full On: full power, full functionality
D1 = 1, // Low Power On: fully functional at low
power/performance
D2 = 2, // Standby: partially powered with automatic wake
D3 = 3, // Sleep: partially powered with device initiated
wake
D4 = 4, // Off: unpowered
PwrDeviceMaximum = 5
}

[System.Runtime.InteropServices.DllImport("coredll.dll")]
private static extern int DevicePowerNotify(string name,
PowerState state, int flags);
[System.Runtime.InteropServices.DllImport("coredll.dll")]
private static extern int SetDevicePower(string name, int
flags, PowerState state);
#endregion

#region Public methods
/// <summary>
/// Powers down the WLAN radio.
/// </summary>
public static void PowerDownWLANRadio()
{
try
{

DevicePowerNotify(@"{98C5250D-C29A-4985-AE5F-AFE5367E5006}\TIACXWLN1",
PowerState.D4, 1);

SetDevicePower(@"{98C5250D-C29A-4985-AE5F-AFE5367E5006}\TIACXWLN1", 1,
PowerState.D4);
}
catch {}
}

/// <summary>
/// Powers up the WLAN radio.
/// </summary>
public static void PowerUpWLANRadio()
{
try
{

DevicePowerNotify(@"{98C5250D-C29A-4985-AE5F-AFE5367E5006}\TIACXWLN1",
PowerState.D0, 1);

SetDevicePower(@"{98C5250D-C29A-4985-AE5F-AFE5367E5006}\TIACXWLN1", 1,
PowerState.D0);
//GetAdapterName can only be fetched if WLAN is on, so
resorting to the fixed name I found on my HP hx4700
}
catch {}
}
#endregion
}


it is not working. I think i need to change TIACXWLN1 to whatever is
on my pda. Where do i find this value? I read that it is at the
registry location
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Power\State\Suspend
but all i see there is the guid
(98C5250D-C29A-4985-AE5F-AFE5367E5006). If I try and use that only in
the code it still doesnt work.

lastly, i saw some opennetcf code which loops through adapters. It's
the .net class but i downloaded and tried to add it as a reference but
it says it's not a .net assembly.

help?
 
Back up. The problem is that the OS or the CF card or the driver for one or
the other is *broken*. Why would you try to address this by turning off
WiFi?

Paul T.
 
the cf manufacturer assures me its not a problem with their
hardware/software.
the wifi works alone, and the cf reader works alone. The problem like i
said is when the cf reader tries to connect when wifi is on. Toggling
wifi seems like the answer.

what do you suggest?


Back up. The problem is that the OS or the CF card or the driver for one or
the other is *broken*. Why would you try to address this by turning off
WiFi?

Paul T.

i need to use wifi and cf reader at same time, and cf reading freezes
pda if wifi is on.

so i need to toggle wifi off/on and found some code but it is not
working:

public class WLANController
{
#region DllImports etc...
Private Enum PowerState
{
PwrDeviceUnspecified = -1,
D0 = 0, // Full On: full power, full functionality
D1 = 1, // Low Power On: fully functional at low
power/performance
D2 = 2, // Standby: partially powered with automatic wake
D3 = 3, // Sleep: partially powered with device initiated
wake
D4 = 4, // Off: unpowered
PwrDeviceMaximum = 5
}

[System.Runtime.InteropServices.DllImport("coredll.dll")]
private static extern int DevicePowerNotify(string name,
PowerState state, int flags);
[System.Runtime.InteropServices.DllImport("coredll.dll")]
private static extern int SetDevicePower(string name, int
flags, PowerState state);
#endregion

#region Public methods
/// <summary>
/// Powers down the WLAN radio.
/// </summary>
public static void PowerDownWLANRadio()
{
try
{

DevicePowerNotify(@"{98C5250D-C29A-4985-AE5F-AFE5367E5006}\TIACXWLN1",
PowerState.D4, 1);

SetDevicePower(@"{98C5250D-C29A-4985-AE5F-AFE5367E5006}\TIACXWLN1", 1,
PowerState.D4);
}
catch {}
}

/// <summary>
/// Powers up the WLAN radio.
/// </summary>
public static void PowerUpWLANRadio()
{
try
{

DevicePowerNotify(@"{98C5250D-C29A-4985-AE5F-AFE5367E5006}\TIACXWLN1",
PowerState.D0, 1);

SetDevicePower(@"{98C5250D-C29A-4985-AE5F-AFE5367E5006}\TIACXWLN1", 1,
PowerState.D0);
//GetAdapterName can only be fetched if WLAN is on, so
resorting to the fixed name I found on my HP hx4700
}
catch {}
}
#endregion
}


it is not working. I think i need to change TIACXWLN1 to whatever is
on my pda. Where do i find this value? I read that it is at the
registry location
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Power\State\Suspend
but all i see there is the guid
(98C5250D-C29A-4985-AE5F-AFE5367E5006). If I try and use that only in
the code it still doesnt work.

lastly, i saw some opennetcf code which loops through adapters. It's
the .net class but i downloaded and tried to add it as a reference but
it says it's not a .net assembly.

help?
 
I'd still suggest addressing the problem, rather than settling for a
work-around that is, at best, problematic. Someone is doing something
wrong. We build devices with CF and PC Card slots in them and you can read
and write to cards continuously while pounding the WiFi devices at the same
time. No problem. One or the other of the device drivers, or the OS itself
(not the MS part, but the part customized for the device by the device OEM),
is broken. I'd get them to find and fix the problem.

Paul T.

the cf manufacturer assures me its not a problem with their
hardware/software.
the wifi works alone, and the cf reader works alone. The problem like i
said is when the cf reader tries to connect when wifi is on. Toggling
wifi seems like the answer.

what do you suggest?


Back up. The problem is that the OS or the CF card or the driver for one
or
the other is *broken*. Why would you try to address this by turning off
WiFi?

Paul T.

i need to use wifi and cf reader at same time, and cf reading freezes
pda if wifi is on.

so i need to toggle wifi off/on and found some code but it is not
working:

public class WLANController
{
#region DllImports etc...
Private Enum PowerState
{
PwrDeviceUnspecified = -1,
D0 = 0, // Full On: full power, full functionality
D1 = 1, // Low Power On: fully functional at low
power/performance
D2 = 2, // Standby: partially powered with automatic wake
D3 = 3, // Sleep: partially powered with device initiated
wake
D4 = 4, // Off: unpowered
PwrDeviceMaximum = 5
}

[System.Runtime.InteropServices.DllImport("coredll.dll")]
private static extern int DevicePowerNotify(string name,
PowerState state, int flags);
[System.Runtime.InteropServices.DllImport("coredll.dll")]
private static extern int SetDevicePower(string name, int
flags, PowerState state);
#endregion

#region Public methods
/// <summary>
/// Powers down the WLAN radio.
/// </summary>
public static void PowerDownWLANRadio()
{
try
{

DevicePowerNotify(@"{98C5250D-C29A-4985-AE5F-AFE5367E5006}\TIACXWLN1",
PowerState.D4, 1);

SetDevicePower(@"{98C5250D-C29A-4985-AE5F-AFE5367E5006}\TIACXWLN1", 1,
PowerState.D4);
}
catch {}
}

/// <summary>
/// Powers up the WLAN radio.
/// </summary>
public static void PowerUpWLANRadio()
{
try
{

DevicePowerNotify(@"{98C5250D-C29A-4985-AE5F-AFE5367E5006}\TIACXWLN1",
PowerState.D0, 1);

SetDevicePower(@"{98C5250D-C29A-4985-AE5F-AFE5367E5006}\TIACXWLN1", 1,
PowerState.D0);
//GetAdapterName can only be fetched if WLAN is on, so
resorting to the fixed name I found on my HP hx4700
}
catch {}
}
#endregion
}


it is not working. I think i need to change TIACXWLN1 to whatever is
on my pda. Where do i find this value? I read that it is at the
registry location
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Power\State\Suspend
but all i see there is the guid
(98C5250D-C29A-4985-AE5F-AFE5367E5006). If I try and use that only in
the code it still doesnt work.

lastly, i saw some opennetcf code which loops through adapters. It's
the .net class but i downloaded and tried to add it as a reference but
it says it's not a .net assembly.

help?
 
ive already talked to both parties. CF Reader says it's a problem with
wifi drivers.
HP (its an hp 2490) says they have not experience any wifi problems.
They suggested a ROM update, which I did, but that was all they could
do.

i'm stuck right now and need to get this solved ASAP! Can you help me
find the wifi adapter name so I can at least try that in the code i
posted as a short term solution? An update can be done later if the
OEM decides they want to try and help.



I'd still suggest addressing the problem, rather than settling for a
work-around that is, at best, problematic. Someone is doing something
wrong. We build devices with CF and PC Card slots in them and you can read
and write to cards continuously while pounding the WiFi devices at the same
time. No problem. One or the other of the device drivers, or the OS itself
(not the MS part, but the part customized for the device by the device OEM),
is broken. I'd get them to find and fix the problem.

Paul T.

the cf manufacturer assures me its not a problem with their
hardware/software.
the wifi works alone, and the cf reader works alone. The problem like i
said is when the cf reader tries to connect when wifi is on. Toggling
wifi seems like the answer.

what do you suggest?


Back up. The problem is that the OS or the CF card or the driver for one
or
the other is *broken*. Why would you try to address this by turning off
WiFi?

Paul T.

i need to use wifi and cf reader at same time, and cf reading freezes
pda if wifi is on.

so i need to toggle wifi off/on and found some code but it is not
working:

public class WLANController
{
#region DllImports etc...
Private Enum PowerState
{
PwrDeviceUnspecified = -1,
D0 = 0, // Full On: full power, full functionality
D1 = 1, // Low Power On: fully functional at low
power/performance
D2 = 2, // Standby: partially powered with automatic wake
D3 = 3, // Sleep: partially powered with device initiated
wake
D4 = 4, // Off: unpowered
PwrDeviceMaximum = 5
}

[System.Runtime.InteropServices.DllImport("coredll.dll")]
private static extern int DevicePowerNotify(string name,
PowerState state, int flags);
[System.Runtime.InteropServices.DllImport("coredll.dll")]
private static extern int SetDevicePower(string name, int
flags, PowerState state);
#endregion

#region Public methods
/// <summary>
/// Powers down the WLAN radio.
/// </summary>
public static void PowerDownWLANRadio()
{
try
{

DevicePowerNotify(@"{98C5250D-C29A-4985-AE5F-AFE5367E5006}\TIACXWLN1",
PowerState.D4, 1);

SetDevicePower(@"{98C5250D-C29A-4985-AE5F-AFE5367E5006}\TIACXWLN1", 1,
PowerState.D4);
}
catch {}
}

/// <summary>
/// Powers up the WLAN radio.
/// </summary>
public static void PowerUpWLANRadio()
{
try
{

DevicePowerNotify(@"{98C5250D-C29A-4985-AE5F-AFE5367E5006}\TIACXWLN1",
PowerState.D0, 1);

SetDevicePower(@"{98C5250D-C29A-4985-AE5F-AFE5367E5006}\TIACXWLN1", 1,
PowerState.D0);
//GetAdapterName can only be fetched if WLAN is on, so
resorting to the fixed name I found on my HP hx4700
}
catch {}
}
#endregion
}


it is not working. I think i need to change TIACXWLN1 to whatever is
on my pda. Where do i find this value? I read that it is at the
registry location
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Power\State\Suspend
but all i see there is the guid
(98C5250D-C29A-4985-AE5F-AFE5367E5006). If I try and use that only in
the code it still doesnt work.

lastly, i saw some opennetcf code which loops through adapters. It's
the .net class but i downloaded and tried to add it as a reference but
it says it's not a .net assembly.

help?
 
You can enumerate the available adapters using OpenNETCF's SDF. The .Net
namespace has that ability.

Paul T.

ive already talked to both parties. CF Reader says it's a problem with
wifi drivers.
HP (its an hp 2490) says they have not experience any wifi problems.
They suggested a ROM update, which I did, but that was all they could
do.

i'm stuck right now and need to get this solved ASAP! Can you help me
find the wifi adapter name so I can at least try that in the code i
posted as a short term solution? An update can be done later if the
OEM decides they want to try and help.



I'd still suggest addressing the problem, rather than settling for a
work-around that is, at best, problematic. Someone is doing something
wrong. We build devices with CF and PC Card slots in them and you can
read
and write to cards continuously while pounding the WiFi devices at the
same
time. No problem. One or the other of the device drivers, or the OS
itself
(not the MS part, but the part customized for the device by the device
OEM),
is broken. I'd get them to find and fix the problem.

Paul T.

the cf manufacturer assures me its not a problem with their
hardware/software.
the wifi works alone, and the cf reader works alone. The problem like i
said is when the cf reader tries to connect when wifi is on. Toggling
wifi seems like the answer.

what do you suggest?



Paul G. Tobey [eMVP] wrote:
Back up. The problem is that the OS or the CF card or the driver for
one
or
the other is *broken*. Why would you try to address this by turning
off
WiFi?

Paul T.

i need to use wifi and cf reader at same time, and cf reading freezes
pda if wifi is on.

so i need to toggle wifi off/on and found some code but it is not
working:

public class WLANController
{
#region DllImports etc...
Private Enum PowerState
{
PwrDeviceUnspecified = -1,
D0 = 0, // Full On: full power, full functionality
D1 = 1, // Low Power On: fully functional at low
power/performance
D2 = 2, // Standby: partially powered with automatic wake
D3 = 3, // Sleep: partially powered with device initiated
wake
D4 = 4, // Off: unpowered
PwrDeviceMaximum = 5
}

[System.Runtime.InteropServices.DllImport("coredll.dll")]
private static extern int DevicePowerNotify(string name,
PowerState state, int flags);
[System.Runtime.InteropServices.DllImport("coredll.dll")]
private static extern int SetDevicePower(string name, int
flags, PowerState state);
#endregion

#region Public methods
/// <summary>
/// Powers down the WLAN radio.
/// </summary>
public static void PowerDownWLANRadio()
{
try
{

DevicePowerNotify(@"{98C5250D-C29A-4985-AE5F-AFE5367E5006}\TIACXWLN1",
PowerState.D4, 1);

SetDevicePower(@"{98C5250D-C29A-4985-AE5F-AFE5367E5006}\TIACXWLN1",
1,
PowerState.D4);
}
catch {}
}

/// <summary>
/// Powers up the WLAN radio.
/// </summary>
public static void PowerUpWLANRadio()
{
try
{

DevicePowerNotify(@"{98C5250D-C29A-4985-AE5F-AFE5367E5006}\TIACXWLN1",
PowerState.D0, 1);

SetDevicePower(@"{98C5250D-C29A-4985-AE5F-AFE5367E5006}\TIACXWLN1",
1,
PowerState.D0);
//GetAdapterName can only be fetched if WLAN is on, so
resorting to the fixed name I found on my HP hx4700
}
catch {}
}
#endregion
}


it is not working. I think i need to change TIACXWLN1 to whatever is
on my pda. Where do i find this value? I read that it is at the
registry location
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Power\State\Suspend
but all i see there is the guid
(98C5250D-C29A-4985-AE5F-AFE5367E5006). If I try and use that only in
the code it still doesnt work.

lastly, i saw some opennetcf code which loops through adapters. It's
the .net class but i downloaded and tried to add it as a reference
but
it says it's not a .net assembly.

help?
 
then there is the problem like i stated at the bottom of my 1st post.

i downloaded the OpenNETCF .net library, but when i try to add it as a
reference, it says it's not a .NET assembly.




You can enumerate the available adapters using OpenNETCF's SDF. The .Net
namespace has that ability.

Paul T.

ive already talked to both parties. CF Reader says it's a problem with
wifi drivers.
HP (its an hp 2490) says they have not experience any wifi problems.
They suggested a ROM update, which I did, but that was all they could
do.

i'm stuck right now and need to get this solved ASAP! Can you help me
find the wifi adapter name so I can at least try that in the code i
posted as a short term solution? An update can be done later if the
OEM decides they want to try and help.



I'd still suggest addressing the problem, rather than settling for a
work-around that is, at best, problematic. Someone is doing something
wrong. We build devices with CF and PC Card slots in them and you can
read
and write to cards continuously while pounding the WiFi devices at the
same
time. No problem. One or the other of the device drivers, or the OS
itself
(not the MS part, but the part customized for the device by the device
OEM),
is broken. I'd get them to find and fix the problem.

Paul T.

the cf manufacturer assures me its not a problem with their
hardware/software.
the wifi works alone, and the cf reader works alone. The problem like i
said is when the cf reader tries to connect when wifi is on. Toggling
wifi seems like the answer.

what do you suggest?



Paul G. Tobey [eMVP] wrote:
Back up. The problem is that the OS or the CF card or the driver for
one
or
the other is *broken*. Why would you try to address this by turning
off
WiFi?

Paul T.

i need to use wifi and cf reader at same time, and cf reading freezes
pda if wifi is on.

so i need to toggle wifi off/on and found some code but it is not
working:

public class WLANController
{
#region DllImports etc...
Private Enum PowerState
{
PwrDeviceUnspecified = -1,
D0 = 0, // Full On: full power, full functionality
D1 = 1, // Low Power On: fully functional at low
power/performance
D2 = 2, // Standby: partially powered with automatic wake
D3 = 3, // Sleep: partially powered with device initiated
wake
D4 = 4, // Off: unpowered
PwrDeviceMaximum = 5
}

[System.Runtime.InteropServices.DllImport("coredll.dll")]
private static extern int DevicePowerNotify(string name,
PowerState state, int flags);
[System.Runtime.InteropServices.DllImport("coredll.dll")]
private static extern int SetDevicePower(string name, int
flags, PowerState state);
#endregion

#region Public methods
/// <summary>
/// Powers down the WLAN radio.
/// </summary>
public static void PowerDownWLANRadio()
{
try
{

DevicePowerNotify(@"{98C5250D-C29A-4985-AE5F-AFE5367E5006}\TIACXWLN1",
PowerState.D4, 1);

SetDevicePower(@"{98C5250D-C29A-4985-AE5F-AFE5367E5006}\TIACXWLN1",
1,
PowerState.D4);
}
catch {}
}

/// <summary>
/// Powers up the WLAN radio.
/// </summary>
public static void PowerUpWLANRadio()
{
try
{

DevicePowerNotify(@"{98C5250D-C29A-4985-AE5F-AFE5367E5006}\TIACXWLN1",
PowerState.D0, 1);

SetDevicePower(@"{98C5250D-C29A-4985-AE5F-AFE5367E5006}\TIACXWLN1",
1,
PowerState.D0);
//GetAdapterName can only be fetched if WLAN is on, so
resorting to the fixed name I found on my HP hx4700
}
catch {}
}
#endregion
}


it is not working. I think i need to change TIACXWLN1 to whatever is
on my pda. Where do i find this value? I read that it is at the
registry location
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Power\State\Suspend
but all i see there is the guid
(98C5250D-C29A-4985-AE5F-AFE5367E5006). If I try and use that only in
the code it still doesnt work.

lastly, i saw some opennetcf code which loops through adapters. It's
the .net class but i downloaded and tried to add it as a reference
but
it says it's not a .net assembly.

help?
 
Sounds like you're trying to add it to a desktop project or something. I'm
not an expert on the installation stuff for OpenNETCF. Generally, though,
it *does* work. If you're trying to use SDF 1.4, you can get the source
code, if you can't figure out another way, and just add it to your project.

Walk us through the steps that you're performing to create a new Hello,
World application targeted at the Windows CE device, what you do to add the
OpenNETCF code, etc. Maybe I, or someone else here, can spot what you're
doing wrong...

Paul T.

then there is the problem like i stated at the bottom of my 1st post.

i downloaded the OpenNETCF .net library, but when i try to add it as a
reference, it says it's not a .NET assembly.




You can enumerate the available adapters using OpenNETCF's SDF. The .Net
namespace has that ability.

Paul T.

ive already talked to both parties. CF Reader says it's a problem with
wifi drivers.
HP (its an hp 2490) says they have not experience any wifi problems.
They suggested a ROM update, which I did, but that was all they could
do.

i'm stuck right now and need to get this solved ASAP! Can you help me
find the wifi adapter name so I can at least try that in the code i
posted as a short term solution? An update can be done later if the
OEM decides they want to try and help.



I'd still suggest addressing the problem, rather than settling for a
work-around that is, at best, problematic. Someone is doing something
wrong. We build devices with CF and PC Card slots in them and you can
read
and write to cards continuously while pounding the WiFi devices at the
same
time. No problem. One or the other of the device drivers, or the OS
itself
(not the MS part, but the part customized for the device by the device
OEM),
is broken. I'd get them to find and fix the problem.

Paul T.

the cf manufacturer assures me its not a problem with their
hardware/software.
the wifi works alone, and the cf reader works alone. The problem like
i
said is when the cf reader tries to connect when wifi is on. Toggling
wifi seems like the answer.

what do you suggest?



Paul G. Tobey [eMVP] wrote:
Back up. The problem is that the OS or the CF card or the driver for
one
or
the other is *broken*. Why would you try to address this by turning
off
WiFi?

Paul T.

i need to use wifi and cf reader at same time, and cf reading
freezes
pda if wifi is on.

so i need to toggle wifi off/on and found some code but it is not
working:

public class WLANController
{
#region DllImports etc...
Private Enum PowerState
{
PwrDeviceUnspecified = -1,
D0 = 0, // Full On: full power, full functionality
D1 = 1, // Low Power On: fully functional at low
power/performance
D2 = 2, // Standby: partially powered with automatic
wake
D3 = 3, // Sleep: partially powered with device
initiated
wake
D4 = 4, // Off: unpowered
PwrDeviceMaximum = 5
}

[System.Runtime.InteropServices.DllImport("coredll.dll")]
private static extern int DevicePowerNotify(string name,
PowerState state, int flags);
[System.Runtime.InteropServices.DllImport("coredll.dll")]
private static extern int SetDevicePower(string name, int
flags, PowerState state);
#endregion

#region Public methods
/// <summary>
/// Powers down the WLAN radio.
/// </summary>
public static void PowerDownWLANRadio()
{
try
{

DevicePowerNotify(@"{98C5250D-C29A-4985-AE5F-AFE5367E5006}\TIACXWLN1",
PowerState.D4, 1);

SetDevicePower(@"{98C5250D-C29A-4985-AE5F-AFE5367E5006}\TIACXWLN1",
1,
PowerState.D4);
}
catch {}
}

/// <summary>
/// Powers up the WLAN radio.
/// </summary>
public static void PowerUpWLANRadio()
{
try
{

DevicePowerNotify(@"{98C5250D-C29A-4985-AE5F-AFE5367E5006}\TIACXWLN1",
PowerState.D0, 1);

SetDevicePower(@"{98C5250D-C29A-4985-AE5F-AFE5367E5006}\TIACXWLN1",
1,
PowerState.D0);
//GetAdapterName can only be fetched if WLAN is on,
so
resorting to the fixed name I found on my HP hx4700
}
catch {}
}
#endregion
}


it is not working. I think i need to change TIACXWLN1 to whatever
is
on my pda. Where do i find this value? I read that it is at the
registry location
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Power\State\Suspend
but all i see there is the guid
(98C5250D-C29A-4985-AE5F-AFE5367E5006). If I try and use that only
in
the code it still doesnt work.

lastly, i saw some opennetcf code which loops through adapters.
It's
the .net class but i downloaded and tried to add it as a reference
but
it says it's not a .net assembly.

help?
 
it looks like the OS is the problem. Tried it on PPC 2003 and it works
fine, the trouble is on WM5.

also, i think maybe i cant add the opennetcf .net library becauase i
am using 1.1 .net sdk. I'll try upgrading it to 2.0 and see what
happens. I can add the 2003 opennetcf lib. (for v 1.1 sdk?) so i think
this must be the problem.



Sounds like you're trying to add it to a desktop project or something. I'm
not an expert on the installation stuff for OpenNETCF. Generally, though,
it *does* work. If you're trying to use SDF 1.4, you can get the source
code, if you can't figure out another way, and just add it to your project.

Walk us through the steps that you're performing to create a new Hello,
World application targeted at the Windows CE device, what you do to add the
OpenNETCF code, etc. Maybe I, or someone else here, can spot what you're
doing wrong...

Paul T.

then there is the problem like i stated at the bottom of my 1st post.

i downloaded the OpenNETCF .net library, but when i try to add it as a
reference, it says it's not a .NET assembly.




You can enumerate the available adapters using OpenNETCF's SDF. The .Net
namespace has that ability.

Paul T.


ive already talked to both parties. CF Reader says it's a problem with
wifi drivers.
HP (its an hp 2490) says they have not experience any wifi problems.
They suggested a ROM update, which I did, but that was all they could
do.

i'm stuck right now and need to get this solved ASAP! Can you help me
find the wifi adapter name so I can at least try that in the code i
posted as a short term solution? An update can be done later if the
OEM decides they want to try and help.



I'd still suggest addressing the problem, rather than settling for a
work-around that is, at best, problematic. Someone is doing something
wrong. We build devices with CF and PC Card slots in them and you can
read
and write to cards continuously while pounding the WiFi devices at the
same
time. No problem. One or the other of the device drivers, or the OS
itself
(not the MS part, but the part customized for the device by the device
OEM),
is broken. I'd get them to find and fix the problem.

Paul T.

the cf manufacturer assures me its not a problem with their
hardware/software.
the wifi works alone, and the cf reader works alone. The problem like
i
said is when the cf reader tries to connect when wifi is on. Toggling
wifi seems like the answer.

what do you suggest?



Paul G. Tobey [eMVP] wrote:
Back up. The problem is that the OS or the CF card or the driver for
one
or
the other is *broken*. Why would you try to address this by turning
off
WiFi?

Paul T.

i need to use wifi and cf reader at same time, and cf reading
freezes
pda if wifi is on.

so i need to toggle wifi off/on and found some code but it is not
working:

public class WLANController
{
#region DllImports etc...
Private Enum PowerState
{
PwrDeviceUnspecified = -1,
D0 = 0, // Full On: full power, full functionality
D1 = 1, // Low Power On: fully functional at low
power/performance
D2 = 2, // Standby: partially powered with automatic
wake
D3 = 3, // Sleep: partially powered with device
initiated
wake
D4 = 4, // Off: unpowered
PwrDeviceMaximum = 5
}

[System.Runtime.InteropServices.DllImport("coredll.dll")]
private static extern int DevicePowerNotify(string name,
PowerState state, int flags);
[System.Runtime.InteropServices.DllImport("coredll.dll")]
private static extern int SetDevicePower(string name, int
flags, PowerState state);
#endregion

#region Public methods
/// <summary>
/// Powers down the WLAN radio.
/// </summary>
public static void PowerDownWLANRadio()
{
try
{

DevicePowerNotify(@"{98C5250D-C29A-4985-AE5F-AFE5367E5006}\TIACXWLN1",
PowerState.D4, 1);

SetDevicePower(@"{98C5250D-C29A-4985-AE5F-AFE5367E5006}\TIACXWLN1",
1,
PowerState.D4);
}
catch {}
}

/// <summary>
/// Powers up the WLAN radio.
/// </summary>
public static void PowerUpWLANRadio()
{
try
{

DevicePowerNotify(@"{98C5250D-C29A-4985-AE5F-AFE5367E5006}\TIACXWLN1",
PowerState.D0, 1);

SetDevicePower(@"{98C5250D-C29A-4985-AE5F-AFE5367E5006}\TIACXWLN1",
1,
PowerState.D0);
//GetAdapterName can only be fetched if WLAN is on,
so
resorting to the fixed name I found on my HP hx4700
}
catch {}
}
#endregion
}


it is not working. I think i need to change TIACXWLN1 to whatever
is
on my pda. Where do i find this value? I read that it is at the
registry location
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Power\State\Suspend
but all i see there is the guid
(98C5250D-C29A-4985-AE5F-AFE5367E5006). If I try and use that only
in
the code it still doesnt work.

lastly, i saw some opennetcf code which loops through adapters.
It's
the .net class but i downloaded and tried to add it as a reference
but
it says it's not a .net assembly.

help?
 
There's no such thing as .NET CF 1.1!!! If you are using any assemblies
from .NET 1.1, you are using things that will not work on any WM device 5 or
earlier. I've used the OpenNETCF stuff on WM5 and it works just fine. SDF
1.4, as distributed in binary form, is for .NET CF 1.0, so that might be a
problem, but the code itself, when properly targeted, works fine with WM5.

Paul T.

it looks like the OS is the problem. Tried it on PPC 2003 and it works
fine, the trouble is on WM5.

also, i think maybe i cant add the opennetcf .net library becauase i
am using 1.1 .net sdk. I'll try upgrading it to 2.0 and see what
happens. I can add the 2003 opennetcf lib. (for v 1.1 sdk?) so i think
this must be the problem.



Sounds like you're trying to add it to a desktop project or something.
I'm
not an expert on the installation stuff for OpenNETCF. Generally, though,
it *does* work. If you're trying to use SDF 1.4, you can get the source
code, if you can't figure out another way, and just add it to your
project.

Walk us through the steps that you're performing to create a new Hello,
World application targeted at the Windows CE device, what you do to add
the
OpenNETCF code, etc. Maybe I, or someone else here, can spot what you're
doing wrong...

Paul T.

then there is the problem like i stated at the bottom of my 1st post.

i downloaded the OpenNETCF .net library, but when i try to add it as a
reference, it says it's not a .NET assembly.




You can enumerate the available adapters using OpenNETCF's SDF. The
.Net
namespace has that ability.

Paul T.


ive already talked to both parties. CF Reader says it's a problem with
wifi drivers.
HP (its an hp 2490) says they have not experience any wifi problems.
They suggested a ROM update, which I did, but that was all they could
do.

i'm stuck right now and need to get this solved ASAP! Can you help me
find the wifi adapter name so I can at least try that in the code i
posted as a short term solution? An update can be done later if the
OEM decides they want to try and help.



I'd still suggest addressing the problem, rather than settling for a
work-around that is, at best, problematic. Someone is doing something
wrong. We build devices with CF and PC Card slots in them and you can
read
and write to cards continuously while pounding the WiFi devices at the
same
time. No problem. One or the other of the device drivers, or the OS
itself
(not the MS part, but the part customized for the device by the device
OEM),
is broken. I'd get them to find and fix the problem.

Paul T.

the cf manufacturer assures me its not a problem with their
hardware/software.
the wifi works alone, and the cf reader works alone. The problem
like
i
said is when the cf reader tries to connect when wifi is on.
Toggling
wifi seems like the answer.

what do you suggest?



Paul G. Tobey [eMVP] wrote:
Back up. The problem is that the OS or the CF card or the driver
for
one
or
the other is *broken*. Why would you try to address this by
turning
off
WiFi?

Paul T.

i need to use wifi and cf reader at same time, and cf reading
freezes
pda if wifi is on.

so i need to toggle wifi off/on and found some code but it is not
working:

public class WLANController
{
#region DllImports etc...
Private Enum PowerState
{
PwrDeviceUnspecified = -1,
D0 = 0, // Full On: full power, full functionality
D1 = 1, // Low Power On: fully functional at low
power/performance
D2 = 2, // Standby: partially powered with automatic
wake
D3 = 3, // Sleep: partially powered with device
initiated
wake
D4 = 4, // Off: unpowered
PwrDeviceMaximum = 5
}

[System.Runtime.InteropServices.DllImport("coredll.dll")]
private static extern int DevicePowerNotify(string name,
PowerState state, int flags);
[System.Runtime.InteropServices.DllImport("coredll.dll")]
private static extern int SetDevicePower(string name, int
flags, PowerState state);
#endregion

#region Public methods
/// <summary>
/// Powers down the WLAN radio.
/// </summary>
public static void PowerDownWLANRadio()
{
try
{

DevicePowerNotify(@"{98C5250D-C29A-4985-AE5F-AFE5367E5006}\TIACXWLN1",
PowerState.D4, 1);

SetDevicePower(@"{98C5250D-C29A-4985-AE5F-AFE5367E5006}\TIACXWLN1",
1,
PowerState.D4);
}
catch {}
}

/// <summary>
/// Powers up the WLAN radio.
/// </summary>
public static void PowerUpWLANRadio()
{
try
{

DevicePowerNotify(@"{98C5250D-C29A-4985-AE5F-AFE5367E5006}\TIACXWLN1",
PowerState.D0, 1);

SetDevicePower(@"{98C5250D-C29A-4985-AE5F-AFE5367E5006}\TIACXWLN1",
1,
PowerState.D0);
//GetAdapterName can only be fetched if WLAN is
on,
so
resorting to the fixed name I found on my HP hx4700
}
catch {}
}
#endregion
}


it is not working. I think i need to change TIACXWLN1 to whatever
is
on my pda. Where do i find this value? I read that it is at the
registry location
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Power\State\Suspend
but all i see there is the guid
(98C5250D-C29A-4985-AE5F-AFE5367E5006). If I try and use that
only
in
the code it still doesnt work.

lastly, i saw some opennetcf code which loops through adapters.
It's
the .net class but i downloaded and tried to add it as a
reference
but
it says it's not a .net assembly.

help?
 
SDF 2.0 requires CF 2.0.
SDF 1.x required CF 1.0

-Chris


it looks like the OS is the problem. Tried it on PPC 2003 and it works
fine, the trouble is on WM5.

also, i think maybe i cant add the opennetcf .net library becauase i
am using 1.1 .net sdk. I'll try upgrading it to 2.0 and see what
happens. I can add the 2003 opennetcf lib. (for v 1.1 sdk?) so i think
this must be the problem.



Sounds like you're trying to add it to a desktop project or something.
I'm
not an expert on the installation stuff for OpenNETCF. Generally, though,
it *does* work. If you're trying to use SDF 1.4, you can get the source
code, if you can't figure out another way, and just add it to your
project.

Walk us through the steps that you're performing to create a new Hello,
World application targeted at the Windows CE device, what you do to add
the
OpenNETCF code, etc. Maybe I, or someone else here, can spot what you're
doing wrong...

Paul T.

then there is the problem like i stated at the bottom of my 1st post.

i downloaded the OpenNETCF .net library, but when i try to add it as a
reference, it says it's not a .NET assembly.




You can enumerate the available adapters using OpenNETCF's SDF. The
.Net
namespace has that ability.

Paul T.


ive already talked to both parties. CF Reader says it's a problem with
wifi drivers.
HP (its an hp 2490) says they have not experience any wifi problems.
They suggested a ROM update, which I did, but that was all they could
do.

i'm stuck right now and need to get this solved ASAP! Can you help me
find the wifi adapter name so I can at least try that in the code i
posted as a short term solution? An update can be done later if the
OEM decides they want to try and help.



I'd still suggest addressing the problem, rather than settling for a
work-around that is, at best, problematic. Someone is doing something
wrong. We build devices with CF and PC Card slots in them and you can
read
and write to cards continuously while pounding the WiFi devices at the
same
time. No problem. One or the other of the device drivers, or the OS
itself
(not the MS part, but the part customized for the device by the device
OEM),
is broken. I'd get them to find and fix the problem.

Paul T.

the cf manufacturer assures me its not a problem with their
hardware/software.
the wifi works alone, and the cf reader works alone. The problem
like
i
said is when the cf reader tries to connect when wifi is on.
Toggling
wifi seems like the answer.

what do you suggest?



Paul G. Tobey [eMVP] wrote:
Back up. The problem is that the OS or the CF card or the driver
for
one
or
the other is *broken*. Why would you try to address this by
turning
off
WiFi?

Paul T.

i need to use wifi and cf reader at same time, and cf reading
freezes
pda if wifi is on.

so i need to toggle wifi off/on and found some code but it is not
working:

public class WLANController
{
#region DllImports etc...
Private Enum PowerState
{
PwrDeviceUnspecified = -1,
D0 = 0, // Full On: full power, full functionality
D1 = 1, // Low Power On: fully functional at low
power/performance
D2 = 2, // Standby: partially powered with automatic
wake
D3 = 3, // Sleep: partially powered with device
initiated
wake
D4 = 4, // Off: unpowered
PwrDeviceMaximum = 5
}

[System.Runtime.InteropServices.DllImport("coredll.dll")]
private static extern int DevicePowerNotify(string name,
PowerState state, int flags);
[System.Runtime.InteropServices.DllImport("coredll.dll")]
private static extern int SetDevicePower(string name, int
flags, PowerState state);
#endregion

#region Public methods
/// <summary>
/// Powers down the WLAN radio.
/// </summary>
public static void PowerDownWLANRadio()
{
try
{

DevicePowerNotify(@"{98C5250D-C29A-4985-AE5F-AFE5367E5006}\TIACXWLN1",
PowerState.D4, 1);

SetDevicePower(@"{98C5250D-C29A-4985-AE5F-AFE5367E5006}\TIACXWLN1",
1,
PowerState.D4);
}
catch {}
}

/// <summary>
/// Powers up the WLAN radio.
/// </summary>
public static void PowerUpWLANRadio()
{
try
{

DevicePowerNotify(@"{98C5250D-C29A-4985-AE5F-AFE5367E5006}\TIACXWLN1",
PowerState.D0, 1);

SetDevicePower(@"{98C5250D-C29A-4985-AE5F-AFE5367E5006}\TIACXWLN1",
1,
PowerState.D0);
//GetAdapterName can only be fetched if WLAN is
on,
so
resorting to the fixed name I found on my HP hx4700
}
catch {}
}
#endregion
}


it is not working. I think i need to change TIACXWLN1 to whatever
is
on my pda. Where do i find this value? I read that it is at the
registry location
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Power\State\Suspend
but all i see there is the guid
(98C5250D-C29A-4985-AE5F-AFE5367E5006). If I try and use that
only
in
the code it still doesnt work.

lastly, i saw some opennetcf code which loops through adapters.
It's
the .net class but i downloaded and tried to add it as a
reference
but
it says it's not a .net assembly.

help?
 
Back
Top