I have been busily working away at building infrastructure for the Dare to Dream Difference Challenge. Since my last post, I have finished the hardware prototype, although I still need a cabinet. The project now consists of a Device Solutions Tahoe II development board, an XBee Series 2 module, an AR1010 FM Receiver, an LM4832N audio amplifier, and two 0.5 watt speakers (pictured here). Not pictured is the ZigBee base station.

I have made a shift in the approach I was taking for the software. Originally, I was going to have my home server update the bedside clock through the ZigBee interface. Sure, that was cool. Having the bedside clock update the feeds itself over Ethernet, now that is really cool!
One problem: the Micro Framework has sockets, but no HTTP support--yet. Jim Mateer has confirmed that HTTP is an approved feature in the next major release of the Framework, which is unfortunately too late. So, I wrote the web support classes from the System.Net namespace with enough functionality to keep me going. Namely, I implemented WebRequest, WebResponse, WebHeaderCollection, WebException, HttpWebRequest, and HttpWebResponse to support only HTTP 1.1, and not HTTP 1.0, HTTPS, cookies, caching, asynchronous operations or authentication. I followed the behaviour I needed as best I could to allow me to replace my implementation with the official implementation from Microsoft when it is released. With these classes I am able to download RSS feeds directly on the bedside clock.
I also ported an NTP client written by Valer Bocan. He wrote this in the 1.0 days, which was perfect for Micro Framework.
So now the bedside clock updates its time from a time server on the internet, it can fetch RSS feeds, and it can tune to FM radio stations and adjust the volume, treble and bass.
Here is a list of things of things I learned since the last update:
- Don’t try yield to implement IEnumerable.GetEnumerator() because it won’t work. You will instead have the MetaDataProcessor fail with an informative E_FAIL.
- Reference MFDpwsExtensions.dll to get access to the System.Ext namespace. That’s where I found Uri implemented.
- Speaking of this, System.Ext.Net and System.Ext.Net.Sockets are documented, but the classes in these namespaces have gone AWOL.
- TcpClient and UdpClient are not available, so you will have to do things the old fashion way with Sockets. Fortunately, NetworkStream is available!
- In order to use extension methods, you will need to provide an implementation of System.Runtime.CompilerServices.ExtensionAttribute. More good news is that the other C# 3.0 compiler features I tried (lambda expressions, object initializers, and automatic properties) work great.
Linq is out because of lack of generics support. Update: Appears Linq is possible. Thanks, Jens!
For the next update, I will be working with the Micro Framework’s WPF implementation to start building the user interface.