- fprintf(stderr, "Received Data = %02x %02x %02x %02x %02x\n", bb[1][0], bb[1][1], bb[1][2], bb[1][3], bb[1][4]);
- if (wind) fprintf(stderr, "Rcvd Data 2 = %02x %02x %02x %02x %02x\n", bb[5][0], bb[5][1], bb[5][2], bb[5][3], bb[5][4]);
- /*
- * fprintf(stderr, "L2M: %02x %02x %02x %02x %02x\n",reverse8(bb[1][0]),reverse8(bb[1][1]),reverse8(bb[1][2]),reverse8(bb[1][3]),reverse8(bb[1][4]));
+ data = data_make("time", "", DATA_STRING, time_str,
+ "model", "", DATA_STRING, "AlectoV1 Temperature Sensor",
+ "id", "House Code", DATA_INT, sensor_id,
+ "channel", "Channel", DATA_INT, channel,
+ "battery", "Battery", DATA_STRING, battery_low ? "LOW" : "OK",
+ "temperature_C", "Temperature", DATA_FORMAT, "%.02f C", DATA_DOUBLE, (float) temp / 10.0F,
+ "humidity", "Humidity", DATA_FORMAT, "%u %%", DATA_INT, humidity,
+ NULL);
+ data_acquired_handler(data);
+ }
+ if (debug_output){
+ fprintf(stdout, "Checksum = %01x (calculated %01x)\n", bb[1][4] >> 4, csum);
+ fprintf(stdout, "Received Data = %02x %02x %02x %02x %02x\n", bb[1][0], bb[1][1], bb[1][2], bb[1][3], bb[1][4]);
+ if (wind) fprintf(stdout, "Rcvd Data 2 = %02x %02x %02x %02x %02x\n", bb[5][0], bb[5][1], bb[5][2], bb[5][3], bb[5][4]);
+ /*
+ * fprintf(stdout, "L2M: %02x %02x %02x %02x %02x\n",reverse8(bb[1][0]),reverse8(bb[1][1]),reverse8(bb[1][2]),reverse8(bb[1][3]),reverse8(bb[1][4]));