# 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 :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/update_topo_status_message" autoload :UpdateTopoStatusReplyMessage, "dji_mqtt_connect/messages/sys/product/update_topo_status_reply_message" # 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 :FileUploadCallbackEventsMessage, "dji_mqtt_connect/messages/thing/product/file_upload_callback_events_message" autoload :HmsEventsMessage, "dji_mqtt_connect/messages/thing/product/hms_events_message" autoload :StatusCodeEventsMessage, "dji_mqtt_connect/messages/thing/product/status_code_events_message" autoload :EventsMessage, "dji_mqtt_connect/messages/thing/product/events_message" autoload :OsdMessage, "dji_mqtt_connect/messages/thing/product/osd_message" autoload :DockOsdMessage, "dji_mqtt_connect/messages/thing/product/dock_osd_message" autoload :DroneOsdMessage, "dji_mqtt_connect/messages/thing/product/drone_osd_message" autoload :RemoteOsdMessage, "dji_mqtt_connect/messages/thing/product/remote_osd_message" autoload :AirportBindStatusRequestsMessage, "dji_mqtt_connect/messages/thing/product/airport_bind_status_requests_message" autoload :AirportOrganizationBindRequestsMessage, "dji_mqtt_connect/messages/thing/product/airport_organization_bind_requests_message" autoload :AirportOrganizationGetRequestsMessage, "dji_mqtt_connect/messages/thing/product/airport_organization_get_requests_message" autoload :ConfigRequestsMessage, "dji_mqtt_connect/messages/thing/product/config_requests_message" autoload :StorageConfigGetRequestsMessage, "dji_mqtt_connect/messages/thing/product/storage_config_get_requests_message" autoload :RequestsMessage, "dji_mqtt_connect/messages/thing/product/requests_message" autoload :AirportBindStatusRequestsReplyMessage, "dji_mqtt_connect/messages/thing/product/airport_bind_status_requests_reply_message" autoload :AirportOrganizationBindRequestsReplyMessage, "dji_mqtt_connect/messages/thing/product/airport_organization_bind_requests_reply_message" autoload :AirportOrganizationGetRequestsReplyMessage, "dji_mqtt_connect/messages/thing/product/airport_organization_get_requests_reply_message" autoload :ConfigRequestsReplyMessage, "dji_mqtt_connect/messages/thing/product/config_requests_reply_message" autoload :StorageConfigGetRequestsReplyMessage, "dji_mqtt_connect/messages/thing/product/storage_config_get_requests_reply_message" # Topics autoload :EventsTopicRepository, "dji_mqtt_connect/topics/thing/product/events" 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" # Marshals autoload :EventsMarshal, "dji_mqtt_connect/marshals/thing/product/events_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" end end # Mixinx module Mixins autoload :LatitudeConditional, "dji_mqtt_connect/mixins/latitude_conditional" autoload :LongitudeConditional, "dji_mqtt_connect/mixins/longitude_conditional" 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_id, default: MQTT::Client.generate_client_id(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)