# 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 :OsdMessage, "dji_mqtt_connect/messages/thing/product/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 :ConfigRequestsMessage, "dji_mqtt_connect/messages/thing/product/config_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 :ConfigRequestsReplyMessage, "dji_mqtt_connect/messages/thing/product/config_requests_reply_message" # Topics 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 :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 # Utils module Utils autoload :MessageParsing, "dji_mqtt_connect/utils/message_parsing" 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)