dji_mqtt_connect 0.1.17.1 → 0.1.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/dji_mqtt_connect/factories.rb +19 -0
- data/lib/dji_mqtt_connect/messages/thing/product/events/return_home_info.rb +23 -0
- data/lib/dji_mqtt_connect/messages/thing/product/requests/flight_areas_get.rb +13 -0
- data/lib/dji_mqtt_connect/messages/thing/product/requests_reply/flight_areas_get.rb +41 -0
- data/lib/dji_mqtt_connect/types.rb +2 -1
- data/lib/dji_mqtt_connect/version.rb +1 -1
- data/lib/dji_mqtt_connect.rb +3 -0
- metadata +4 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3117bb4030bc57798727bd9662d823aae2cbd7db679d9050920ebb70b388e5d4
|
4
|
+
data.tar.gz: e2e53cf583b2ce534e299f943b6df75dcd76f5d71a17d53d18ff880606cf6a93
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42fd75bc917811fea4a3aeb2e70a13208ee382a0c5cd3d46bb187dcf74afe8127a66453f955567724f8d737625e4d20ecfc384d8593e3f02d6d559f828177a49
|
7
|
+
data.tar.gz: 679082d2bfb093adb333a4b091971bb6fd8a55b9048d55cecc80d6823b85af1b92fdeccc5fcc6ab56a42fe7209b9b3ba7d707dd2f06956587b5a2d74f4c20fb0
|
data/Gemfile.lock
CHANGED
@@ -557,6 +557,25 @@ module DjiMqttConnect
|
|
557
557
|
)
|
558
558
|
end
|
559
559
|
|
560
|
+
def build_thing_product_flight_areas_get_requests_message
|
561
|
+
message_data = {}
|
562
|
+
|
563
|
+
Thing::Product::FlightAreasGetRequestsMessage.new(
|
564
|
+
_method: "flight_areas_get",
|
565
|
+
tid: Message.generate_tid,
|
566
|
+
bid: Message.generate_bid,
|
567
|
+
timestamp: Message.current_timestamp,
|
568
|
+
gateway: "gatewaysn",
|
569
|
+
data: message_data,
|
570
|
+
_data: message_data.deep_stringify_keys
|
571
|
+
)
|
572
|
+
end
|
573
|
+
|
574
|
+
def build_thing_product_flight_areas_get_requests_reply_message
|
575
|
+
request_message = build_thing_product_flight_areas_get_requests_message
|
576
|
+
Thing::Product::FlightAreasGetRequestsReplyMessage.build_for(request_message, files: [])
|
577
|
+
end
|
578
|
+
|
560
579
|
def build_thing_product_flighttask_resource_get_requests_message
|
561
580
|
message_data = {
|
562
581
|
flight_id: SecureRandom.uuid
|
@@ -0,0 +1,23 @@
|
|
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/wayline.html#return-to-home-information
|
6
|
+
class ReturnHomeInfoEventsMessage < EventsMessage
|
7
|
+
attribute :_method, Types::String.enum("return_home_info")
|
8
|
+
|
9
|
+
attribute :data do
|
10
|
+
attribute :planned_path_points, Types::Array do
|
11
|
+
attribute :latitude, Types::Latitude
|
12
|
+
attribute :longitude, Types::Longitude
|
13
|
+
attribute :height, Types::JSON::Decimal
|
14
|
+
end
|
15
|
+
|
16
|
+
# {"0":"Last point of trajectory is located above the return point.","1":"Last point of trajectory is not located above the return point."}
|
17
|
+
attribute :last_point_type, Types::Integer.enum(0, 1)
|
18
|
+
|
19
|
+
attribute :flight_id, Types::String
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module DjiMqttConnect
|
4
|
+
module Thing::Product
|
5
|
+
# Get the wayline task resource
|
6
|
+
# # https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/dock-to-cloud/mqtt/dock/custom_fly_area.html#get-custom-flight-area-file
|
7
|
+
class FlightAreasGetRequestsMessage < RequestsMessage
|
8
|
+
attribute :_method, Types::String.enum("flight_areas_get")
|
9
|
+
|
10
|
+
attribute :data, Types::Hash
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,41 @@
|
|
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/custom_fly_area.html#get-custom-flight-area-file
|
6
|
+
class FlightAreasGetRequestsReplyMessage < Message
|
7
|
+
def self.build_for(flight_areas_get, files:, result: 0)
|
8
|
+
new(
|
9
|
+
_method: flight_areas_get._method,
|
10
|
+
data: {
|
11
|
+
result: result,
|
12
|
+
output: {
|
13
|
+
files: files
|
14
|
+
}
|
15
|
+
},
|
16
|
+
tid: flight_areas_get.tid,
|
17
|
+
bid: flight_areas_get.bid,
|
18
|
+
timestamp: current_timestamp
|
19
|
+
)
|
20
|
+
end
|
21
|
+
|
22
|
+
attribute :tid, Types::UUID
|
23
|
+
attribute :bid, Types::UUID
|
24
|
+
attribute :timestamp, Types::Timestamp
|
25
|
+
|
26
|
+
attribute :_method, Types::String.enum("flight_areas_get")
|
27
|
+
attribute :data do
|
28
|
+
attribute :result, Types::ResultCode
|
29
|
+
|
30
|
+
attribute :output do
|
31
|
+
attribute :files, Types::Array do
|
32
|
+
attribute :name, Types::String
|
33
|
+
attribute :url, Types::String
|
34
|
+
attribute :checksum, Types::String
|
35
|
+
attribute :size, Types::Integer
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -59,7 +59,8 @@ module DjiMqttConnect
|
|
59
59
|
"drone_paddle_reverse",
|
60
60
|
"drone_paddle_stop",
|
61
61
|
"free_putter",
|
62
|
-
"stop_charge"
|
62
|
+
"stop_charge",
|
63
|
+
"plc_check"
|
63
64
|
)
|
64
65
|
|
65
66
|
# {"sent":"sent","in_progress":"in progress","ok":"success","paused":"paused","rejected":"rejected","failed":"failed","canceled":"canceled or stopped","timeout":"timeout"}
|
data/lib/dji_mqtt_connect.rb
CHANGED
@@ -45,6 +45,7 @@ module DjiMqttConnect
|
|
45
45
|
autoload :FlighttaskReadyEventsMessage, "dji_mqtt_connect/messages/thing/product/events/flighttask_ready"
|
46
46
|
autoload :HighestPriorityUploadFlighttaskMediaEventsMessage, "dji_mqtt_connect/messages/thing/product/events/highest_priority_upload_flighttask_media"
|
47
47
|
autoload :HmsEventsMessage, "dji_mqtt_connect/messages/thing/product/events/hms"
|
48
|
+
autoload :ReturnHomeInfoEventsMessage, "dji_mqtt_connect/messages/thing/product/events/return_home_info"
|
48
49
|
autoload :StatusCodeEventsMessage, "dji_mqtt_connect/messages/thing/product/events/status_code"
|
49
50
|
autoload :TrackEventsMessage, "dji_mqtt_connect/messages/thing/product/events/track"
|
50
51
|
autoload :EventsMessage, "dji_mqtt_connect/messages/thing/product/events_message"
|
@@ -60,6 +61,7 @@ module DjiMqttConnect
|
|
60
61
|
autoload :AirportOrganizationBindRequestsMessage, "dji_mqtt_connect/messages/thing/product/requests/airport_organization_bind"
|
61
62
|
autoload :AirportOrganizationGetRequestsMessage, "dji_mqtt_connect/messages/thing/product/requests/airport_organization_get"
|
62
63
|
autoload :ConfigRequestsMessage, "dji_mqtt_connect/messages/thing/product/requests/config"
|
64
|
+
autoload :FlightAreasGetRequestsMessage, "dji_mqtt_connect/messages/thing/product/requests/flight_areas_get"
|
63
65
|
autoload :FlighttaskResourceGetRequestsMessage, "dji_mqtt_connect/messages/thing/product/requests/flighttask_resource_get"
|
64
66
|
autoload :StorageConfigGetRequestsMessage, "dji_mqtt_connect/messages/thing/product/requests/storage_config_get"
|
65
67
|
autoload :RequestsMessage, "dji_mqtt_connect/messages/thing/product/requests_message"
|
@@ -67,6 +69,7 @@ module DjiMqttConnect
|
|
67
69
|
autoload :AirportBindStatusRequestsReplyMessage, "dji_mqtt_connect/messages/thing/product/requests_reply/airport_bind_status"
|
68
70
|
autoload :AirportOrganizationBindRequestsReplyMessage, "dji_mqtt_connect/messages/thing/product/requests_reply/airport_organization_bind"
|
69
71
|
autoload :AirportOrganizationGetRequestsReplyMessage, "dji_mqtt_connect/messages/thing/product/requests_reply/airport_organization_get"
|
72
|
+
autoload :FlightAreasGetRequestsReplyMessage, "dji_mqtt_connect/messages/thing/product/requests_reply/flight_areas_get"
|
70
73
|
autoload :ConfigRequestsReplyMessage, "dji_mqtt_connect/messages/thing/product/requests_reply/config"
|
71
74
|
autoload :FlighttaskResourceGetRequestsReplyMessage, "dji_mqtt_connect/messages/thing/product/requests_reply/flighttask_resource_get"
|
72
75
|
autoload :StorageConfigGetRequestsReplyMessage, "dji_mqtt_connect/messages/thing/product/requests_reply/storage_config_get"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dji_mqtt_connect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sphere Drones
|
@@ -138,6 +138,7 @@ files:
|
|
138
138
|
- lib/dji_mqtt_connect/messages/thing/product/events/flighttask_ready.rb
|
139
139
|
- lib/dji_mqtt_connect/messages/thing/product/events/highest_priority_upload_flighttask_media.rb
|
140
140
|
- lib/dji_mqtt_connect/messages/thing/product/events/hms.rb
|
141
|
+
- lib/dji_mqtt_connect/messages/thing/product/events/return_home_info.rb
|
141
142
|
- lib/dji_mqtt_connect/messages/thing/product/events/status_code.rb
|
142
143
|
- lib/dji_mqtt_connect/messages/thing/product/events/track.rb
|
143
144
|
- lib/dji_mqtt_connect/messages/thing/product/events_message.rb
|
@@ -150,6 +151,7 @@ files:
|
|
150
151
|
- lib/dji_mqtt_connect/messages/thing/product/requests/airport_organization_bind.rb
|
151
152
|
- lib/dji_mqtt_connect/messages/thing/product/requests/airport_organization_get.rb
|
152
153
|
- lib/dji_mqtt_connect/messages/thing/product/requests/config.rb
|
154
|
+
- lib/dji_mqtt_connect/messages/thing/product/requests/flight_areas_get.rb
|
153
155
|
- lib/dji_mqtt_connect/messages/thing/product/requests/flighttask_resource_get.rb
|
154
156
|
- lib/dji_mqtt_connect/messages/thing/product/requests/storage_config_get.rb
|
155
157
|
- lib/dji_mqtt_connect/messages/thing/product/requests_message.rb
|
@@ -157,6 +159,7 @@ files:
|
|
157
159
|
- lib/dji_mqtt_connect/messages/thing/product/requests_reply/airport_organization_bind.rb
|
158
160
|
- lib/dji_mqtt_connect/messages/thing/product/requests_reply/airport_organization_get.rb
|
159
161
|
- lib/dji_mqtt_connect/messages/thing/product/requests_reply/config.rb
|
162
|
+
- lib/dji_mqtt_connect/messages/thing/product/requests_reply/flight_areas_get.rb
|
160
163
|
- lib/dji_mqtt_connect/messages/thing/product/requests_reply/flighttask_resource_get.rb
|
161
164
|
- lib/dji_mqtt_connect/messages/thing/product/requests_reply/storage_config_get.rb
|
162
165
|
- lib/dji_mqtt_connect/messages/thing/product/services/alarm_state_switch.rb
|