# frozen_string_literal: true require "active_support" require "mqtt" require_relative "dji_mqtt_connect/version" require_relative "dji_mqtt_connect/error" module DjiMqttConnect autoload :Client, "dji_mqtt_connect/client" autoload :Message, "dji_mqtt_connect/message" autoload :MessageMarshal, "dji_mqtt_connect/message_marshal" autoload :TopicRepository, "dji_mqtt_connect/topic_repository" autoload :Translations, "dji_mqtt_connect/translations" autoload :Types, "dji_mqtt_connect/types" module Sys module Product # Messages autoload :StatusMessage, "dji_mqtt_connect/messages/sys/product/status_message" autoload :UpdateTopoStatusMessage, "dji_mqtt_connect/messages/sys/product/status/update_topo" autoload :UpdateTopoStatusReplyMessage, "dji_mqtt_connect/messages/sys/product/status_reply/update_topo" # Topics autoload :StatusTopicRepository, "dji_mqtt_connect/topics/sys/product/status" autoload :StatusReplyTopicRepository, "dji_mqtt_connect/topics/sys/product/status_reply" # Marshals autoload :StatusMarshal, "dji_mqtt_connect/marshals/sys/product/status_marshal" autoload :StatusReplyMarshal, "dji_mqtt_connect/marshals/sys/product/status_reply_marshal" end end module Thing module Product # Messages autoload :CoverCloseEventsMessage, "dji_mqtt_connect/messages/thing/product/events/cover_close" autoload :CoverOpenEventsMessage, "dji_mqtt_connect/messages/thing/product/events/cover_open" autoload :DeviceLogEventsMessage, "dji_mqtt_connect/messages/thing/product/events/device_log" autoload :DeviceRebootEventsMessage, "dji_mqtt_connect/messages/thing/product/events/device_reboot" autoload :DeviceExitHomingNotifyEventsMessage, "dji_mqtt_connect/messages/thing/product/events/device_exit_homing_notify" autoload :FileUploadCallbackEventsMessage, "dji_mqtt_connect/messages/thing/product/events/file_upload_callback" autoload :FileuploadProgressEventsMessage, "dji_mqtt_connect/messages/thing/product/events/fileupload_progress" autoload :FlighttaskProgressEventsMessage, "dji_mqtt_connect/messages/thing/product/events/flighttask_progress" autoload :FlighttaskReadyEventsMessage, "dji_mqtt_connect/messages/thing/product/events/flighttask_ready" autoload :HighestPriorityUploadFlighttaskMediaEventsMessage, "dji_mqtt_connect/messages/thing/product/events/highest_priority_upload_flighttask_media" autoload :HmsEventsMessage, "dji_mqtt_connect/messages/thing/product/events/hms" autoload :StatusCodeEventsMessage, "dji_mqtt_connect/messages/thing/product/events/status_code" autoload :EventsMessage, "dji_mqtt_connect/messages/thing/product/events_message" autoload :EventsReplyMessage, "dji_mqtt_connect/messages/thing/product/events_reply_message" autoload :OsdMessage, "dji_mqtt_connect/messages/thing/product/osd_message" autoload :DockOsdMessage, "dji_mqtt_connect/messages/thing/product/osd/dock" autoload :DroneOsdMessage, "dji_mqtt_connect/messages/thing/product/osd/drone" autoload :RemoteOsdMessage, "dji_mqtt_connect/messages/thing/product/osd/remote" autoload :AirportBindStatusRequestsMessage, "dji_mqtt_connect/messages/thing/product/requests/airport_bind_status" autoload :AirportOrganizationBindRequestsMessage, "dji_mqtt_connect/messages/thing/product/requests/airport_organization_bind" autoload :AirportOrganizationGetRequestsMessage, "dji_mqtt_connect/messages/thing/product/requests/airport_organization_get" autoload :ConfigRequestsMessage, "dji_mqtt_connect/messages/thing/product/requests/config" autoload :FlighttaskResourceGetRequestsMessage, "dji_mqtt_connect/messages/thing/product/requests/flighttask_resource_get" autoload :StorageConfigGetRequestsMessage, "dji_mqtt_connect/messages/thing/product/requests/storage_config_get" autoload :RequestsMessage, "dji_mqtt_connect/messages/thing/product/requests_message" autoload :AirportBindStatusRequestsReplyMessage, "dji_mqtt_connect/messages/thing/product/requests_reply/airport_bind_status" autoload :AirportOrganizationBindRequestsReplyMessage, "dji_mqtt_connect/messages/thing/product/requests_reply/airport_organization_bind" autoload :AirportOrganizationGetRequestsReplyMessage, "dji_mqtt_connect/messages/thing/product/requests_reply/airport_organization_get" autoload :ConfigRequestsReplyMessage, "dji_mqtt_connect/messages/thing/product/requests_reply/config" autoload :FlighttaskResourceGetRequestsReplyMessage, "dji_mqtt_connect/messages/thing/product/requests_reply/flighttask_resource_get" autoload :StorageConfigGetRequestsReplyMessage, "dji_mqtt_connect/messages/thing/product/requests_reply/storage_config_get" autoload :ServicesMessage, "dji_mqtt_connect/messages/thing/product/services_message" autoload :AlarmStateSwitchServicesMessage, "dji_mqtt_connect/messages/thing/product/services/alarm_state_switch" autoload :CoverCloseServicesMessage, "dji_mqtt_connect/messages/thing/product/services/cover_close" autoload :CoverOpenServicesMessage, "dji_mqtt_connect/messages/thing/product/services/cover_open" autoload :DebugModeCloseServicesMessage, "dji_mqtt_connect/messages/thing/product/services/debug_mode_close" autoload :DebugModeOpenServicesMessage, "dji_mqtt_connect/messages/thing/product/services/debug_mode_open" autoload :FileuploadListServicesMessage, "dji_mqtt_connect/messages/thing/product/services/fileupload_list" autoload :FileuploadStartServicesMessage, "dji_mqtt_connect/messages/thing/product/services/fileupload_start" autoload :FlighttaskExecuteServicesMessage, "dji_mqtt_connect/messages/thing/product/services/flighttask_execute" autoload :FlighttaskPauseServicesMessage, "dji_mqtt_connect/messages/thing/product/services/flighttask_pause" autoload :FlighttaskPrepareServicesMessage, "dji_mqtt_connect/messages/thing/product/services/flighttask_prepare" autoload :FlighttaskRecoveryServicesMessage, "dji_mqtt_connect/messages/thing/product/services/flighttask_recovery" autoload :FlighttaskUndoServicesMessage, "dji_mqtt_connect/messages/thing/product/services/flighttask_undo" autoload :ReturnHomeServicesMessage, "dji_mqtt_connect/messages/thing/product/services/return_home" autoload :ReturnHomeCancelServicesMessage, "dji_mqtt_connect/messages/thing/product/services/return_home_cancel" autoload :ServicesReplyMessage, "dji_mqtt_connect/messages/thing/product/services_reply_message" autoload :AlarmStateSwitchServicesReplyMessage, "dji_mqtt_connect/messages/thing/product/services_reply/alarm_state_switch" autoload :CoverCloseServicesReplyMessage, "dji_mqtt_connect/messages/thing/product/services_reply/cover_close" autoload :CoverOpenServicesReplyMessage, "dji_mqtt_connect/messages/thing/product/services_reply/cover_open" autoload :DebugModeCloseServicesReplyMessage, "dji_mqtt_connect/messages/thing/product/services_reply/debug_mode_close" autoload :DebugModeOpenServicesReplyMessage, "dji_mqtt_connect/messages/thing/product/services_reply/debug_mode_open" autoload :FlighttaskExecuteServicesReplyMessage, "dji_mqtt_connect/messages/thing/product/services_reply/flighttask_execute" autoload :FlighttaskPauseServicesReplyMessage, "dji_mqtt_connect/messages/thing/product/services_reply/flighttask_pause" autoload :FlighttaskPrepareServicesReplyMessage, "dji_mqtt_connect/messages/thing/product/services_reply/flighttask_prepare" autoload :FlighttaskRecoveryServicesReplyMessage, "dji_mqtt_connect/messages/thing/product/services_reply/flighttask_recovery" autoload :FlighttaskUndoServicesReplyMessage, "dji_mqtt_connect/messages/thing/product/services_reply/flighttask_undo" autoload :ReturnHomeServicesReplyMessage, "dji_mqtt_connect/messages/thing/product/services_reply/return_home" autoload :ReturnHomeCancelServicesReplyMessage, "dji_mqtt_connect/messages/thing/product/services_reply/return_home_cancel" # Topics autoload :EventsTopicRepository, "dji_mqtt_connect/topics/thing/product/events" autoload :EventsReplyTopicRepository, "dji_mqtt_connect/topics/thing/product/events_reply" autoload :OsdTopicRepository, "dji_mqtt_connect/topics/thing/product/osd" autoload :RequestsTopicRepository, "dji_mqtt_connect/topics/thing/product/requests" autoload :RequestsReplyTopicRepository, "dji_mqtt_connect/topics/thing/product/requests_reply" autoload :ServicesTopicRepository, "dji_mqtt_connect/topics/thing/product/services" autoload :ServicesReplyTopicRepository, "dji_mqtt_connect/topics/thing/product/services_reply" # Marshals autoload :EventsMarshal, "dji_mqtt_connect/marshals/thing/product/events_marshal" autoload :EventsReplyMarshal, "dji_mqtt_connect/marshals/thing/product/events_reply_marshal" autoload :OsdMarshal, "dji_mqtt_connect/marshals/thing/product/osd_marshal" autoload :RequestsMarshal, "dji_mqtt_connect/marshals/thing/product/requests_marshal" autoload :RequestsReplyMarshal, "dji_mqtt_connect/marshals/thing/product/requests_reply_marshal" autoload :ServicesMarshal, "dji_mqtt_connect/marshals/thing/product/services_marshal" autoload :ServicesReplyMarshal, "dji_mqtt_connect/marshals/thing/product/services_reply_marshal" end end # Mixinx module Mixins autoload :EventsProgressChecks, "dji_mqtt_connect/mixins/events_progress_checks" autoload :LatitudeConditional, "dji_mqtt_connect/mixins/latitude_conditional" autoload :LongitudeConditional, "dji_mqtt_connect/mixins/longitude_conditional" autoload :ServicesOutputStatusChecks, "dji_mqtt_connect/mixins/services_output_status_checks" autoload :TemperatureConditional, "dji_mqtt_connect/mixins/temperature_conditional" end # Utils module Utils autoload :MessageParsing, "dji_mqtt_connect/utils/message_parsing" autoload :MessageSanitizer, "dji_mqtt_connect/utils/message_sanitizer" autoload :MessageSchemaGenerator, "dji_mqtt_connect/utils/message_schema_generator" autoload :MqttxFixtureDataGenerator, "dji_mqtt_connect/utils/mqttx_fixture_data_generator" end # Railties module Railties autoload :MessageSerializer, "dji_mqtt_connect/railties/message_serializer" end cattr_accessor :client_name, default: name cattr_accessor :logger, default: ActiveSupport::TaggedLogging.new(ActiveSupport::Logger.new($stdout)).tap { |logger| logger.level = Logger::INFO } end require "dji_mqtt_connect/railtie" if defined?(Rails::Railtie)