http://mbed.org/users/AjK/code/MODSERIAL/#af2af4c61c2f