Re: OpenNETCF SetWirelessSettings
- From: "Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT com>
- Date: Thu, 3 May 2007 08:38:46 -0700
OK, that's the wrong method of getting the key. That's five characters that
you've got there, not 10. The characters are ASCII 11(hex), 48(hex),
bc(hex), 46(hex), and 67(hex). If you use the byte array version of the
SetWirelessSettings call, passing { 0x11, 0x48, 0xbc, 0x46, 0x67 }, you
should get the same thing as when you enter that string in the UI. It's
just a matter of you not extracting the bytes for the key the same way as
the WZC UI is doing it.
ActiveSync wants to be sure that you aren't connected via WiFi or GPRS or
something similar to the local coffee shop while you are also connected via
USB to your PC. That could potentially create a path for bad guys/programs
to travel from a public network (Starbucks), into your corporate network via
the ActiveSync connection.
Paul T.
"Andy Baker" <abaker@xxxxxxxxxxxxxxxxxx> wrote in message
news:4639a163$0$8755$ed2619ec@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hello Paul.
The WEP key that I enter at the WZC dialog is "1148BC4667". If I use
Encoding.Unicode.GetBytes("1148BC4667") to create a byte array, I get a 20
character array (49, 0, 49, 0, 52, 0, 56, 0, 66, 0, 67, 0, 52, 0, 54, 0,
54, 0, 55, 0). This doesn't connect. However I tried it again by passing
the string directly, and it worked. I was getting confused when it didn't
work previously when passing an empty string to connect to the non-wep
enabled printer. However, if I use the byte array form and pass (byte[])
null to connect to the printer, that works. So, if I use the 2 different
forms of SetWirelessSettings for each different case, I can switch between
them OK. Possibly it would also work if I passed null instead of an empty
string - I have not tried that yet.
I do have one more question. The device will be connected to the
printer most of the time, and only use the LAN at the start at end of the
day. For this reason I tried to disconnect to the LAN as soon as I had
finished using it, by using UnbindAdapter. However when connected via USB
to the device from my desktop, I lost the connection, and when looking in
Start -> Networking and Dial-Up connections, the WiFi adapter was no
longer present and I had to reset the device to get it back. Is this
normal behaviour? I can disconnect from the LAN simply by reconnecting to
the printer and don't need to use UnbindAdapter, I was just concerned that
there might be something more seriously wrong.
Thanks for your help.
Andy Baker
"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:eI4R1NNjHHA.4676@xxxxxxxxxxxxxxxxxxxxxxx
I then try from my application which uses SetWirelessSettings. When I
try to connect to the LAN, I am passing the WEP key as a byte array,
using Encoding.Unicode.GetBytes(WEPKey), where WEPKey is my 8 character
hex string.
"8 character hex string" sounds like something along the lines of
"652f7542". Is that what you're passing? I think that the right thing
is to actually tell us what the WEP key you enter at the WZC dialog is
and what you are passing when you try to connect from your code. I think
you're just mapping one into the other incorrectly.
.
- Follow-Ups:
- Re: OpenNETCF SetWirelessSettings
- From: Andy Baker
- Re: OpenNETCF SetWirelessSettings
- References:
- OpenNETCF SetWirelessSettings
- From: Andy Baker
- Re: OpenNETCF SetWirelessSettings
- From: Paul G. Tobey [eMVP]
- Re: OpenNETCF SetWirelessSettings
- From: Andy Baker
- Re: OpenNETCF SetWirelessSettings
- From: Paul G. Tobey [eMVP]
- Re: OpenNETCF SetWirelessSettings
- From: Andy Baker
- OpenNETCF SetWirelessSettings
- Prev by Date: Unable to read data from transport connection
- Next by Date: ContextMenu Question
- Previous by thread: Re: OpenNETCF SetWirelessSettings
- Next by thread: Re: OpenNETCF SetWirelessSettings
- Index(es):
Relevant Pages
|