Implement network registration detection (untested)
Working network detection, implemented using AT+CREG? and pattern matching on the GSM module.  This was more straightforward and reliable than an arbitrary timeout on the controller.  The disadvantage is that the GSM module locks the bus while it is handling an 'open stream' RPC and waiting for network (in practice I have seen this take up to 9 seconds, the maximum timeout in the matching code is about 30 seconds).  RPC callbacks would circumvent this.
Add some more error case checking.  Don't allow multiple streams to be started (TODO: turn off the module if a stream is opened but never closed).  Remotely log errors if a message fails to send.
Fix the weird line ending residual error in the AT command pdf.
Add a bunch of logging to task_loop code, don't let the scheduler queue up multiple RPCs for a single callback, don't let the rpc_queue overflow.
Ensure that each scheduled callback is called only once.

This commit makes the semantics of scheduled_rpc callbacks best-effort
in the following sense.  If the bus is locked when the callback is scheduled,
it is queued as an RPC.  If the bus is still locked the next time the callback
is scheduled to run, another RPC is not generated.  Only once the bus is unlocked
and the RPC is sent is the callback cleared to be resent.

This commit has a glaring flaw:
- there is no way to know which callback has succeeded if there is more than one.
  so the code assumes that the lowest index scheduled callback that was in progress
  succeeded.  This does not matter when there is only one callback but we should
  generalize bus_master_rpc_async to pass an argument to the callback in addition
  to the status so that we can distinguish this case and it will be generally
  useful.
Fix bug in handling queued RPCs when the bus is locked.

- Always set mib_state.rpc_done to 0 in bus_master_sendrpc even when
  the bus is not idle so that a subsequent call to bus_master_rpc_async
  will only queue the RPC and not recall bus_master_sendrpc.  This would
  result in the first RPC being discarded.

This should be the correct behavior and was the intended behavior.
There was just a bug in the placement of mib_state.rpc_done = 0.
Add debug log entry when rpc_queue is full.

This makes sure we log when such a failure occurs and we have
to drop an RPC call.
Fix scheduler RPC deduplication, expand task_manager and rpc_queue.
Merge branch 'bug-reporting-hang' into feature-gsm-network-detection
Wait longer for network detection and message reception, actually exit with an error if we fail to register, wait longer after starting the SMS stream (for some reason Vodacom SIMs were taking longer than 50ms to send the > prompt)
Merge pull request #94 from WellDone/bug-reporting-hang

Reporting hang bug
Remove old controller board layout that is out of date
Update Controller Board Layout

- add sense line for external power
- move components for easier placement
- reroute long lines
- flip backup battery orientation to allow for easy insertion
- move cap away from crystal to avoid shorts
Begin document tracking board layout requirements
Initial microsim pad layout for checking against 3d model
Update board layout document
Revise GSM module to include pic16lf1847, microsim

Also updated layout for better reflow and moved
traces further from board edges.
Add gitattributes to protect sch,brd,lbr files
Fix multisensor board layout

- Add separate power supply for analog circuitry to
maintain voltage requirement.
- Fix data line connection on MIB bus
- Remove incorrect pin headers