Pinoccio/library-pinoccio — pull request #147 by quartzjer (2014-06-28 23:40:53+00:00)
Title: experimenting with lead scout bridging at the socket level

This implements a bridging mode where it fully becomes the lead scout and just sends the hq json wire protocol over serial instead of a socket. Should be very re-usable for BLE bridging too, and easier to refactor in the future.

```
Hello from Pinoccio!
(Shell based on Bitlash v2.0 (c) 2014 Bill Roy)
Custom Sketch (rev unknown)
18563 bytes free
Field Scout ready
> hq.bridge()
[hq-bridge] {"type":"token","token":"6e42245b08c7f62512255eb98ffa7a72"}
> hq.bridge("{\"type\":\"online\"}\n")
[hq-bridge] {"type":"report","from":4,"report":{"type":"scout","lead":true,"version":255,"hardware":255,"family":-1,"serial":-1,"sketch":"Custom","build":-1,"revision":"unknown"}}
[hq-bridge] {"type":"report","from":4,"report":{"type":"uptime","millis":87688,"sleep":0,"random":-21287,"reset":"External"}}
[hq-bridge] {"type":"report","from":4,"report":{"type":"power","battery":60,"voltage":400,"charging":true,"vcc":true}}
[hq-bridge] {"type":"report","from":4,"report":{"type":"backpacks","list":[]}}
[hq-bridge] {"type":"report","from":4,"report":{"type":"digital","mode":[-1,-1,-1,-1,-1,-1,-1],"state":[-1,-1,-1,-1,-1,-1,-1]}}
[hq-bridge] {"type":"report","from":4,"report":{"type":"analog","mode":[-1,-1,-1,-1,-1,-1,-1,-1],"state":[-1,-1,-1,-1,-1,-1,-1,-1]}}
[hq-bridge] {"type":"report","from":4,"report":{"type":"mesh","scoutid":4,"troopid":1,"routes":0,"channel":20,"rate":"250 kb/s","power":"3.5 dBm"}}
[hq-bridge] {"type":"report","from":4,"report":{"type":"temp","c":43,"f":115}}
[hq-bridge] {"type":"report","from":4,"report":{"type":"led","led":[0,0,0],"torch":[0,221,255]}}
```