http://mbed.org/teams/ACKme/code/WiConnect/#bc2b10351ee3