Thursday, March 27, 2008

Enable Bluetooth support in Windows Embedded CE

The Bluetooth stack is natively supported by Windows Embedded CE, and can be integrated to your runtime image. This required of course a Bluetooth controller that can be either a Serial, USB,… dongle. Based on this stack you can enable Bluetooth capabilities to your device and applications, using the Bluetooth API. Enabling Bluetooth in your applications is not straightforward, as it requires to implement mechanism for at least the discovery and pairing with other devices (paired devices are trusted devices).
A Windows Embedded CE device can either connect to services provided by other devices or host service for other devices.

Profiles:
On a Bluetooth device, the different remote or local services provided by the Bluetooth stack are called profiles. The Bluetooth specifications provides a complete definition of the different Bluetooth profiles that can be enabled on a Bluetooth device. Unfortunately Microsoft do not provide all the profiles listed in this specifications, but only a subset is accessible like:

  • Service Discovery Protocol (SDP) used to discover the other Bluetooth enabled devices in the range of your device
  • Serial Server Profile (SPP) providing a serial interface for communication between two devices
  • Object Push (OPP) to send files to other devices, can be used to send business card
  • File Transfer Protocol (FTP) to provide an access (push or get) to a remote file system
  • Personal Area Networking (PAN) to enable IP support to communicate through the bluetooth connection
  • Dial Up Networking (DUN) to perform network connection to remote servers
As evocated previously those profiles required development to manage the access to the Bluetooth stack and handle communication errors and requests.

Existing Bluetooth Manager:
When using Bluetooth, you need a Bluetooth Manager that will allow user (or applications) to support the discovery of the in range Bluetooth devices and provide access to the remote and local Bluetooth profiles.
  • Microsoft provides by default a very basic Bluetooth manager for the discovery and pairing to remote devices.
  • Adeneo provides a Bluetooth Manager with an interesting layered architecture that provide a way to easily integrate in your applications the Bluetooth support. A GUI illustrates how their Bluetooth engine works. More details on their product is available here. They also provide a version compatible and certified for Windows Mobile 5.0 (Product Reference).

Required System Components:
To enable the Bluetooth on your platform, it will requires the following components in your OSDesign:
  • USB Host Support (or Serial Port Support)
  • Bluetooth Stack with Integrated CSR Chipset Driver
  • Bluetooth Stack with Integrated USB Driver (or UART-Only Driver)

Sample source code:
You can find some sample source code for the Bluetooth handling :
_WINCEROOT\PUBLIC\COMMON\OAK\DRIVERS\BLUETOOTH\SAMPLE

- Nicolas

Thursday, March 20, 2008

.Net Compact Framework 3.5

The January Windows CE 4.x, 5.0 and 6.0 QFEs (Quick Fix Engineering) enable the .Net CF 3.5 for Windows CE. Now this feature can be directly integrated inside a runtime image by selecting the associated component in the platform builder catalog. The .Net CF 3.5 introduce new graphical components and fix some well know issues of the framework.





Windows Embedded CE QFEs are accessible here

- Nicolas

Business Solution Accelerator 2008

Need help to implement features in your .NET Compact Framework 3.5 application, Microsoft just released the Business Solution Accelerator 2008 for Windows Mobile, providing free and reusable source code and associated documentation.
In the mean time, the Windows Mobile blog will in the future discuss of the best practices in .Net CF development (blog link).

[Updated] Microsoft's Reed and Steve wrote a complete article on this LOB Solution Accelerator.
[Updated] See also Fabien's blog article for details about it.

The complete package and detail are accessible from the Microsoft Web site.
- Nicolas

Tuesday, March 4, 2008

Who want to be an MCP

Microsoft is currently working on a Microsoft Certification Professional (MCP) Exam for the Windows Embedded CE technology. Few months ago some eMVP has been consulted to create a set of questions on the different technical aspects that must be masterized to generate, debug and use Windows Embedded Runtime binary images.
The exam 70-571, actually in beta test, should be accessible by every body in April time frame.

- Nicolas

Thursday, February 28, 2008

Windows Mobile Trojan

WindowsForDevices post an article on the first trojan discovered by MacAfee's Avert Lab on WiMo devices. This trojan opens security permission on the device and can contaminate other devices using SDCards.

Read full article ...

- Nicolas

Tuesday, February 26, 2008

Readers contribution

First of all, thanks all for your fidelity.

To exactly match your expectation in term of content, I'm opening a suggestion emailbox to submit your questions and ideas for the next articles to publish on this blog.

You can send your requests to : nbesson DOT blog AT gmail DOT com
Again, thanks for your help.

- Nicolas

Tuesday, February 19, 2008

Smart Device deployment and debugging using VS2005

When developing smart device application, in C# or C++ (Win32 or MFC) using Visual Studio 2005, you have different solutions for the deployment and debugging of your application.

ActiveSync :

This is the easiest way as it just required the support of ActiveSync in your Run Time image and a Serial or USB Function interface correctly setup. When connecting the device to you development computer ActiveSync should start and connect to the device. VS2005 is setup to use the ActiveSync link automatically for the deployment and debugging. No particular actions are required for this connection type.

KITL :

If you have the chance to have a KITL connection between the device and Platform Builder, you can directly use this connection with another instance of VS2005.

Pre-requisite

Before been able to use the KITL connection from VS2005, you have to create and setup a device configuration. To do so you have to open the Connectivity Options window in the VS2005 instance running the Platform Builder plug-in. Use the Create Device button to add a new device to the list of devices identified by Platform Builder. Associate this new device to an SDK if you got one or to the Generic Platform Builder OSDesign in the drop list as shown bellow.


Then select this new device and setup the Transport and Download information as you are usually doing it with your target device. Then attach and download the Runtime image to the target. This VS2005 instance will be use to debug the OS, and not your application. You will be able to add break point in the drivers and/or OAL.

Connect

In the second VS2005’s instance start/load your application solution and go to the Tools menu followed by Options then Device Tools group, select Devices, select the device created previously in the list and edit the Properties. Check that the Transport configuration is KITL. Validate all the open windows and close.


Now your system is ready to deploy and debug your application on the device using the KITL layer.

Corecon :

Corecon use the network interface to communicate with Visual Studio and requires to launch two applications on the device, but before you need least the following files on your device:

  • clientshutdown.exe
  • CMAccept.exe
  • ConmanClient2.exe
  • DeviceDMA.dll
  • eDbgTL.dll
  • TcpConnectionA.dll

Those files can be directly integrated in the nk.bin using the project.bib file or copied on the device at runtime using USB flash key or FTP connection.

Those files are not provided directly with the Windows Embedded CE 5.0/6.0 development environment, but are located in the VS2005 folders in the folder :

c:\Program Files\Microsoft Shared\CoreCon\1.0\Target\wce400\ProcessorType\

Binary versions are available for all processors supported by WinCE (ProcessorType).

Pre-requisite

The two applications, CMAccept and Conmanclient2 have to be launched manually when a connection to VS2005 is required. To do so you have to get a way to launch them, using the explorer window on the device, or using a telnet connection. You will also need the IP address of your device to correctly setup VS2005 connection. Without this IP address VS2005 would not be able to connect to the device.

Launch and connect

Under VS2005 you have to select and edit the device connection property by going to the menu Tools followed by Options then Device Tools group, select Devices, select the device in the list and edit the Properties.

In the Properties window select the Transport as TCP Connect Transport and then Configure. In the Configure window check the Use Specific IP address andx enter the IP address of the device. Validate all the open windows and close.


On the device you have to launch the ConmanClient2 application, followed by CMAccept. At this time you have approximately 3 minutes to connect the VS2005/2008 instance with your target. Elapsing this time you will have to launch the CMAccept application again before trying to connect.

In the VS2005, select the device in the device drop box list and click on Tools followed by Connect To Device. The connection may succeed and you should be able to start the deployment and/or debugging.

Those three configuration are using different communication layers but will provide the same set of functionalities for the deployment and debugging of Smart Device applications.

[Updated on 02/19/2008]
For the Windows Mobile user, to get all the steps for those platforms, you can check out the article on the Fabien blog.

- Nicolas