String handleIncomingMessage(void) { // Parse Message into: Instruction Code - ID - Parameter String return_message = ""; String incoming_message = communication.receive(); Instruction instruction = parseIncomingMessage(incoming_message); // Pass Parsed Message To All Objects and Update Return Message if Applicable if (instruction.valid) { return_message += sensor_water_ph_temperature_ec_default.set(instruction.code, instruction.id, instruction.parameter); return_message += sensor_tsl2561_light_intensity_default.set(instruction.code, instruction.id, instruction.parameter); return_message += sensor_dht22_air_temperature_humidity_default.set(instruction.code, instruction.id, instruction.parameter); return_message += sensor_gc0011_air_co2_temperature_humidity_default.set(instruction.code, instruction.id, instruction.parameter); return_message += actuator_relay_air_heater_default.set(instruction.code, instruction.id, instruction.parameter); return_message += actuator_relay_air_humidifier_default.set(instruction.code, instruction.id, instruction.parameter); return_message += actuator_relay_air_vent_default.set(instruction.code, instruction.id, instruction.parameter); return_message += actuator_relay_air_circulation_default.set(instruction.code, instruction.id, instruction.parameter); return_message += chamber_illumination_default.set(instruction.code, instruction.id, instruction.parameter); return_message += dose_pump1_default.set(instruction.code, instruction.id, instruction.parameter); return_message += dose_pump2_default.set(instruction.code, instruction.id, instruction.parameter); return_message += dose_pump3_default.set(instruction.code, instruction.id, instruction.parameter); return_message += dose_pump4_default.set(instruction.code, instruction.id, instruction.parameter); } return return_message; }
String handleIncomingMessage(void) { // Parse Message into: Instruction Code - ID - Parameter String return_message = ""; String incoming_message = communication.receive(); Instruction instruction = parseIncomingMessage(incoming_message); // Pass Parsed Message To All Objects and Update Return Message if Applicable if (instruction.valid) { //return_message += sensor_dfr01610300_water_ph_temperature_ec_default.set(instruction.code, instruction.id, instruction.parameter); return_message += sensor_venier_ph_default.set(instruction.code, instruction.id, instruction.parameter); return_message += sensor_vernier_ec_default.set(instruction.code, instruction.id, instruction.parameter); return_message += sensor_ds18b20_water_temperature.set(instruction.code, instruction.id, instruction.parameter); return_message += sensor_tsl2561_light_intensity_default.set(instruction.code, instruction.id, instruction.parameter); return_message += sensor_dht22_air_temperature_humidity_default.set(instruction.code, instruction.id, instruction.parameter); return_message += sensor_gc0011_air_co2_temperature_humidity_default.set(instruction.code, instruction.id, instruction.parameter); return_message += sensor_contact_switch_general_shell_open_default.set(instruction.code, instruction.id, instruction.parameter); return_message += sensor_contact_switch_general_window_open_default.set(instruction.code, instruction.id, instruction.parameter); return_message += actuator_relay_air_heater_default.set(instruction.code, instruction.id, instruction.parameter); return_message += actuator_relay_air_humidifier_default.set(instruction.code, instruction.id, instruction.parameter); return_message += actuator_relay_air_vent_default.set(instruction.code, instruction.id, instruction.parameter); return_message += actuator_relay_air_circulation_default.set(instruction.code, instruction.id, instruction.parameter); return_message += actuator_relay_light_panel_default.set(instruction.code, instruction.id, instruction.parameter); return_message += actuator_relay_light_chamber_illumination_default.set(instruction.code, instruction.id, instruction.parameter); return_message += actuator_relay_light_motherboard_illumination_default.set(instruction.code, instruction.id, instruction.parameter); } return return_message; }