def send_GN_registration_request(self): # This event is set by sensor_controller after it stores the sensors' info in config file logger.debug("Waiting for sensors info." + "\n\n") # Waits till sensor_plugin object finishes writing to the config file # so that race conditions don't occur sensors_info_saved_event.wait() config = ConfigObj(config_file_name) temp_config = {} temp_config["Systems Info"] = config["Systems Info"] temp_config["Sensors Info"] = config["Sensors Info"] reg_payload = RegistrationPayload() reg_payload.sys_info = dict(temp_config) reg_payload.instance_id = get_instance_id() self.send_to_buffer_mngr(registration_type, no_reply, [reg_payload])
def send_ready_notification(self): # Waits till sensor_plugin object finishes writing new sensor's info \ # to the config file so that race conditions don't occur sensors_info_saved_event.wait() # TODO: Read sensors info here and prepare reg_payload self.send_to_buffer_mngr(registration_type, no_reply, reg_payload)