Wednesday, 24 September 2008

Attending ESS'08 and Hosting half-day Windows Embedded Workshops


Just a quick note to invite you to come visit me on the Direct Insight stand at next week's Embedded Systems Show at the NEC. Stand 449 October 1st and 2nd. You can get your free exhibition pass here.

Also in conjunction with Microsoft and Silica, Direct Insight will be hosting half-day Windows Embedded Workshops. These 100% technical workshops will take you through the process of building and deploying with both Windows Embedded CE and Windows XP Embedded.
This is a unique hands-on opportunity to check out how Windows Embedded stacks up against Linux, and the various RTOS solutions out there. Places are strictly limited, so please visit the link below to secure your place.
http://www.directinsight.co.uk/services/windows-embedded-workshop.html

Hope to see you there.
-Nigel

PS. At the show, we're also introducing a new, high performance, low-power Windows CE module, at a ground-breaking price. See this, and our other solutions for platform-based design on Stand 449 at ESS'08 (October 1st & 2nd at the NEC)

Friday, 19 September 2008

Register for Microsoft® Tech•Ed EMEA 2008 Developers before 26th September and save €300

On behalf of Microsoft I would like to invite you to take advantage of the early bird discount and register for Microsoft® Tech·Ed EMEA 2008 Developers (10 - 14 November, Barcelona, Spain) before 26th September 2008.

As Microsoft will no longer be hosting the Mobile and Embedded DevCon (MEDC) there will be a significantly increased Windows® Embedded presence at this event. This will be focused around 2 key areas:
· A dedicated Windows Embedded track
· Increased Windows Embedded presence in the exhibition hall - on the Ask the Experts Pavilion and dedicated Windows Embedded Partner Zone

Attend to:
· Enhance your technical skills in the development and implementation of Windows Embedded operating systems
· Network with both the Windows Embedded and wider community
· Engage with the largest audience of Microsoft Technology Specialists that come together across EMEA
· Visit the Windows Embedded exhibition space – the exhibition hall is at the heart of this event. A new layout design will promote networking across the hall, offering presentations, informal Chalk and Talk, comfortable social areas and continuous community activities

Don’t forget to register before 26th September and save €300!

Tech·Ed EMEA 2008 Developers is the Microsoft premier technical education conference just for developers. For five days, you and more than 4,000 of your peers have countless opportunities to explore about the latest cutting-edge technologies from Microsoft. For general event information please visit www.microsoft.com/emea/teched2008/developer/

>> Nigel

Friday, 5 September 2008

Windows® Embedded CE 6.0 Fundamentals

Great book available called "Windows® Embedded CE 6.0 Fundamentals"

Synopsis
Delve into the fundamental tools and techniques for Windows Embedded CE—and get ready to deliver the next innovation in powered devices. Covering the newest version of the technology—Windows Embedded CE R2—and led by two embedded-development experts, you'll get both the hands-on instruction and pragmatic reference you need to begin building a range of small footprint, smart, connected, and service-oriented devices. This book examines the architecture, built-in programming tools, drivers, and build process, and shows how to take advantage of the Windows Embedded CE 6.0 Software Development Kit (SDK). Whether new to programming with Windows and Windows Embedded, or already working with the platform, you'll find the best practices and real-world guidance you need to get productive quickly.


Delve into the fundamental tools and techniques for Windows Embedded CE—and get ready to deliver the next innovation in powered devices. Covering the newest version of the technology—Windows Embedded CE R2—and led by two embedded-development experts, you'll get both the hands-on instruction and pragmatic reference you need to begin building a range of small footprint, smart, connected, and service-oriented devices. This book examines the architecture, built-in programming tools, drivers, and build process, and shows how to take advantage of the Windows Embedded CE 6.0 Software Development Kit (SDK). Whether new to programming with Windows and Windows Embedded, or already working with the platform, you'll find the best practices and real-world guidance you need to get productive quickly.


To find out where to buy follow this Link to the correct vendor for your country.

> Nigel

Tuesday, 5 August 2008

Stopping home screen on Smartphone and other backlight tricks

If your smartphone application displays information to a user without any user input you may wish to stop the home screen from being shown, or the auto lock from kicking in by reseting the idle timer using:

// prevent home screen from being shown, lock and idle timers
SHIdleTimerReset();


You can force the backlight on and reset the other idle timers using:

SystemIdleTimerReset();
SetSystemPowerState(NULL, POWER_STATE_ON, POWER_FORCE);

The latter works also on PocketPC and Windows CE

Monday, 12 May 2008

Interesting Article

Was directed at this article to read and thought it was worth sharing.

http://www.embedded.com/columns/guest/207402542

Interesting views on one of Windows Embedded main competitor.
I’ll let everybody make up their own minds.

>> Nigel

Thursday, 10 April 2008

Hooking keyboard events in Windows CE/PPC

Hi,

I saw someone had asked about this on a newsgroup. Hooking keyboard events is where we can insert some code into GWES to see any keyboard presses that are happening in the system.

This is a useful process if you want to record a series of keypresses from a user which may span over a number of applications. Once recorded you can play back the keypresses by inserting them into GWES again using Keybd_event.


Note in Windows CE you can't hook mouse messages like in XP.

Heres the code:

// keyboardHook.cpp : Defines the entry point for the application.
//
#include "stdafx.h"

#define WH_KEYBOARD_LL 20

extern "C" BOOL WINAPI UnhookWindowsHookEx(HHOOK hhk);
extern "C" LRESULT WINAPI CallNextHookEx(HHOOK hhk, int nCode, WPARAM wParam,LPARAM lParam);
extern "C" BOOL RegisterHotKey(HWND hWnd, int id, UINT fsModifiers, UINT vk);
typedef LRESULT (CALLBACK* HOOKPROC)(int code, WPARAM wParam, LPARAM lParam);
extern "C" HHOOK WINAPI SetWindowsHookExW(int idHook,HOOKPROC lpfn,HINSTANCE hmod,DWORD dwThreadId);

#define SetWindowsHookEx SetWindowsHookExW

struct HHOOK__ * hKeyHook=NULL;

typedef struct tagKBDLLHOOKSTRUCT {
DWORD vkCode; // virtual key code
DWORD scanCode; // scan code DWORD flags;
DWORD flags; // unused
DWORD time; // time stamp for this message
DWORD dwExtraInfo; // extra info from the driver or keybd_event
} KBDLLHOOKSTRUCT, *PKBDLLHOOKSTRUCT;

//Low level Keyboard Hook Proc
__declspec(dllexport) LRESULT CALLBACK TabHook( int code, WPARAM wParam, LPARAM lParam )
{
KBDLLHOOKSTRUCT* v_kbdllData = (KBDLLHOOKSTRUCT*)lParam;
RETAILMSG(1, (TEXT("nCode = %d, wParam = %d\r\n"), code, wParam));
RETAILMSG(1, (TEXT("vkCode = %d, scan = %d, time = %d\r\n"),
v_kbdllData->vkCode, v_kbdllData->scanCode, v_kbdllData->time));
return CallNextHookEx(hKeyHook,code,wParam, lParam);
}

// This is a simple message loop that will be used
// to block while we are logging keys. It does not
// perform any real task ...

void MsgLoop()
{
MSG message;
while (GetMessage(&message,NULL,0,0))
{
TranslateMessage( &message );
DispatchMessage( &message );
}
}

HHOOK InstallHook()
{
HINSTANCE hExe = GetModuleHandle(NULL);
return SetWindowsHookEx (WH_KEYBOARD_LL,TabHook, hExe, NULL);
}

///////////////////////////////////////////////////////////////////////////////
//
// WinMain - Test Entry point
//
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{
hKeyHook = InstallHook();
MsgLoop();
UnhookWindowsHookEx(hKeyHook);
return 1;
}

Saturday, 29 March 2008

Bluetooth signal strength

On XP it seems that most of the BT stacks support the ability to sense the signal strength when communicating with a device, apart from when using Java-ME and the Microsoft Stack on XP, for instance

BlueSoleil

BLUETOOTH_DEVICE_INFO_EX
{
..
CHAR cSignalStrength;
};

Toshiba

Using the BtGetRSSI command you can get the difference (db value) of a received signal index on the strength of "Golden Receive Power Range"

BroadCom
Using the GetConnectionStats() you can get the signal strength, from -128 to 127

Microsoft (Windows CE/Mobile)
Windows Mobile version of the MS stack supports signal strength through the BthReadRSSI, again a range of -128 to 128, but i can't find the same in the XP version, see http://msdn2.microsoft.com/en-us/library/aa362927(VS.85).aspx for the APIs.

There is a BluetoothIsConnectable() which returns a TRUE/FALSE but nothing else, the bluetoothapis.h which contains all the structures doesn't seem to have anything in it either, such as RSSI, strength or even signal so i don't think it is supported at least by any documented API.

Anyone else know if you can get the RSSI signal strength using the MS BT stack on XP?

Friday, 15 February 2008

Windows CE Codenames

Found this nice bit of text describing the history of Windows CE codenames which for some Windows CE Engineers might be interesting:

Before the Windows CE product was released we had an internal set of tools known as the Oem Adaptation Kit also known as the OAK - an OAK of course is a type of tree.
The initial releases of Windows CE were therefore named after trees, as follows.


Windows CE 1.0 - Alder (Nov 1996)
Windows CE 2.0 - Birch (Nov 1997)
Windows CE 3.0 - Cedar (Apr 2000)

Interestingly, there was a second team within the Windows CE group that worked on the tools, I guess you could consider tools to be something that makes a job easier, or cuts the job down to size - therefore the tools releases were named after things that cut down trees - as follows...

Windows CE 1.0 - Alder - Tools: Axe
Windows CE 2.0 - Birch - Tools: Buzzsaw
Windows CE 3.0 - Cedar - Tools: Chainsaw

For Windows CE 4.0 the original plan was to call the O/S DougFir (DouglasFir), the thing that cuts down DougFir trees was going to be Dozer (BullDozer) - interestingly, at Windows CE 4.0 the o/s team and tools teams merged together to form a new, combined team - the codenames for the operating system and tools also changed at this time from trees/tools to Whiskeys - so the codenames for Windows CE 4.0 onwards are as follows.

Windows CE 4.0 - Talisker (Jan 2002)
Windows CE 4.1 - Jameson (Jun 2002)
Windows CE 4.2 - McKendric (Apr 2003)
Windows CE 5.0 - Macallan (Aug 2004)
Windows CE 5.0 Network Device Feature Pack - Tomatin (Apr 2006)
Windows CE 6.0 - Yamazaki (Sep 2006)


* I found it on Test Embedded but it was originally posted by Mike Hall;

- Nigel

Monday, 11 February 2008

New place of work

Thought I'd just let everybody know that keeps an eye on this Blog that over the last couple of months you might have noticed the new company web links appear.
This has been due to both my self and Graeme leaving Intrinsyc after they decided to close the EMEA office.

I'm sure Graeme will let you know more about his new plans creating ByteSnap but for this entry I'll focus on my self (but keep it brief).

I've joined another EMEA Embedded Gold Partner in the UK called Direct Insight Ltd.(www.directinsight.co.uk) as the "Embedded Platform Architect".
Direct Insight supplies embedded development platforms encompassing reference kits, production ready modules, embedded development tools, training and services. Thousands of developers across Europe rely on our expertise, support and product solutions to get to market. We are also experts in the field of JTAG test and programming.

Anyway enough advertising. But what I can say is this new role will let me continue to build on and keep my Windows Embedded knowledge up to date which I can share with you all and help enable more products to design in Windows CE, WinMo and XPe.

- Nigel

Tuesday, 5 February 2008

Finding Cellcore examples for use in CE6.0

If you are trying out the Cellcore component in CE6.0 to dial voice numbers, receive calls, send and receive text messages and are looking for code examples then try the Smartphone SDK, there are examples under here most of which will compile as they are:

\Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Smartphone SDK\Samples\CPP\Win32\Cellcore\..

For example the SMS\HelloSMS code can be used for sending and receiving SMS messages, this uses the SmsOpen and SmsSendMessage functions which are identical between CE6.0 and Windows Mobile.

There are many code examples in here which certainly helped me out with the TAPI system for setting up voice calls for outgoing and incoming calls.

Thursday, 31 January 2008

Cab Installation Debugging Issues


Having problems with CAB files installing on devices; remember a detailed XML log of the installation process can be found on the device under:


\Application Data\Volatile\setup.log


Unfortunately this doesn't include information about available memory and file system usage on the device at the time of installation but it can be useful for debugging purposes especially for registration of DLLs and read only files failing to be copied over.


Thursday, 24 January 2008

Using custom DShow filters without registering DLLs

If you are creating a media application or utility that requires a DMO or DShow filter but instead of having clunky separate dlls that may need code signing and/or registring with DShow, did you know that you can embed the filter within your main application.

For example for a source filter you can specify a new class and base it on the DShow components you require:

class MySourceFilter : public CSourceStream
{
public:
MySourceFilter( HRESULT* phr, LPCWSTR pName);
virtual ~MySourceFilter(void);

..
..
}

When you create your filtergraph you can use AddFilter to add an instance of your class:


// Create and add new source filter
m_source = new MySourceFilter(NULL, &hr);
hr = m_pGraph->AddFilter((IBaseFilter*)m_source, L"Source");


Simple as that!

You don't need to support the registration or have registry files to allow DShow to find your filter as you've explictly added it yourself.

Thursday, 10 January 2008

Configuring MSI installers for Vista

When creating an MSI installable project (could be for your new Windows Mobile / Windows CE CAB project), you may encounter a problem with security on Vista, the error :

"The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2869."

To get around this I use the following in a PostBuildEvent on my PC installer project in visual studio 2005:

cscript.exe "$(ProjectDir)..\..\scripts\CustomAction_NoImpersonate.js" "$(BuiltOuputPath)"cscript.exe "$(ProjectDir)..\..\scripts\WiRunSQL.vbs" "$(BuiltOuputPath)" "INSERT INTO `Error` (`Error`, `Message`) VALUES (1001, 'Error [1]: [2]')"

You will need

- cscript.exe (provided in Windows XP)
- CustomAction_NoImpersonate.js (see Aaron Stebner's site for more information )
- WiRunSQL.vbs (Windows Installer Software Development Kit SDK)

Thursday, 3 January 2008

Making an MSI to install PPC/SP Cab files


Want to install your mobile application from your PC with your PDA connected via active sync but not sure how to do it?

Visual Studio 2005 includes all the tools to be able to create an installable CAB file for your PocketPC device but making the link between a PC MSI file and this CAB file isn't obvious.

It can be done by creating a PC installer that first installs your .CAB file on the PC, then afterwards launches small VB/C# app which invokes the Windos CE App Manager. This pushs the CAB file down onto the device either now or on next connection.

The basics of this and the VB/C# launcher can be found on MSDN:


Note this is for VS2003 which didn't include as rich a set of project types, check out http://www.devx.com/wireless/Article/31198/1954?pf=true which is written for VS2005, very handy!

Note for Vista you will need to alter the security properties of the MSI file as it will not have the correct permissions to launch the Windows CE App Manager (or Vista Mobile Device Center as its known). This is a command line operation, i'll detail this in a later post!

Enjoy!