dji_mqtt_connect 0.1.10 → 0.1.11

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: acdbcd3a64661ee53c4a9cc75d4e059eed52a3ab3eb6f19e9b7dc9beca46d18f
4
- data.tar.gz: de8b3c76bf634c59efceaf9a57a1fb6db4b7559b9a10ec8e045f69f6c986d529
3
+ metadata.gz: 2685591a0d96c757f12c00f683a9dc45ee25b81091414dc81d72f93ccfe2f324
4
+ data.tar.gz: 53e45915630050082bd9dd1ddeb228d1eb9ce318d47eab213e0df0fb42c4d18a
5
5
  SHA512:
6
- metadata.gz: 7fb2327163be78ae6f9ca5ac162f390a89a14368063651857a49b3534147b730d2b1136eb5b490848487a75c65b9cbccae65223967d2dbe7dac79c15e2c50946
7
- data.tar.gz: 28648d5e4c19f0d6016cfd73e1af08dd9d7cc54f25fd4c1ac09aab860969d22cc0a64dc94f6acb90bf5e48ab41fc05d0ff253a32706b01db4aeb10f94047e467
6
+ metadata.gz: fc83f3608e9162591d40e6bc0115f804b55d779149ef6612a3ae84b4864e98052e5d40b8faedc8b2f541fa056e589b9c1c7eba79dd3a812f35012c72b906947b
7
+ data.tar.gz: da787b447741b0236e9c31bb28ea04ef33a900e47f5386e18dff9ebd43d243449a7d3119a9348f9f0515c314887288b4b3021b88ab4d522d6c8a266952a51ace
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dji_mqtt_connect (0.1.10)
4
+ dji_mqtt_connect (0.1.11)
5
5
  activesupport (>= 6.0, <= 8)
6
6
  dry-struct (~> 1.6)
7
7
  dry-transformer (~> 1.0)
@@ -44,6 +44,60 @@ module DjiMqttConnect
44
44
  )
45
45
  end
46
46
 
47
+ def build_fileupload_progress_events_message
48
+ message_data = {
49
+ output: {
50
+ ext: {
51
+ files: [
52
+ {
53
+ module: "0",
54
+ size: 155232,
55
+ device_sn: "drone_sn",
56
+ key: "4bf0039f-6434-44a8-b891-8d7b6b7ff138/drone_sn/video_20220621_110830.log",
57
+ fingerprint: "4f65b891f3bc09bdb6d4c36a996b532d",
58
+ progress: {
59
+ current_step: 19,
60
+ prgress: 100,
61
+ finish_time: 1655781395926,
62
+ upload_rate: 0,
63
+ result: 0,
64
+ status: "ok"
65
+ }
66
+ },
67
+ {
68
+ module: "3",
69
+ size: 155232,
70
+ device_sn: "dock_sn",
71
+ key: "4bf0039f-6434-44a8-b891-8d7b6b7ff138/dock_sn/video_20220621_110830.log",
72
+ fingerprint: "4f65b891f3bc09bdb6d4c36a996b532d",
73
+ progress: {
74
+ current_step: 19,
75
+ total_step: 30,
76
+ prgress: 100,
77
+ finish_time: 1655781395926,
78
+ upload_rate: 0,
79
+ result: 0,
80
+ status: "ok"
81
+ }
82
+ }
83
+ ]
84
+ },
85
+ status: "ok"
86
+ }
87
+ }
88
+
89
+ Thing::Product::FileuploadProgressEventsMessage.new(
90
+ _method: "fileupload_progress",
91
+ need_reply: 0,
92
+ bid: "12345678-1234-1234-1234-12345678901B",
93
+ tid: "12345678-1234-1234-1234-12345678901A",
94
+ timestamp: 1655781395926,
95
+ gateway: "dock_sn",
96
+ _data: message_data,
97
+ data: message_data
98
+ )
99
+ end
100
+
47
101
  def build_highest_priority_upload_flighttask_media_events_message
48
102
  message_data = {
49
103
  flight_id: SecureRandom.uuid
@@ -23,6 +23,7 @@ module DjiMqttConnect
23
23
 
24
24
  attribute :_method, Types::String.enum(
25
25
  "file_upload_callback",
26
+ "fileupload_progress",
26
27
  "highest_priority_upload_flighttask_media"
27
28
  )
28
29
 
@@ -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/server-api-reference/mqtt/thing-model/gateway/dock/log.html#inform-of-file-uploading-progress
6
+ class FileuploadProgressEventsMessage < EventsMessage
7
+ attribute :_method, Types::String.enum("fileupload_progress")
8
+
9
+ # NOTE: Not documented, but appears in examples
10
+ attribute? :need_reply, Types::Integer.enum(0, 1)
11
+
12
+ attribute :data do
13
+ attribute :output do
14
+ attribute :ext do
15
+ attribute :files, Types::Array do
16
+ # {"0":"Aircraft","3":"DJI Dock"}
17
+ attribute :module, Types::Coercible::Integer.enum(0, 3)
18
+
19
+ attribute :size, Types::Integer
20
+ attribute :device_sn, Types::String
21
+ attribute :key, Types::String
22
+ attribute :fingerprint, Types::String
23
+
24
+ attribute :progress do
25
+ attribute :current_step, Types::Integer
26
+ attribute? :total_step, Types::Integer
27
+ attribute :prgress, Types::Integer
28
+ attribute :finish_time, Types::Timestamp
29
+ attribute :upload_rate, Types::Integer
30
+ attribute :result, Types::Integer
31
+ attribute :status, Types::String
32
+ end
33
+ end
34
+ end
35
+ attribute :status, Types::String
36
+ end
37
+ end
38
+
39
+ def need_reply?
40
+ need_reply == 1
41
+ end
42
+ end
43
+ end
44
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DjiMqttConnect
4
- VERSION = "0.1.10"
4
+ VERSION = "0.1.11"
5
5
  end
@@ -35,6 +35,7 @@ module DjiMqttConnect
35
35
  module Product
36
36
  # Messages
37
37
  autoload :FileUploadCallbackEventsMessage, "dji_mqtt_connect/messages/thing/product/file_upload_callback_events_message"
38
+ autoload :FileuploadProgressEventsMessage, "dji_mqtt_connect/messages/thing/product/fileupload_progress_events_message"
38
39
  autoload :HighestPriorityUploadFlighttaskMediaEventsMessage, "dji_mqtt_connect/messages/thing/product/highest_priority_upload_flighttask_media_events_message"
39
40
  autoload :HmsEventsMessage, "dji_mqtt_connect/messages/thing/product/hms_events_message"
40
41
  autoload :StatusCodeEventsMessage, "dji_mqtt_connect/messages/thing/product/status_code_events_message"
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.10
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sphere Drones
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-05-25 00:00:00.000000000 Z
11
+ date: 2023-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -135,6 +135,7 @@ files:
135
135
  - lib/dji_mqtt_connect/messages/thing/product/events_message.rb
136
136
  - lib/dji_mqtt_connect/messages/thing/product/events_reply_message.rb
137
137
  - lib/dji_mqtt_connect/messages/thing/product/file_upload_callback_events_message.rb
138
+ - lib/dji_mqtt_connect/messages/thing/product/fileupload_progress_events_message.rb
138
139
  - lib/dji_mqtt_connect/messages/thing/product/highest_priority_upload_flighttask_media_events_message.rb
139
140
  - lib/dji_mqtt_connect/messages/thing/product/hms_events_message.rb
140
141
  - lib/dji_mqtt_connect/messages/thing/product/osd_message.rb