CodeBlue: An Ad Hoc Sensor Network Infrastructure for Emergency Medical Care