Pages

Showing posts with label Compact Framework. Show all posts
Showing posts with label Compact Framework. Show all posts

Saturday, September 10, 2011

Get your Divice Serial Number(ESN)

Hi all.. So this time i got a work to get a Divice serial number for some securites pourpose. it was not a very big effort to getit done .. it was so easy .. i have put one sample application to Get ESN number.. Look into it for your reference.
please check the little application  :)


 //Symbol.ResourceCoordination class
TerminalInfo terminalIfo = new TerminalInfo();
if (!string.IsNullOrEmpty(terminalIfo.ESN))
{
label1.Text = terminalIfo.ESN;
}
else
{
label1.Text = "Not able to Get ESN";
}


Note: You Need To Refer Symbol & Symbol.ResourceCoordination.dll

Error:No Compatible FusionInterface dll Found.

Error:No Compatible FusionInterface dll Found.Expected Version is 4.1.0.4 or higherversion having the format 4.x.x.x

This same error i was getting some days before. but after some effort i check my device control panel and check that those libraries are installed or not

but unfortunately libraries was not there.. :(

Solution: so  i think you got the soltuion . You just need to install Symbol.fusion Libaries (a cab file)

and check it out again .. I think it will work fine .

WiFi Radio Toggle in smart device (Symbol.Fusion dll)

I was working on to Enable/Disable it Wifi on Motorola MC17 device . After some effort I found the solution to enable/Disable it wifi Radio. I am Using Symbol.Fusion dll to get toggle wifi radio. there are some other ways also to Like P/invoke with .Net etc. here I will put both ways . you can take the reference of that. Here I am putting sourcecode for your reference.

public class WiFiRadio
{
    WLAN myCommandModeWlan = null;
    public WiFiRadio()
    {
        InitializeWiFi();
    }
    public void InitializeWiFi()
    {
        try
        {
            myCommandModeWlan = new WLAN(FusionAccessType.COMMAND_MODE);
        }
        catch (OperationFailureException ex)
        {
            System.Windows.Forms.MessageBox.Show("Command mode is in use", "WiFiMgr");
        }
    }
    public void ToggleWiFi(bool enableWiFi)
    {
        try
        {
            if (myCommandModeWlan != null)
            {
                if (enableWiFi)
                {
                    myCommandModeWlan.Adapters[0].PowerState = Adapter.PowerStates.ON;
                }
                else
                {
                    myCommandModeWlan.Adapters[0].PowerState = Adapter.PowerStates.OFF;
                }

            }

        }
        catch (OperationFailureException ex)
        {
            System.Windows.Forms.MessageBox.Show("Command mode is in use", "WiFiMgr");
        }
    }
    public bool GetCurrentStatus()
    {
        if (myCommandModeWlan.Adapters[0].PowerState == Adapter.PowerStates.ON)
        {
            return true;
        }
        else
        {
            return false;
        }
    }
}

Note: You Need To Take The Reference Of Symbol.fusion dll

Friday, September 9, 2011

Getting the current version C#

As you know are aware of the version constrain there are four numbers mentioned in the every version.Example : 2.0.1.67 1.Major 2.Minor 3.Build 4.Revision
Here is the example to get the current build version
public void GetCurrentBuildVersion()
{
var version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
view.VersionNumber = version.Major + "." + version.Minor + "." + version.Build + "." + version.Revision;
}