dji_mqtt_connect 0.1.39 → 0.1.40
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 +4 -4
- data/lib/dji_mqtt_connect/messages/thing/product/osd/dock.rb +47 -8
- data/lib/dji_mqtt_connect/mixins/network_state_quality.rb +11 -3
- data/lib/dji_mqtt_connect/mixins/network_state_type.rb +6 -0
- data/lib/dji_mqtt_connect/types.rb +25 -3
- data/lib/dji_mqtt_connect/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 209eb2ba74757a25e02dbbf23c1b69f934afb836d30edf8afdc9a4b19f5943d7
|
|
4
|
+
data.tar.gz: dff2d0f26cdfff2d30834193330519181e38e207ac5a866068fc320b966466c9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3c3d50fa6ef757e7c4d4e48ef49f46cf0e2e23ee2b6e633694a7e0fc72db7694e4097204c76aacf3f9082c359991eb41d30abbb9bf6561e28763f20ecdd73117
|
|
7
|
+
data.tar.gz: f4e7dedef4d6eb1669e1b21af8d221ae51abefaf0a7e5eb7a3d41dff924ec482265ba9df7b7e38127cba354cbcc88b26507aced63e13fa07430de97735965b98
|
|
@@ -110,9 +110,11 @@ module DjiMqttConnect
|
|
|
110
110
|
include Mixins::DockModeCode
|
|
111
111
|
|
|
112
112
|
attribute? :network_state do
|
|
113
|
-
|
|
113
|
+
# {"1":"4G","2":"Ethernet"}
|
|
114
|
+
attribute :type, Types::NetworkStateType | Types::Integer
|
|
114
115
|
include Mixins::NetworkStateType
|
|
115
116
|
|
|
117
|
+
# {"0":"No signal","1":"Bad","2":"Poor","3":"Fair","4":"Good","5":"Excellent"}
|
|
116
118
|
attribute :quality, Types::NetworkStateQuality | Types::Integer
|
|
117
119
|
include Mixins::NetworkStateQuality
|
|
118
120
|
|
|
@@ -127,15 +129,52 @@ module DjiMqttConnect
|
|
|
127
129
|
|
|
128
130
|
attribute? :wireless_link do
|
|
129
131
|
attribute? :_4g_freq_band, Types::JSON::Decimal
|
|
130
|
-
|
|
131
|
-
attribute? :
|
|
132
|
-
|
|
133
|
-
|
|
132
|
+
|
|
133
|
+
attribute? :_4g_gnd_quality, Types::WirelessLinkQuality | Types::Integer
|
|
134
|
+
|
|
135
|
+
def _4g_gnd_quality?
|
|
136
|
+
Types::WirelessLinkQuality.valid?(_4g_gnd_quality)
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# {"0":"Disconnected","1":"Connected"}
|
|
140
|
+
attribute? :_4g_link_state, Types::WirelessLinkState | Types::Integer
|
|
141
|
+
|
|
142
|
+
def _4g_link_connected?
|
|
143
|
+
_4g_link_state == Types::WIRELESS_LINK_CONNECTED
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
attribute? :_4g_quality, Types::WirelessLinkQuality | Types::Integer
|
|
147
|
+
|
|
148
|
+
def _4g_quality?
|
|
149
|
+
Types::WirelessLinkQuality.valid?(_4g_quality)
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
attribute? :_4g_uav_quality, Types::WirelessLinkQuality | Types::Integer
|
|
153
|
+
|
|
154
|
+
def _4g_uav_quality?
|
|
155
|
+
Types::WirelessLinkQuality.valid?(_4g_uav_quality)
|
|
156
|
+
end
|
|
157
|
+
|
|
134
158
|
attribute? :dongle_number, Types::Integer
|
|
135
|
-
|
|
159
|
+
|
|
160
|
+
# {"0":"SDR mode","1":"4G fusion mode"}
|
|
161
|
+
attribute? :link_workmode, Types::WirelessLinkWorkmode | Types::Integer
|
|
162
|
+
|
|
136
163
|
attribute? :sdr_freq_band, Types::JSON::Decimal
|
|
137
|
-
|
|
138
|
-
|
|
164
|
+
|
|
165
|
+
# {"0":"Disconnected","1":"Connected"}
|
|
166
|
+
attribute? :sdr_link_state, Types::WirelessLinkState | Types::Integer
|
|
167
|
+
|
|
168
|
+
def sdr_link_connected?
|
|
169
|
+
sdr_link_state == Types::WIRELESS_LINK_CONNECTED
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
attribute? :sdr_quality, Types::WirelessLinkQuality | Types::Integer
|
|
173
|
+
|
|
174
|
+
def sdr_quality?
|
|
175
|
+
Types::WirelessLinkQuality.valid?(sdr_quality)
|
|
176
|
+
end
|
|
177
|
+
|
|
139
178
|
attribute? :sdr_relay_gnd_link_state, Types::Integer
|
|
140
179
|
attribute? :sdr_relay_gnd_quality, Types::Integer
|
|
141
180
|
attribute? :sdr_relay_uav_link_state, Types::Integer
|
|
@@ -9,14 +9,22 @@ module DjiMqttConnect
|
|
|
9
9
|
|
|
10
10
|
def humanized_quality
|
|
11
11
|
quality_key = case quality
|
|
12
|
+
when Types::NETWORK_STATE_QUALITY_NO_SIGNAL
|
|
13
|
+
"No signal"
|
|
12
14
|
when Types::NETWORK_STATE_QUALITY_BAD
|
|
13
15
|
"Bad"
|
|
14
|
-
when Types::
|
|
15
|
-
"
|
|
16
|
+
when Types::NETWORK_STATE_QUALITY_POOR
|
|
17
|
+
"Poor"
|
|
18
|
+
when Types::NETWORK_STATE_QUALITY_FAIR
|
|
19
|
+
"Fair"
|
|
16
20
|
when Types::NETWORK_STATE_QUALITY_GOOD
|
|
17
21
|
"Good"
|
|
22
|
+
when Types::NETWORK_STATE_QUALITY_EXCELLENT
|
|
23
|
+
"Excellent"
|
|
18
24
|
end
|
|
19
|
-
|
|
25
|
+
return if quality_key.nil?
|
|
26
|
+
|
|
27
|
+
I18n.t(quality_key.parameterize.underscore, scope: "dji_mqtt_connect.dock_network_state.quality", default: quality_key)
|
|
20
28
|
end
|
|
21
29
|
end
|
|
22
30
|
end
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
module DjiMqttConnect
|
|
4
4
|
module Mixins
|
|
5
5
|
module NetworkStateType
|
|
6
|
+
def type?
|
|
7
|
+
Types::NetworkStateType.valid?(type)
|
|
8
|
+
end
|
|
9
|
+
|
|
6
10
|
def humanized_type
|
|
7
11
|
type_key = case type
|
|
8
12
|
when Types::NETWORK_STATE_TYPE_4G
|
|
@@ -10,6 +14,8 @@ module DjiMqttConnect
|
|
|
10
14
|
when Types::NETWORK_STATE_TYPE_ETHERNET
|
|
11
15
|
"Ethernet"
|
|
12
16
|
end
|
|
17
|
+
return if type_key.nil?
|
|
18
|
+
|
|
13
19
|
I18n.t(type_key.downcase, scope: "dji_mqtt_connect.dock_network_state.type", default: type_key)
|
|
14
20
|
end
|
|
15
21
|
end
|
|
@@ -124,6 +124,23 @@ module DjiMqttConnect
|
|
|
124
124
|
AREA_LIMIT_REACHED = 1
|
|
125
125
|
)
|
|
126
126
|
|
|
127
|
+
# {"0":"Disconnected","1":"Connected"}
|
|
128
|
+
WirelessLinkState = Types::Integer.enum(
|
|
129
|
+
WIRELESS_LINK_DISCONNECTED = 0,
|
|
130
|
+
WIRELESS_LINK_CONNECTED = 1
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
# {"min":"0","max":"5"}
|
|
134
|
+
WIRELESS_LINK_QUALITY_MIN = 0
|
|
135
|
+
WIRELESS_LINK_QUALITY_MAX = 5
|
|
136
|
+
WirelessLinkQuality = Types::Integer.constrained(gteq: WIRELESS_LINK_QUALITY_MIN, lteq: WIRELESS_LINK_QUALITY_MAX)
|
|
137
|
+
|
|
138
|
+
# {"0":"SDR mode","1":"4G fusion mode"}
|
|
139
|
+
WirelessLinkWorkmode = Types::Integer.enum(
|
|
140
|
+
WIRELESS_LINK_WORKMODE_SDR = 0,
|
|
141
|
+
WIRELESS_LINK_WORKMODE_4G_FUSION = 1
|
|
142
|
+
)
|
|
143
|
+
|
|
127
144
|
# {"max":"1500","min":"20","unit_name":"Meters / m"}
|
|
128
145
|
HEIGHT_LIMIT_MIN = 20
|
|
129
146
|
HEIGHT_LIMIT_MAX = 1500
|
|
@@ -456,15 +473,20 @@ module DjiMqttConnect
|
|
|
456
473
|
"upgrading_prevent_reboot"
|
|
457
474
|
)
|
|
458
475
|
|
|
476
|
+
# {"1":"4G","2":"Ethernet"}
|
|
459
477
|
NetworkStateType = Integer.enum(
|
|
460
478
|
NETWORK_STATE_TYPE_4G = 1,
|
|
461
479
|
NETWORK_STATE_TYPE_ETHERNET = 2
|
|
462
480
|
)
|
|
463
481
|
|
|
482
|
+
# {"0":"No signal","1":"Bad","2":"Poor","3":"Fair","4":"Good","5":"Excellent"}
|
|
464
483
|
NetworkStateQuality = Integer.enum(
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
484
|
+
NETWORK_STATE_QUALITY_NO_SIGNAL = 0,
|
|
485
|
+
NETWORK_STATE_QUALITY_BAD = 1,
|
|
486
|
+
NETWORK_STATE_QUALITY_POOR = 2,
|
|
487
|
+
NETWORK_STATE_QUALITY_FAIR = 3,
|
|
488
|
+
NETWORK_STATE_QUALITY_GOOD = 4,
|
|
489
|
+
NETWORK_STATE_QUALITY_EXCELLENT = 5
|
|
468
490
|
)
|
|
469
491
|
|
|
470
492
|
# Enumeration of camera payload and mounted location. Non-standard device_mode_key, formatted as {type-subtype-gimbalindex}.
|