dji_mqtt_connect 0.1.34 → 0.1.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1aea3da1b601924d1a7fe899cedbdbeb7bf0f969173345348bd2b455e2b129d7
4
- data.tar.gz: ebcc8e6ed52d0dfafbe5d9588cf46a40349ed2b5798bef5c128831eb939a71a7
3
+ metadata.gz: ace0900f4c5fcc4f197c50ef0fa71015bc8cedcce7d20c338f70f7e0189ca31d
4
+ data.tar.gz: f59f7cea3698db298d814a7d614806604cec33343eff46fb041c037447bdf632
5
5
  SHA512:
6
- metadata.gz: 2c94d3325deaa697f911dc34a595099e050555a05cb19cc6f5c73a6404b05f37d51128eedbefcc28ca8188bd98aad43f785cb0813f4c61d6ad50650af2f414ad
7
- data.tar.gz: db6864b8cec104cab315c479e02d29fb31d539d35e7d225969b44599b730b9360d42aae6d070bdcd57f1e8166f6c774b61299769bf2794829f4e617b93dd724a
6
+ metadata.gz: 3d4afe1b0e79f7bbec3909c6d3ebaf80e34c8a1097c4747ddfa2a86d6ee00982efed2289e1787a9ef69aa81a57a018d49cd432d73537b69f9318b010e8a64175
7
+ data.tar.gz: 9feadda48f150692bc6c52d88bcdb839a50a15100a0ea67904037acd17266fd05e77605ed2fb89533c1b540b81efa7ef54c2e24d91883662d511c4a04388e65e
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DjiMqttConnect
4
+ module Factories::EventsMessages
5
+ def build_thing_product_obstacle_avoidance_notify_events_message
6
+ message_data = {
7
+ wayline_uuid: SecureRandom.uuid,
8
+ flight_id: SecureRandom.uuid,
9
+ obstacles: [
10
+ {
11
+ id: 0,
12
+ type: 0,
13
+ timestamp: 1654070968655,
14
+ latitude: 39.9042,
15
+ longitude: 116.4074,
16
+ height: 100,
17
+ wayline_id: 0,
18
+ waypoint_index: 1
19
+ },
20
+ {
21
+ id: 1,
22
+ type: 1,
23
+ timestamp: 1654070968655,
24
+ latitude: 39.9042,
25
+ longitude: 116.4074,
26
+ height: 100,
27
+ wayline_id: 0,
28
+ waypoint_index: 2
29
+ }
30
+ ],
31
+ is_final_report: true
32
+ }
33
+
34
+ Thing::Product::ObstacleAvoidanceNotifyEventsMessage.new(
35
+ bid: Message.generate_bid,
36
+ tid: Message.generate_tid,
37
+ timestamp: Message.current_timestamp,
38
+ _method: "obstacle_avoidance_notify",
39
+ need_reply: 1,
40
+ data: message_data,
41
+ _data: message_data
42
+ )
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DjiMqttConnect
4
+ module Factories::ServicesMessages
5
+ def build_thing_product_drc_mode_enter_services_message(data: build_thing_product_drc_mode_enter_services_message_data)
6
+ Thing::Product::DrcModeEnterServicesMessage.build(
7
+ data: data
8
+ )
9
+ end
10
+
11
+ def build_thing_product_drc_mode_enter_services_message_data
12
+ {
13
+ hsi_frequency: 1,
14
+ mqtt_broker: {
15
+ address: "mqtt.dji.com:8883",
16
+ client_id: "sn_a",
17
+ enable_tls: true,
18
+ expire_time: 1672744922,
19
+ password: "jwt_token",
20
+ username: "sn_a_username"
21
+ },
22
+ osd_frequency: 10
23
+ }
24
+ end
25
+
26
+ def build_thing_product_drc_mode_enter_services_reply_message(result: 0)
27
+ message_data = {
28
+ result: result
29
+ }
30
+
31
+ Thing::Product::DrcModeEnterServicesReplyMessage.new(
32
+ bid: SecureRandom.uuid,
33
+ tid: SecureRandom.uuid,
34
+ timestamp: Message.current_timestamp,
35
+ _method: "drc_mode_enter",
36
+ _data: message_data,
37
+ data: message_data
38
+ )
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DjiMqttConnect
4
+ module Factories::ServicesMessages
5
+ def build_thing_product_drc_mode_exit_services_message
6
+ Thing::Product::DrcModeExitServicesMessage.build
7
+ end
8
+
9
+ def build_thing_product_drc_mode_exit_services_reply_message(result: 0)
10
+ message_data = {
11
+ result: result
12
+ }
13
+
14
+ Thing::Product::DrcModeExitServicesReplyMessage.new(
15
+ bid: SecureRandom.uuid,
16
+ tid: SecureRandom.uuid,
17
+ timestamp: Message.current_timestamp,
18
+ _method: "drc_mode_exit",
19
+ _data: message_data,
20
+ data: message_data
21
+ )
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DjiMqttConnect
4
+ module Thing::Product
5
+ # https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/dock-to-cloud/mqtt/dock/dock3/drc.html#obstacle-avoidance-record-event-notification
6
+ class ObstacleAvoidanceNotifyEventsMessage < EventsMessage
7
+ # {0:"Detour start (mapped to wayline)",1:"Detour end (mapped to wayline)",2:"Obstacle braking (real physical coordinate)"}
8
+ OBSTACLE_TYPE_DETOUR_START = 0
9
+ OBSTACLE_TYPE_DETOUR_END = 1
10
+ OBSTACLE_TYPE_BRAKING = 2
11
+
12
+ attribute :_method, Types::String.enum("obstacle_avoidance_notify")
13
+
14
+ attribute :data do
15
+ attribute :wayline_uuid, Types::UUID
16
+
17
+ attribute :flight_id, Types::FlightID
18
+
19
+ attribute :obstacles, Types::Array do
20
+ attribute :id, Types::Integer
21
+
22
+ # {0:"Detour start (mapped to wayline)",1:"Detour end (mapped to wayline)",2:"Obstacle braking (real physical coordinate)"}
23
+ attribute :type, Types::Integer.enum(
24
+ OBSTACLE_TYPE_DETOUR_START,
25
+ OBSTACLE_TYPE_DETOUR_END,
26
+ OBSTACLE_TYPE_BRAKING
27
+ )
28
+
29
+ attribute :timestamp, Types::TimestampMS
30
+
31
+ attribute :latitude, Types::Latitude
32
+
33
+ attribute :longitude, Types::Longitude
34
+
35
+ attribute :height, Types::JSON::Decimal
36
+
37
+ attribute :wayline_id, Types::Integer
38
+
39
+ attribute :waypoint_index, Types::Integer
40
+ end
41
+
42
+ attribute :is_final_report, Types::Bool
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DjiMqttConnect
4
+ module Thing::Product
5
+ # https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/dock-to-cloud/mqtt/dock/dock3/drc.html#enter-live-flight-controls-mode
6
+ class DrcModeEnterServicesMessage < ServicesMessage
7
+ def self.build(data:, bid: generate_bid, tid: generate_tid, timestamp: current_timestamp)
8
+ new(
9
+ bid: bid,
10
+ tid: tid,
11
+ timestamp: timestamp,
12
+ _method: "drc_mode_enter",
13
+ data: data
14
+ )
15
+ end
16
+
17
+ attribute :_method, Types::String.enum("drc_mode_enter")
18
+
19
+ attribute :data do
20
+ attribute :mqtt_broker do
21
+ attribute :address, Types::String
22
+
23
+ # Customizable MQTT client ID. It is recommended to use the device's serial number (SN code). It can also be combined with a meaningful prefix, such as drc-4J4R101
24
+ attribute :client_id, Types::String
25
+
26
+ attribute :username, Types::String
27
+
28
+ attribute :password, Types::String
29
+
30
+ attribute :expire_time, Types::Integer
31
+
32
+ # Enable TLS, i.e., encrypt the MQTT link
33
+ attribute :enable_tls, Types::Bool
34
+ end
35
+
36
+ # {"max":30,"min":1,"unit_name":"Hertz / Hz"}
37
+ attribute :osd_frequency, Types::Integer
38
+
39
+ # {"max":30,"min":1,"unit_name":"Hertz / Hz"}
40
+ attribute :hsi_frequency, Types::Integer
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DjiMqttConnect
4
+ module Thing::Product
5
+ # https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/dock-to-cloud/mqtt/dock/dock3/drc.html#exit-live-flight-controls-mode
6
+ class DrcModeExitServicesMessage < ServicesMessage
7
+ def self.build(bid: generate_bid, tid: generate_tid, timestamp: current_timestamp)
8
+ new(
9
+ bid: bid,
10
+ tid: tid,
11
+ timestamp: timestamp,
12
+ _method: "drc_mode_exit",
13
+ data: {}
14
+ )
15
+ end
16
+
17
+ attribute :_method, Types::String.enum("drc_mode_exit")
18
+
19
+ attribute :data, Types::Hash
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DjiMqttConnect
4
+ module Thing::Product
5
+ class DrcModeEnterServicesReplyMessage < ServicesReplyMessage
6
+ attribute :_method, Types::String.enum("drc_mode_enter")
7
+
8
+ attribute :data do
9
+ attribute :result, Types::ResultCode
10
+ include Mixins::ResultCode
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DjiMqttConnect
4
+ module Thing::Product
5
+ class DrcModeExitServicesReplyMessage < ServicesReplyMessage
6
+ attribute :_method, Types::String.enum("drc_mode_exit")
7
+
8
+ attribute :data do
9
+ attribute :result, Types::ResultCode
10
+ include Mixins::ResultCode
11
+ end
12
+ end
13
+ end
14
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DjiMqttConnect
4
- VERSION = "0.1.34"
4
+ VERSION = "0.1.35"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dji_mqtt_connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.34
4
+ version: 0.1.35
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sphere Drones
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-03-11 00:00:00.000000000 Z
11
+ date: 2026-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -144,6 +144,7 @@ files:
144
144
  - lib/dji_mqtt_connect/factories/events/cover_close.rb
145
145
  - lib/dji_mqtt_connect/factories/events/cover_force_close.rb
146
146
  - lib/dji_mqtt_connect/factories/events/cover_open.rb
147
+ - lib/dji_mqtt_connect/factories/events/obstacle_avoidance_notify.rb
147
148
  - lib/dji_mqtt_connect/factories/events/ota_progress.rb
148
149
  - lib/dji_mqtt_connect/factories/events_messages.rb
149
150
  - lib/dji_mqtt_connect/factories/osd/dock.rb
@@ -169,6 +170,8 @@ files:
169
170
  - lib/dji_mqtt_connect/factories/services/charge_close.rb
170
171
  - lib/dji_mqtt_connect/factories/services/charge_open.rb
171
172
  - lib/dji_mqtt_connect/factories/services/cover_force_close.rb
173
+ - lib/dji_mqtt_connect/factories/services/drc_mode_enter.rb
174
+ - lib/dji_mqtt_connect/factories/services/drc_mode_exit.rb
172
175
  - lib/dji_mqtt_connect/factories/services/gimbal_reset.rb
173
176
  - lib/dji_mqtt_connect/factories/services/ir_metering_area_set.rb
174
177
  - lib/dji_mqtt_connect/factories/services/ir_metering_mode_set.rb
@@ -216,6 +219,7 @@ files:
216
219
  - lib/dji_mqtt_connect/messages/thing/product/events/fly_to_point_progress.rb
217
220
  - lib/dji_mqtt_connect/messages/thing/product/events/highest_priority_upload_flighttask_media.rb
218
221
  - lib/dji_mqtt_connect/messages/thing/product/events/hms.rb
222
+ - lib/dji_mqtt_connect/messages/thing/product/events/obstacle_avoidance_notify.rb
219
223
  - lib/dji_mqtt_connect/messages/thing/product/events/offline_map_sync_progress.rb
220
224
  - lib/dji_mqtt_connect/messages/thing/product/events/ota_progress.rb
221
225
  - lib/dji_mqtt_connect/messages/thing/product/events/release_terminal_control_area.rb
@@ -276,6 +280,8 @@ files:
276
280
  - lib/dji_mqtt_connect/messages/thing/product/services/cover_open.rb
277
281
  - lib/dji_mqtt_connect/messages/thing/product/services/debug_mode_close.rb
278
282
  - lib/dji_mqtt_connect/messages/thing/product/services/debug_mode_open.rb
283
+ - lib/dji_mqtt_connect/messages/thing/product/services/drc_mode_enter.rb
284
+ - lib/dji_mqtt_connect/messages/thing/product/services/drc_mode_exit.rb
279
285
  - lib/dji_mqtt_connect/messages/thing/product/services/drone_close.rb
280
286
  - lib/dji_mqtt_connect/messages/thing/product/services/drone_open.rb
281
287
  - lib/dji_mqtt_connect/messages/thing/product/services/fileupload_list.rb
@@ -332,6 +338,8 @@ files:
332
338
  - lib/dji_mqtt_connect/messages/thing/product/services_reply/cover_open.rb
333
339
  - lib/dji_mqtt_connect/messages/thing/product/services_reply/debug_mode_close.rb
334
340
  - lib/dji_mqtt_connect/messages/thing/product/services_reply/debug_mode_open.rb
341
+ - lib/dji_mqtt_connect/messages/thing/product/services_reply/drc_mode_enter.rb
342
+ - lib/dji_mqtt_connect/messages/thing/product/services_reply/drc_mode_exit.rb
335
343
  - lib/dji_mqtt_connect/messages/thing/product/services_reply/drone_close.rb
336
344
  - lib/dji_mqtt_connect/messages/thing/product/services_reply/drone_open.rb
337
345
  - lib/dji_mqtt_connect/messages/thing/product/services_reply/flight_authority_grab.rb