Hi, I'm a bit of a newb at vb, so bear with me.. I'm trying to get the mac address of the wlan adapter from fusion on a mc70,mc55,etc.. The emdk help file and samples isn't helping me much for this query so I am hoping someone can help here. Here is my code...any help is greatly appreciated. thanks, jamiec Public Class Adapter Public ReadOnly Property macaddress() As String Get Try Dim myAdapter As Symbol.Fusion.WLAN.Adapter Dim macaddress As Symbol.Fusion.WLAN.Adapter.SSIDInfo =myAdapter.MacAddress Return myAdapter.MacAddress Catch ex As Exception Return "UNKNOWN" End Try End Get End Property End Class
Obtain wlan adapter mac address from Fusion// Expert user has replied. |
5 Replies
I used a function to enable/disable the radio by passing true/false to it. Here is the code
Imports Symbol.Fusion.WLAN Imports Symbol.Fusion
Public Class radiostate Public Function enableradio(ByVal enable As Boolean) As Boolean Try Dim myWlan As WLAN = New WLAN(FusionAccessType.COMMAND_MODE) Dim myAdapter As Symbol.Fusion.WLAN.Adapter = myWlan.Adapters(0) If enable And myAdapter.PowerState.Equals(Symbol.Fusion.WLAN.Adapter.PowerStates.OFF) Then myAdapter.PowerState = Symbol.Fusion.WLAN.Adapter.PowerStates.ON ElseIf Not enable And myAdapter.PowerState.Equals(Symbol.Fusion.WLAN.Adapter.PowerStates.ON) Then myAdapter.PowerState = Symbol.Fusion.WLAN.Adapter.PowerStates.OFF End If myWlan.Dispose() Return True Catch ex As Exception Return False End Try End Function End Class
Hi, Thanks for the help. That should get me going. I need to convert it to the fusion assembly though as the Symbol.WirelessLAN is replaced by Symbol.Fusion in future emdk's. I'll try to convert it tonight and post the new code. Thanks again. jamieC
Hi, If you want to use Symbol.Fusion assembly, you can use this code
Imports Symbol.Fusion.WLAN Imports Symbol.Fusion
Public Class Adapter Private ReadOnly Property macaddress() As String Get Try Dim myWlan As WLAN = New WLAN(FusionAccessType.STATISTICS_MODE) Dim myAdapter As Symbol.Fusion.WLAN.Adapter = myWlan.Adapters(0) Return myAdapter.MacAddress Catch ex As Exception Return "UNKNOWN" End Try End Get End Property End Class
Hi, That saved me a lot of time. That works perfectly. I did find out that the wlan radio has to be enabled for this to work or it just returns 00:00:00:00:00 or nothing at all depending on the device. I am working on trying to enable the radio before I query the mac address but it's not working for some reason. Thanks, j Imports Symbol.Fusion.WLAN Imports Symbol.Fusion Public Class enableradio Public WriteOnly Property enableradio() As String Set(ByVal value As String) Dim myWlan As WLAN = New WLAN(FusionAccessType.COMMAND_MODE) Dim myAdapter As Symbol.Fusion.WLAN.Adapter = myWlan.Adapters(0) myAdapter.PowerState = Symbol.Fusion.WLAN.Adapter.PowerStates.ON End Set End Property End Class
Hi, You can change your code as shown below and add references to Symbol.WirelessLAN Assembly in your project.
Public Class Adapter Public ReadOnly Property macaddress() As String Get Try Dim myRadio As Symbol.WirelessLAN.Radio = New Symbol.WirelessLAN.Radio() Dim myAdapter As Symbol.WirelessLAN.MACAddress = New Symbol.WirelessLAN.MACAddress(myRadio) Dim adapterAddress As String = myAdapter.Adapter.Text Return adapterAddress Catch ex As Exception Return "UNKNOWN" End Try End Get End Property End Class