Skip to content

Commit

Permalink
return analog sensor values on HTTP-GET /messages
Browse files Browse the repository at this point in the history
  • Loading branch information
shokai committed Mar 19, 2014
1 parent 992a4a5 commit 8a89128
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions firmware/src/IRKit/IRKitHTTPHandler.cpp
Expand Up @@ -265,6 +265,14 @@ static int8_t on_get_messages_request(int8_t cid, GSwifi::GSREQUESTSTATE state)

gs.write("{\"format\":\"raw\",\"freq\":"); // format fixed to "raw" for now
gs.write(IrCtrl.freq);

gs.write(",\"sensor\":[");
for(char i = 0; i < 6; i++){
gs.write((uint8_t) analogRead(i));
if(i < 5) gs.write(",");
}
gs.write("]");

gs.write(",\"data\":[");
for (uint16_t i=0; i<IrCtrl.len; i++) {
gs.write( IR_get() );
Expand Down

0 comments on commit 8a89128

Please sign in to comment.