/* Soil Sensor Data Decoding Module * Sensiplicity Systems * * Copyright 2015 * * Department of Botany and Plant Pathology * Center for Genome Research and Biocomputing * Oregon State University * Corvallis, OR 97331 * * This program is not free software; you can not redistribute it and/or * modify it at all. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ #include "soil-sensor.h" #include "sense-net.h" /* Type codes for soil sensors. */ const int TYPECODE_SOIL_1ZONE = 1; const int TYPECODE_SOIL_2ZONE = 2; const int TYPECODE_SOIL_4ZONE = 4; /* Print a block of memory to the given stream as a hexadecimal constant, prefixed with "0x". */ static void print_hex_stream(FILE *stream, char *data, int size){ if(0 == size)return; fprintf(stream, "0x"); for(int i=0;i 1){ fprintf(stream, " %3.1f,", m.moisture_z1); } else { fprintf(stream, ","); } if(m.zones > 2){ fprintf(stream, " %3.1f,", m.moisture_z2); } else { fprintf(stream, ","); } if(m.zones > 3){ fprintf(stream, " %3.1f\n", m.moisture_z3); } else { fprintf(stream, "\n"); } return 0; }