Sha256: 62c8f35481b186972d06b03a286fd019c8da3fea4e63df39442ddec2322618fb

Contents?: true

Size: 863 Bytes

Versions: 16

Compression:

Stored size: 863 Bytes

Contents

# frozen_string_literal: true

module DjiMqttConnect
  module Sys::Product
    class UpdateTopoStatusReplyMessage < Message
      # Builds a reply for an update_topo status message
      # a result of 0 means we approve of this action
      def self.build_for(update_topo_status_message, result: 0)
        new(
          _method: update_topo_status_message._method,
          tid: update_topo_status_message.tid,
          bid: update_topo_status_message.bid,
          timestamp: Time.now.strftime("%s%L").to_i,
          data: {
            result: result
          }
        )
      end

      attribute :_method, Types::String.enum("update_topo")

      attribute :tid, Types::String
      attribute :bid, Types::String
      attribute :timestamp, Types::Integer
      attribute :data do
        attribute :result, Types::Integer
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
dji_mqtt_connect-0.1.11 lib/dji_mqtt_connect/messages/sys/product/update_topo_status_reply_message.rb
dji_mqtt_connect-0.1.10 lib/dji_mqtt_connect/messages/sys/product/update_topo_status_reply_message.rb
dji_mqtt_connect-0.1.9 lib/dji_mqtt_connect/messages/sys/product/update_topo_status_reply_message.rb
dji_mqtt_connect-0.1.8 lib/dji_mqtt_connect/messages/sys/product/update_topo_status_reply_message.rb
dji_mqtt_connect-0.1.7 lib/dji_mqtt_connect/messages/sys/product/update_topo_status_reply_message.rb
dji_mqtt_connect-0.1.6 lib/dji_mqtt_connect/messages/sys/product/update_topo_status_reply_message.rb
dji_mqtt_connect-0.1.5 lib/dji_mqtt_connect/messages/sys/product/update_topo_status_reply_message.rb
dji_mqtt_connect-0.1.4.1 lib/dji_mqtt_connect/messages/sys/product/update_topo_status_reply_message.rb
dji_mqtt_connect-0.1.4 lib/dji_mqtt_connect/messages/sys/product/update_topo_status_reply_message.rb
dji_mqtt_connect-0.1.3 lib/dji_mqtt_connect/messages/sys/product/update_topo_status_reply_message.rb
dji_mqtt_connect-0.1.2 lib/dji_mqtt_connect/messages/sys/product/update_topo_status_reply_message.rb
dji_mqtt_connect-0.1.1.4 lib/dji_mqtt_connect/messages/sys/product/update_topo_status_reply_message.rb
dji_mqtt_connect-0.1.1.3 lib/dji_mqtt_connect/messages/sys/product/update_topo_status_reply_message.rb
dji_mqtt_connect-0.1.1.2 lib/dji_mqtt_connect/messages/sys/product/update_topo_status_reply_message.rb
dji_mqtt_connect-0.1.1.1 lib/dji_mqtt_connect/messages/sys/product/update_topo_status_reply_message.rb
dji_mqtt_connect-0.1.1 lib/dji_mqtt_connect/messages/sys/product/update_topo_status_reply_message.rb