Sunday 28 March 2010

Finding Out Slider Count and Total Call Time in Sony Ericsson Mobile Phone

Have you ever wanted to find out, how many times you have slided your Sony Ericsson slider phone(or slider count)? or Total call time of your Sony Ericsson mobile? Well, you find that out and more, with few key presses in your mobile.
  • Press the keys in the following order in your Sony Ericssson mobile phone - Right Navigation Key + '*' key + Left Navigation Key + Left Navigation Key + '*' key + Left Navigation Key + '*' key.
  • After you press the above keys, Service menu comes up on the mobile screen.
  • For finding out the slider count, Go to Service Info -> Slider Count.
  • For finding out the total call time of the mobile, Go to Service Tests -> Total Call time.
  • Apart from these, you can find the Model Info, Software Info, Configuration Info from 'Service info' menu item. You can also run tests to see the working of Main Display, LED/Illumination, Keys, Speaker, Earphone, Microphone, Vibrating Alert, Camera, Video Call Camera, Flash LED, FM Radio from 'Service tests' menu item.
  • To come out of Service menu, press the End Call key.
  • P.S: The above tests were done on Sony Ericsson W705 and W550i.

    Wednesday 24 March 2010

    What to do when you are unable to make outgoing calls from your Hutch/Vodafone SIM?

    What is your immediate reaction when you are unable to make any calls from your cell phone. Frustrated? That was how I felt 2 days ago, when I was unable to make any outgoing calls from my mobile phone from a prime location in Bangalore. Electronic gadgets have made us over dependent on them nowadays.

    My initial reaction was to restart the cell phone. No, it did not work. Then I tried switching off the phone, removing the battery and SIM card, put them back again to see if it works. No, it also didn't work. After half an hour or so, when I tried to make a call, I was able to do so. But it was not because of the tasks I did above.Sony Ericsson w705 cell phoneLater I came to know that though the network icon in the phone showed full coverage when I tried restarting the phone or removing the battery/SIM, it was not so. In such cases, updation of the SIM card will do the trick. I use Hutch/Vodafone connection.

    Following are the steps you might want to follow to resolve the issue.
  • Go to Hutch Plus menu in your mobile phone.
  • Select Hutch Roam.
  • Select Hutch.
  • A Message will be displayed - 'SIM card update starts...', Select OK
  • One more message will be displayed - 'Allow SIM Update? Phone will restart', Select OK
  • After you do this you will see, 'Inactive SIM', in place of operator logo Hutch.
  • Phone will restart after few seconds and network coverage icon is shown on your cell phone.
  • You should now be able to make outgoing calls.
    P.S: The above procedure has been tested only on Home network of Hutch and not in Hutch Roaming.

    Sunday 21 March 2010

    BSNL EVDO Data card availability only on paper!

    If you had noticed the ads by BSNL in newspapers, featuring ever smiling Deepika Padukone and Abhinav Bindra, about the EVDO Data Cards they are offering now for discounted prices, you tend to believe that the EVDO Data cards are readily available. As per the ad, for customers activating the EVDO postpaid unlimited data plan till 31st March 2010, fixed monthly rental will be Rs.750 instead of Rs.999. Though there are intial charges like Activation Charges(Rs.500), price of Data Card(Rs.3500)/monthly rental for the card(Rs.200) and refundable security deposit(Rs.1000), it seemed like a good bet. But when you do a reality check by contacting the BSNL Customer Service Center, the story is entirely different.Deepika Padukone and Abhinav Bindra in BSNL EVDO Card AdWhen I contacted the Executive at BSNL Customer Service Center at Vijayanagar, Bangalore, he said there are no EVDO Data cards available as of now. Though the ads are in place, they say they have not been supplied enough EVDO Data Cards. Instead he offers me a NIC(Network Interface card), with max speed upto 144 kbps. Well, why do I go for that, when my BSNL Broadband connection(Dataone) offers much more than that speed(256 kbps). He adds that though the max speed is 144 kbps, NIC average speed may be upto 100 kbps. Then, when I tell the area where I reside, he reduces average speed further. BSNL NIC Card uses CDMA 1x technology, predecessor of CDMA 1x EVDO, offers speed upto 144 kbps whereas BSNL EVDO Card offers upto 3.1 Mbps. BSNL Customer Service executive also informed that the average speed offered by EVDO Card can be upto 1 Mbps. Voila, who would not want such a speed on a wireless internet card!

    Well, my main intention was to get EVDO Data Card which offers higher speed than the BSNL broadband. More importantly, I am fed up with the frequent connection lost scenarios with BSNL Broadband. Also, pricewise current discount matches with the unlimited usage offer by BSNL Broadband Dataone connection, I am currently having for Rs.750. Hoping for the things to improve at BSNL.

    For FAQs on NIC and EVDO Cards by BSNL, you can visit this BSNL link and for the tariff plans, click here.

    Friday 19 March 2010

    Web Services On Devices : WS Discovery using Function Discovery in Windows Vista

    Function Discovery APIs for performing WS Discovery:
    Function Discovery APIs in Windows Vista, provides a uniform programmatic interface for enumerating system resources, such as hardware devices, whether they are local or connected through a network. It enables applications to discover and manage lists of devices or objects sorted by functionality or class. Function Discovery supports an extensible discovery provider model. The providers included in the system provide an abstraction layer over existing standards such as Plug and Play (PnP), SSDP, WS-Discovery, and the registry. To find more about Function Discovery visit the following links:
    Function Discovery - http://msdn.microsoft.com/en-us/library/aa814070.aspx
    Retrieving all function instances in a Category - http://msdn.microsoft.com/en-us/library/aa364810(VS.85).aspx

    WS-Discovery:
    Windows SDK 6.1 comes with a sample program demonstrating the use of Function Discovery API. The sample can be found in the following path - “windows SDK folder\Samples\NetDs\FunctionDiscovery”. This sample program discovers PnP devices on the network.

    Modifying the Sample Program to discover WSD devices on the network:
    CMyFDHelper class : CMyFDHelper (in FunctionDiscovery.h) is a helper class and is derived from CfunctionDiscoveryNotificationWrapper. CMyFDHelper class implements OnUpdate, OnError, OnEvent callback functions of parent class – CfunctionDiscoveryNotificationWrapper.

    Create Instance Collection Query : HRESULT CMyFDHelper::ListFunctionInstances( const WCHAR* pszCategory ) lists all the devices of pszCategory found. Here, it creates an Instance Collection query by calling CreateInstanceCollectionQuery of IFunctionDiscovery. Pass first parameter pszCategory as FCTN_CATEGORY_WSDISCOVERY.

    Add a constraint to Query : IFunctionInstanceCollectionQuery *pQuery is the query created. Add constraint to the query for searching only WSD printers.
    hr = pQuery->AddQueryConstraint(
    PROVIDERWSD_QUERYCONSTRAINT_TYPE,
    L"http://schemas.microsoft.com/windows/2006/08/wdp/print/PrintDeviceType" );
    To find more about AddQueryConstraint go to - http://msdn.microsoft.com/en-us/library/aa364366(VS.85).aspx

    Execute the Query and Count of instances: This is done by calling execute function on pQuery. Since WSD Providers only return instances through the IFunctionDiscoveryNotification interface, dwCount in statement - pCollection->GetCount( &dwCount ); will be zero. So, return from here.

    IFunctionDiscoveryNotification interface : In CMyFDHelper:: Initialize(), IFunctionDiscoveryNotification interface Functions - OnUpdate, OnError, OnEvent are implemented in CMyFDHelper. So when the Function discovery APIs detect the presence of WSD devices in the network, OnUpdate callback function in CMyFDHelper class will be called.

    In HRESULT CMyFDHelper::OnUpdate(), there is a block of code which check what event has occurred(device added, removed or updated). In case of discovery of WSD printer, the event will be added(QUA_ADD == eAction). So, in this case, call CMyFDHelper::DisplayProperties().

    CMyFDHelper::DisplayProperties() outputs all the properties of the particular device. There is a switch case block where there is case for VT_LPWSTR. Check for pszKeyName is PNPX_GlobalIdentity. If it is so, extract the key value. Key value is UUID. Store this value which will be later required for the creation of Device proxy.

    Wednesday 17 March 2010

    Web Services on Devices : Developing a Print Client in Windows Vista

    With WSDAPIs generated in previous post, we can now start developing a Print client.

    How do I start developing a Print Client?
    For the Print Client to communicate with a WSD Printer, first it has to discover the WSD Printers on the network. For knowing about discovering the Printers on the network and getting the UUID – universally unique identifier for the printer, refer to the sample Function Discovery program in the following path - "Folder where windows SDK is installed\Samples\NetDs\FunctionDiscovery".

    Discovering the Printers on the network and getting the UUID :
  • Sample program defines CMyFDHelper class which is used to discover PnP devices on the network. This can be tweaked to discover WSD Printers on the network.
  • Call HRESULT CoInitializeEx (LPVOID pvReserved, DWORD dwCoInit) with pvReserved = NULL and dwCoInit = COINIT_MULTITHREADED from main(); (Ref - http://msdn.microsoft.com/en-us/library/ms886306.aspx ).This function initializes the Component Object Model (COM) for use by the current thread. Applications are required to use CoInitializeEx before they make any other COM library calls except for memory allocation functions.
  • For the exact changes to be made in CMyFDHelper class to discover WSD devices, please wait for my next post on WS Discovery.
  • Call ::CoUninitialize();

  • Creating Service Proxy and sending messages to the server:(Refer to the File Service example in Windows SDK folder, mentioned earlier)
  • Create a UUID for client by calling UuidCreate() function. Convert the obtained UUID to string format.
  • Create a Service proxy by calling CreateCPrinterServiceTypeProxy(LPCWSTR pszDeviceAddress, LPCWSTR pszLocalAddress, CPrinterServiceTypeProxy** ppProxyOut, IWSDXMLContext** ppContextOut) [defined in PrinterServiceTypeProxy.cpp, LPCWSTR is wchar*] passing UUIDs of device/server and client in pszDeviceAddress and pszLocalAddress respectively.This function returns CPrinterServiceTypeProxy which will be used for calling methods on the server. Client calls CPrinterServiceTypeProxy methods(like CreatePrintJob, SendDocument etc), which have the same interface that of server and they send the commands to the server. Note: We need to create IWSDDeviceProxy before creating any IWSDServiceProxy(CPrinterServiceTypeProxy is of this type and a single device can host multiple services). Creation of device proxy before service proxy is handled at CreateCPrinterServiceTypeProxy. [More details on device and service proxies can be found from the following link - http://blogs.msdn.com/dandris/archive/2008/03/03/wsdapi-101-part-4-the-interfaces-under-the-generated-code.aspx ]
  • Create a Event Sink class for Server events. Define a class named CPrinterServiceTypeEventNotify derived from IPrinterServiceTypeEventNotify. Implement the IPrinterServiceTypeEventNotify methods defined as virtual, in this class – PrinterElementsChangeEvent, JobStatusEvent, JobEndStateEvent. These are call back functions which will be invoked when the server sends respective events. We can update our structures holding printer, job info in these functions.
  • Functions defined above will be called if the client is subscribed to the events from server. Call the subscribe functions like SubscribeToJobStatusEvent, SubscribeToJobEndStateEvent on service proxy i.e CPrinterServiceTypeProxy object.(these functions are defined in PrinterServiceTypeProxy.cpp)
  • Call the server functions on CPrinterServiceTypeProxy object. For example, for CreatePrintJob you need to send filled CREATE_PRINT_JOB_REQUEST_TYPE structure and CREATE_PRINT_JOB_RESPONSE_TYPE* for response. Type definitions for the same can be found in PrinterServiceTypeTypes.h

  • Resolving the Build Errors in Visual Studio:
  • Set the project dependencies and build order – Right click on project. Select Project Dependencies. Make sure Client project depends on the project created for Print Schema. Also set the build order as Print Schema project, Client project in the same window opened.
  • You may get compilation error for not able to find header files like PrinterServiceTypeProxy.h. Then check whether you have included the files from project for PrinterServiceSchema. To include them, right click on Projects. Select Properties -> Configuration Properties -> C/C++ -> General -> Additional Include directories and type project directory for PrinterServiceSchema.
  • You may get linker error (unresolved external symbol) for UuidCreate(). If so, check whether you have included rpcrt4.lib. To include the same, right click on Project. Select Properties -> Configuration Properties -> Linker -> Command line -> Additional options. Type rpcrt4.lib.
  • If you get linker errors for wsdapi functions make sure you have included wsdapi.lib.
  • With the above steps, you are now ready with the basic Print Client which communicates with the WSD Printer.

    Tuesday 16 March 2010

    Web Services On Devices : Getting WSDAPIs for Print Client

    WSDAPI stack provided by Microsoft as part of Windows Rally technologies, is an implementation of DPWS(Devices Profile for Web Services), which defines a minimal set of implementation constraints to enable secure Web Service messaging, discovery, description, and eventing on resource-constrained devices.

    If you had gone through the links, I provided in my first post on Web Services on Devices (Web Services on Devices : Environment Set Up in Windows Vista), you would have known by now, what it requires to develop a Web Service Device which hosts Web Service and a Web Service Client, which uses the services hosted on Web Service Device. In this post, I will be explaining how you can develop a Web Services client in Microsoft Windows Vista, using WSDAPIs taking the example of Print Service.

    Where can I get more information on DPWS, WSDAPIs, Windows Rally Technologies?
    Go to - http://www.microsoft.com/whdc/connect/rally/rallywsd.mspx

    Where can I get the Print Device and Print Service Specifications for implementing Print Service and Print Service Client?

    Go to - http://www.microsoft.com/whdc/connect/rally/wsdspecs.mspx, where you can download Specifications and Supporting Files for Print Device and Print Service. These schemas/specification describe the format of data being exchanged between the Web Service and Web Service Client and the interfaces which need to implemented by the Device, which provides the Print Service. After unzipping the zip file downloaded from the above link, you will find WSDPrinterService.wsdl, supporting .xsd files and WSDPrintService.doc explaining the schema. WSDPrintService.doc should give you a fair idea of what it requires to develop a Print Client based on WSD protocol.

    Developing a Print Service Client, using the schema/specification just downloaded:

    How do I get WSDAPIs to be called from Print Client?

    Following steps explain how to go about building Print Client.
  • Get WSDPrinterService.wsdl and other .xsd files(Print Service Schema).
  • Generate a config file by running WsdCodeGen on WSDPrinterService.wsdl.
    You can find wsdcodegen.exe in "Windows SDK folder\Bin". run "wsdcodegen.exe /generateconfig:all WSDPrinterService.wsdl". This command will generate codegen.config. Make sure the directory which contains WSDPrinterService.wsdl also holds all the .xsd files from Print Service Schema as WSDPrinterService.wsdl includes those .xsd files. Otherwise, you will find that message structure elements in PrinterServiceTypeTypes.h (which gets generated in next step) will be empty.
  • Generate IDL, C++ and header files.
    run "wsdcodegen.exe /generatecode codegen.config". This command will generate the following files - PrinterServiceType.idl, PrinterServiceTypeProxy.h, PrinterServiceTypeProxy.cpp, PrinterServiceTypeTypes.h, PrinterServiceTypeTypes.cpp and PrinterServiceTypeStub.cpp. These files can be added as a part of Visual Studio project and can be built into a static library (.lib)
  • You may face problems like – not able to include PrinterServiceType.h in building the above .lib, since PrinterServiceTypeProxy includes PrinterServiceType.h, which contains the definitions for interfaces like CreatePrintJob, SendDocument etc. This and other files – PrinterServiceType_p.c and PrinterServiceType_i.c are generated by MIDL (Microsoft Interface Definition Language) compiler when building the above mentioned .lib. You may notice that, in case of above error, MIDL would have generated PrinterServiceType_h.h in the Project folder. To make sure that MIDL generates PrinterServiceType.h make the following settings changes. In Visual Studio solution explorer, right click on the Project. Select Properties, Configuration Properties, MIDL, Output, Header File. Change the value to $(InputName).h instead of $(InputName)_h.h

  • Now you are ready with required WSDAPIs to be called from your Print Client application.

    Monday 15 March 2010

    Web Services on Devices : Environment Set Up in Windows Vista

    Web Services on Devices(WSD) is still a new technology as the amount of literature available on the web on developing WSD applications is limited. Here, I am presenting a series of posts, which may help those who are new to WSD.

    Microsoft provides set of WSD APIs for developing WSD Applications from Windows Vista onwards. Here are some FAQs while setting up environment in Vista for WSD Development.

    Setting up Windows SDK and Visual Studio environment for developing Web Services on Devices Applications:-
    Best way to set up the required environment is to first install Visual Studio and then Windows SDK. This will avoid the getting into unnecessary problems relating to integrating Windows SDK directory paths to Visual Studio.
    Please Note : When I started using WSDAPIs for developing WSD Applications, I had used Windows SDK 6.1 and Microsoft Visual Studio 2008. So, the information provided here pertain to these softwares.

    What if I have already installed Windows SDK and now installing Visual Studio?
    Once the Visual Studio installation is complete, follow the instructions in the following Microsoft Windows SDK blog, where you need to use Windows SDK Configuration tool to integrate with the Visual Studio. http://blogs.msdn.com/windowssdk/archive/2008/03/01/integrating-windows-sdk-and-vs-with-new-sdk-configuration-tool.aspx. Make sure you choose the latest version of Windows SDK from configuration tool, in this case 6.1, if you also have older versions of Windows SDK installed.

    How to validate whether Visual Studio directories were successfully updated with Windows SDK?
    Go to Start, Programs, Microsoft Visual Studio 2008, Visual Studio Tools, Visual Studio 2008 Command Prompt. At the command prompt, type PATH. Check the following path is listed, "dir where Latest Windows SDK was installed\bin"

    Where do I start reading about WSDAPIs?
    You can refer to the following blog link by Dan Driscol, a Microsoft developer. http://blogs.msdn.com/dandris/archive/2007/11/09/wsdapi-101-part-1-web-services-from-10-000-feet.aspx. In case of any doubt, you can drop a comment in his blog post. Usually replies within a day or two.

    Where can I find sample programs on WSDAPIs in windows SDK?
    Go to "Folder where windows SDK is installed\Samples\Web\WSDAPI". Here you will find 2 folders: Stock Quote and File Service. Stock Quote is a simple example where Client is calling a method on Service. File Service is more complete example which covers WS Eventing as well. Both examples have code for Client and Service and require Client to know the device address/UUID.

    Ok, where can I find a sample program where a Client discovers WSD devices on the network?
    Go to "Folder where windows SDK is installed\Samples\NetDs\FunctionDiscovery". This sample program discovers PnP devices on the network. This code can be easily modified to find WSD devices on the network.

    LinkWithin

    Related Posts with Thumbnails