dji_mqtt_connect 0.1.35.2 → 0.1.36
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/config/locales/thing_product_events.en.yml +4 -0
- data/config/locales/thing_product_services.en.yml +35 -0
- data/lib/dji_mqtt_connect/factories/events/drone_format.rb +30 -0
- data/lib/dji_mqtt_connect/factories/events/esim_activate.rb +29 -0
- data/lib/dji_mqtt_connect/factories/events/esim_operator_switch.rb +29 -0
- data/lib/dji_mqtt_connect/factories/events/rtk_calibration.rb +49 -0
- data/lib/dji_mqtt_connect/factories/services/air_conditioner_mode_switch.rb +29 -0
- data/lib/dji_mqtt_connect/factories/services/battery_maintenance_switch.rb +29 -0
- data/lib/dji_mqtt_connect/factories/services/battery_store_mode_switch.rb +29 -0
- data/lib/dji_mqtt_connect/factories/services/device_format.rb +29 -0
- data/lib/dji_mqtt_connect/factories/services/device_reboot.rb +29 -0
- data/lib/dji_mqtt_connect/factories/services/drone_format.rb +29 -0
- data/lib/dji_mqtt_connect/factories/services/esim_activate.rb +34 -0
- data/lib/dji_mqtt_connect/factories/services/esim_operator_switch.rb +32 -0
- data/lib/dji_mqtt_connect/factories/services/rtk_calibration.rb +42 -0
- data/lib/dji_mqtt_connect/factories/services/sdr_workmode_switch.rb +26 -0
- data/lib/dji_mqtt_connect/factories/services/sim_slot_switch.rb +32 -0
- data/lib/dji_mqtt_connect/factories/services/supplement_light_close.rb +29 -0
- data/lib/dji_mqtt_connect/factories/services/supplement_light_open.rb +29 -0
- data/lib/dji_mqtt_connect/messages/thing/product/events/drone_format.rb +38 -0
- data/lib/dji_mqtt_connect/messages/thing/product/events/esim_activate.rb +34 -0
- data/lib/dji_mqtt_connect/messages/thing/product/events/esim_operator_switch.rb +34 -0
- data/lib/dji_mqtt_connect/messages/thing/product/events/rtk_calibration.rb +63 -0
- data/lib/dji_mqtt_connect/messages/thing/product/services/air_conditioner_mode_switch.rb +43 -0
- data/lib/dji_mqtt_connect/messages/thing/product/services/battery_maintenance_switch.rb +41 -0
- data/lib/dji_mqtt_connect/messages/thing/product/services/battery_store_mode_switch.rb +41 -0
- data/lib/dji_mqtt_connect/messages/thing/product/services/device_format.rb +20 -0
- data/lib/dji_mqtt_connect/messages/thing/product/services/device_reboot.rb +20 -0
- data/lib/dji_mqtt_connect/messages/thing/product/services/drone_format.rb +20 -0
- data/lib/dji_mqtt_connect/messages/thing/product/services/esim_activate.rb +29 -0
- data/lib/dji_mqtt_connect/messages/thing/product/services/esim_operator_switch.rb +40 -0
- data/lib/dji_mqtt_connect/messages/thing/product/services/rtk_calibration.rb +47 -0
- data/lib/dji_mqtt_connect/messages/thing/product/services/sdr_workmode_switch.rb +41 -0
- data/lib/dji_mqtt_connect/messages/thing/product/services/sim_slot_switch.rb +35 -0
- data/lib/dji_mqtt_connect/messages/thing/product/services/supplement_light_close.rb +20 -0
- data/lib/dji_mqtt_connect/messages/thing/product/services/supplement_light_open.rb +20 -0
- data/lib/dji_mqtt_connect/messages/thing/product/services_reply/air_conditioner_mode_switch.rb +20 -0
- data/lib/dji_mqtt_connect/messages/thing/product/services_reply/battery_maintenance_switch.rb +20 -0
- data/lib/dji_mqtt_connect/messages/thing/product/services_reply/battery_store_mode_switch.rb +20 -0
- data/lib/dji_mqtt_connect/messages/thing/product/services_reply/device_format.rb +20 -0
- data/lib/dji_mqtt_connect/messages/thing/product/services_reply/device_reboot.rb +20 -0
- data/lib/dji_mqtt_connect/messages/thing/product/services_reply/drone_format.rb +20 -0
- data/lib/dji_mqtt_connect/messages/thing/product/services_reply/esim_activate.rb +20 -0
- data/lib/dji_mqtt_connect/messages/thing/product/services_reply/esim_operator_switch.rb +14 -0
- data/lib/dji_mqtt_connect/messages/thing/product/services_reply/rtk_calibration.rb +20 -0
- data/lib/dji_mqtt_connect/messages/thing/product/services_reply/sdr_workmode_switch.rb +14 -0
- data/lib/dji_mqtt_connect/messages/thing/product/services_reply/sim_slot_switch.rb +14 -0
- data/lib/dji_mqtt_connect/messages/thing/product/services_reply/supplement_light_close.rb +20 -0
- data/lib/dji_mqtt_connect/messages/thing/product/services_reply/supplement_light_open.rb +20 -0
- data/lib/dji_mqtt_connect/types.rb +21 -0
- data/lib/dji_mqtt_connect/version.rb +1 -1
- metadata +48 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1ce3347f62fb8a154aff1c482f338692a7909d449a7b352b31d4f72c010049d2
|
|
4
|
+
data.tar.gz: 352234d2194d48f4fce2b1b77edf52506798ee6d8aa662f64ba70a5588c70e82
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bb6185ca7721d50858a8f471e83adb10f5d94484dbaef74562c921218b1bf0b2f9b0f930cdf0eee63202d4717767658cd422739df00e5958348421003c077442
|
|
7
|
+
data.tar.gz: f6a4a9526f4d66c054367a5306b2f15fcc1c104f5265681265688c315c73498f69c15fa3b68aaf24dbffa382560449bd5d45aae3ecb076341ee666c265691b85
|
|
@@ -12,7 +12,10 @@ en:
|
|
|
12
12
|
device_format: "Dock Data Formatting: %{status} (%{percent}%)"
|
|
13
13
|
device_reboot: "Rebooting device: %{status} (%{current_step}/%{total_steps} %{percent}%)"
|
|
14
14
|
drone_close: "Aircraft shutdown: %{status} (%{percent}%)"
|
|
15
|
+
drone_format: "Aircraft Data Formatting: %{status} (%{percent}%)"
|
|
15
16
|
drone_open: "Aircraft Power-on: %{status}"
|
|
17
|
+
esim_activate: "eSIM Activation: %{status} (%{percent}%)"
|
|
18
|
+
esim_operator_switch: "eSIM Operator Switch: %{status} (%{percent}%)"
|
|
16
19
|
file_upload_callback: "Uploading file: %{file_name}"
|
|
17
20
|
fileupload_progress: "Uploading files: %{progress}"
|
|
18
21
|
flight_areas_sync_progress: "Syncing flight areas: %{status} (%{reason})"
|
|
@@ -21,6 +24,7 @@ en:
|
|
|
21
24
|
fly_to_point_progress: "Fly to Point: %{status} (%{way_point_index}/- | %{remaining_time} sec | %{remaining_distance} left)"
|
|
22
25
|
highest_priority_upload_flighttask_media: "Highest priority flight task media upload"
|
|
23
26
|
offline_map_sync_progress: "Syncing offline maps: %{status} (%{reason})"
|
|
27
|
+
rtk_calibration: "RTK Calibration: %{status} (%{percent}%)"
|
|
24
28
|
takeoff_to_point_progress: "Takeoff to Point: %{status} (%{way_point_index}/- | %{remaining_time} sec | %{remaining_distance} left)"
|
|
25
29
|
|
|
26
30
|
thing_product_device_exit_homing_notify_events_message:
|
|
@@ -2,11 +2,19 @@ en:
|
|
|
2
2
|
dji_mqtt_connect:
|
|
3
3
|
thing_product_services_summary:
|
|
4
4
|
default: "Requested %{method} service"
|
|
5
|
+
air_conditioner_mode_switch: "Requesting air conditioner mode change: %{action}"
|
|
5
6
|
alarm_state_switch: "Requesting alarm state change: %{action}"
|
|
7
|
+
battery_maintenance_switch: "Requesting battery maintenance state change: %{action}"
|
|
8
|
+
battery_store_mode_switch: "Requesting battery operating mode change: %{action}"
|
|
6
9
|
cover_open: "Requesting cover open"
|
|
7
10
|
cover_close: "Requesting cover close"
|
|
8
11
|
debug_mode_open: "Requesting enable debug mode"
|
|
9
12
|
debug_mode_close: "Requesting disable debug mode"
|
|
13
|
+
device_format: "Requesting dock data formatting"
|
|
14
|
+
device_reboot: "Requesting dock reboot"
|
|
15
|
+
drone_format: "Requesting aircraft data formatting"
|
|
16
|
+
esim_activate: "Requesting eSIM activation"
|
|
17
|
+
esim_operator_switch: "Requesting eSIM operator switch"
|
|
10
18
|
flighttask_execute: "Requesting flight task execution"
|
|
11
19
|
flighttask_pause: "Requesting pause for all Flights"
|
|
12
20
|
flighttask_prepare: "Requesting flight task preparation"
|
|
@@ -21,8 +29,35 @@ en:
|
|
|
21
29
|
return_home_cancel: "Requesting return to home cancellation"
|
|
22
30
|
return_home: "Requesting return to home"
|
|
23
31
|
return_specific_home: "Requesting return to dock: Dock %{home_dock_sn}"
|
|
32
|
+
rtk_calibration: "Requesting RTK calibration"
|
|
33
|
+
sdr_workmode_switch: "Requesting enhanced image transmission switch: %{link_workmode}"
|
|
34
|
+
sim_slot_switch: "Requesting eSIM/SIM slot switch"
|
|
35
|
+
supplement_light_close: "Requesting auxiliary light disable"
|
|
36
|
+
supplement_light_open: "Requesting auxiliary light enable"
|
|
24
37
|
|
|
25
38
|
thing_product_alarm_state_switch_services_message:
|
|
26
39
|
humanized_action:
|
|
27
40
|
:0: "Alarm off"
|
|
28
41
|
:1: "Alarm on"
|
|
42
|
+
|
|
43
|
+
thing_product_air_conditioner_mode_switch_services_message:
|
|
44
|
+
humanized_action:
|
|
45
|
+
:0: "Idle"
|
|
46
|
+
:1: "Cooling"
|
|
47
|
+
:2: "Heating"
|
|
48
|
+
:3: "Dehumidification"
|
|
49
|
+
|
|
50
|
+
thing_product_battery_maintenance_switch_services_message:
|
|
51
|
+
humanized_action:
|
|
52
|
+
:0: "Disable"
|
|
53
|
+
:1: "Enable"
|
|
54
|
+
|
|
55
|
+
thing_product_battery_store_mode_switch_services_message:
|
|
56
|
+
humanized_action:
|
|
57
|
+
:1: "Schedule mode"
|
|
58
|
+
:2: "Standby mode"
|
|
59
|
+
|
|
60
|
+
thing_product_sdr_workmode_switch_services_message:
|
|
61
|
+
humanized_link_workmode:
|
|
62
|
+
:0: "SDR Only"
|
|
63
|
+
:1: "4G Enhanced Mode"
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DjiMqttConnect
|
|
4
|
+
module Factories::EventsMessages
|
|
5
|
+
### Drone Format ###
|
|
6
|
+
|
|
7
|
+
def build_thing_product_drone_format_events_message
|
|
8
|
+
message_data = {
|
|
9
|
+
result: 0,
|
|
10
|
+
output: {
|
|
11
|
+
status: "in_progress",
|
|
12
|
+
progress: {
|
|
13
|
+
percent: 80,
|
|
14
|
+
step_key: "xxx"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
Thing::Product::DroneFormatEventsMessage.new(
|
|
20
|
+
bid: Message.generate_bid,
|
|
21
|
+
tid: Message.generate_tid,
|
|
22
|
+
timestamp: Message.current_timestamp,
|
|
23
|
+
_method: "drone_format",
|
|
24
|
+
need_reply: 1,
|
|
25
|
+
data: message_data,
|
|
26
|
+
_data: message_data
|
|
27
|
+
)
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DjiMqttConnect
|
|
4
|
+
module Factories::EventsMessages
|
|
5
|
+
### eSIM Activate ###
|
|
6
|
+
|
|
7
|
+
def build_thing_product_esim_activate_events_message
|
|
8
|
+
message_data = {
|
|
9
|
+
result: 0,
|
|
10
|
+
output: {
|
|
11
|
+
status: "in_progress",
|
|
12
|
+
progress: {
|
|
13
|
+
percent: 0
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
Thing::Product::EsimActivateEventsMessage.new(
|
|
19
|
+
bid: Message.generate_bid,
|
|
20
|
+
tid: Message.generate_tid,
|
|
21
|
+
timestamp: Message.current_timestamp,
|
|
22
|
+
_method: "esim_activate",
|
|
23
|
+
need_reply: 1,
|
|
24
|
+
data: message_data,
|
|
25
|
+
_data: message_data
|
|
26
|
+
)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DjiMqttConnect
|
|
4
|
+
module Factories::EventsMessages
|
|
5
|
+
### eSIM Operator Switch ###
|
|
6
|
+
|
|
7
|
+
def build_thing_product_esim_operator_switch_events_message
|
|
8
|
+
message_data = {
|
|
9
|
+
result: 0,
|
|
10
|
+
output: {
|
|
11
|
+
status: "in_progress",
|
|
12
|
+
progress: {
|
|
13
|
+
percent: 0
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
Thing::Product::EsimOperatorSwitchEventsMessage.new(
|
|
19
|
+
bid: Message.generate_bid,
|
|
20
|
+
tid: Message.generate_tid,
|
|
21
|
+
timestamp: Message.current_timestamp,
|
|
22
|
+
_method: "esim_operator_switch",
|
|
23
|
+
need_reply: 1,
|
|
24
|
+
data: message_data,
|
|
25
|
+
_data: message_data
|
|
26
|
+
)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DjiMqttConnect
|
|
4
|
+
module Factories::EventsMessages
|
|
5
|
+
### RTK Calibration ###
|
|
6
|
+
|
|
7
|
+
def build_thing_product_rtk_calibration_events_message
|
|
8
|
+
message_data = {
|
|
9
|
+
output: {
|
|
10
|
+
ext: {
|
|
11
|
+
devices: [
|
|
12
|
+
{
|
|
13
|
+
sn: "DOCKSN",
|
|
14
|
+
type: 1,
|
|
15
|
+
module: "3",
|
|
16
|
+
result: 0,
|
|
17
|
+
status: "ok"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
sn: "RELAYSN",
|
|
21
|
+
type: 1,
|
|
22
|
+
module: "6",
|
|
23
|
+
result: 341_010,
|
|
24
|
+
status: "failed"
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
version: 1
|
|
28
|
+
},
|
|
29
|
+
progress: {
|
|
30
|
+
percent: 0,
|
|
31
|
+
current_step: 1
|
|
32
|
+
},
|
|
33
|
+
status: "failed"
|
|
34
|
+
},
|
|
35
|
+
result: 0
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
Thing::Product::RtkCalibrationEventsMessage.new(
|
|
39
|
+
bid: Message.generate_bid,
|
|
40
|
+
tid: Message.generate_tid,
|
|
41
|
+
timestamp: Message.current_timestamp,
|
|
42
|
+
_method: "rtk_calibration",
|
|
43
|
+
need_reply: 1,
|
|
44
|
+
data: message_data,
|
|
45
|
+
_data: message_data
|
|
46
|
+
)
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DjiMqttConnect
|
|
4
|
+
module Factories::ServicesMessages
|
|
5
|
+
### Dock Air Conditioner Working Mode Switch ###
|
|
6
|
+
|
|
7
|
+
def build_thing_product_air_conditioner_mode_switch_services_message
|
|
8
|
+
Thing::Product::AirConditionerModeSwitchServicesMessage.build(action: Thing::Product::AirConditionerModeSwitchServicesMessage::ACTION_COOLING)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def build_thing_product_air_conditioner_mode_switch_services_reply_message(result: 0)
|
|
12
|
+
message_data = {
|
|
13
|
+
result: result,
|
|
14
|
+
output: {
|
|
15
|
+
status: "ok"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
Thing::Product::AirConditionerModeSwitchServicesReplyMessage.new(
|
|
20
|
+
bid: SecureRandom.uuid,
|
|
21
|
+
tid: SecureRandom.uuid,
|
|
22
|
+
timestamp: Message.current_timestamp,
|
|
23
|
+
_method: "air_conditioner_mode_switch",
|
|
24
|
+
_data: message_data,
|
|
25
|
+
data: message_data
|
|
26
|
+
)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DjiMqttConnect
|
|
4
|
+
module Factories::ServicesMessages
|
|
5
|
+
### Battery Maintenance State Switch ###
|
|
6
|
+
|
|
7
|
+
def build_thing_product_battery_maintenance_switch_services_message
|
|
8
|
+
Thing::Product::BatteryMaintenanceSwitchServicesMessage.build(action: Thing::Product::BatteryMaintenanceSwitchServicesMessage::ACTION_ENABLE)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def build_thing_product_battery_maintenance_switch_services_reply_message(result: 0)
|
|
12
|
+
message_data = {
|
|
13
|
+
result: result,
|
|
14
|
+
output: {
|
|
15
|
+
status: "ok"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
Thing::Product::BatteryMaintenanceSwitchServicesReplyMessage.new(
|
|
20
|
+
bid: SecureRandom.uuid,
|
|
21
|
+
tid: SecureRandom.uuid,
|
|
22
|
+
timestamp: Message.current_timestamp,
|
|
23
|
+
_method: "battery_maintenance_switch",
|
|
24
|
+
_data: message_data,
|
|
25
|
+
data: message_data
|
|
26
|
+
)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DjiMqttConnect
|
|
4
|
+
module Factories::ServicesMessages
|
|
5
|
+
### Battery Operating Mode Switch ###
|
|
6
|
+
|
|
7
|
+
def build_thing_product_battery_store_mode_switch_services_message
|
|
8
|
+
Thing::Product::BatteryStoreModeSwitchServicesMessage.build(action: Thing::Product::BatteryStoreModeSwitchServicesMessage::ACTION_SCHEDULE_MODE)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def build_thing_product_battery_store_mode_switch_services_reply_message(result: 0)
|
|
12
|
+
message_data = {
|
|
13
|
+
result: result,
|
|
14
|
+
output: {
|
|
15
|
+
status: "ok"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
Thing::Product::BatteryStoreModeSwitchServicesReplyMessage.new(
|
|
20
|
+
bid: SecureRandom.uuid,
|
|
21
|
+
tid: SecureRandom.uuid,
|
|
22
|
+
timestamp: Message.current_timestamp,
|
|
23
|
+
_method: "battery_store_mode_switch",
|
|
24
|
+
_data: message_data,
|
|
25
|
+
data: message_data
|
|
26
|
+
)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DjiMqttConnect
|
|
4
|
+
module Factories::ServicesMessages
|
|
5
|
+
### Dock Data Formatting ###
|
|
6
|
+
|
|
7
|
+
def build_thing_product_device_format_services_message
|
|
8
|
+
Thing::Product::DeviceFormatServicesMessage.build
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def build_thing_product_device_format_services_reply_message(result: 0)
|
|
12
|
+
message_data = {
|
|
13
|
+
result: result,
|
|
14
|
+
output: {
|
|
15
|
+
status: "ok"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
Thing::Product::DeviceFormatServicesReplyMessage.new(
|
|
20
|
+
bid: SecureRandom.uuid,
|
|
21
|
+
tid: SecureRandom.uuid,
|
|
22
|
+
timestamp: Message.current_timestamp,
|
|
23
|
+
_method: "device_format",
|
|
24
|
+
_data: message_data,
|
|
25
|
+
data: message_data
|
|
26
|
+
)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DjiMqttConnect
|
|
4
|
+
module Factories::ServicesMessages
|
|
5
|
+
### Dock Reboot ###
|
|
6
|
+
|
|
7
|
+
def build_thing_product_device_reboot_services_message
|
|
8
|
+
Thing::Product::DeviceRebootServicesMessage.build
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def build_thing_product_device_reboot_services_reply_message(result: 0)
|
|
12
|
+
message_data = {
|
|
13
|
+
result: result,
|
|
14
|
+
output: {
|
|
15
|
+
status: "ok"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
Thing::Product::DeviceRebootServicesReplyMessage.new(
|
|
20
|
+
bid: SecureRandom.uuid,
|
|
21
|
+
tid: SecureRandom.uuid,
|
|
22
|
+
timestamp: Message.current_timestamp,
|
|
23
|
+
_method: "device_reboot",
|
|
24
|
+
_data: message_data,
|
|
25
|
+
data: message_data
|
|
26
|
+
)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DjiMqttConnect
|
|
4
|
+
module Factories::ServicesMessages
|
|
5
|
+
### Aircraft Data Formatting ###
|
|
6
|
+
|
|
7
|
+
def build_thing_product_drone_format_services_message
|
|
8
|
+
Thing::Product::DroneFormatServicesMessage.build
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def build_thing_product_drone_format_services_reply_message(result: 0)
|
|
12
|
+
message_data = {
|
|
13
|
+
result: result,
|
|
14
|
+
output: {
|
|
15
|
+
status: "ok"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
Thing::Product::DroneFormatServicesReplyMessage.new(
|
|
20
|
+
bid: SecureRandom.uuid,
|
|
21
|
+
tid: SecureRandom.uuid,
|
|
22
|
+
timestamp: Message.current_timestamp,
|
|
23
|
+
_method: "drone_format",
|
|
24
|
+
_data: message_data,
|
|
25
|
+
data: message_data
|
|
26
|
+
)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DjiMqttConnect
|
|
4
|
+
module Factories::ServicesMessages
|
|
5
|
+
### Activate eSIM ###
|
|
6
|
+
|
|
7
|
+
def build_thing_product_esim_activate_services_message
|
|
8
|
+
Thing::Product::EsimActivateServicesMessage.build(
|
|
9
|
+
data: {
|
|
10
|
+
imei: "123456789012345",
|
|
11
|
+
device_type: "dock"
|
|
12
|
+
}
|
|
13
|
+
)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def build_thing_product_esim_activate_services_reply_message(result: 0)
|
|
17
|
+
message_data = {
|
|
18
|
+
result: result,
|
|
19
|
+
output: {
|
|
20
|
+
status: "ok"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
Thing::Product::EsimActivateServicesReplyMessage.new(
|
|
25
|
+
bid: SecureRandom.uuid,
|
|
26
|
+
tid: SecureRandom.uuid,
|
|
27
|
+
timestamp: Message.current_timestamp,
|
|
28
|
+
_method: "esim_activate",
|
|
29
|
+
_data: message_data,
|
|
30
|
+
data: message_data
|
|
31
|
+
)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DjiMqttConnect
|
|
4
|
+
module Factories::ServicesMessages
|
|
5
|
+
### Switch eSIM Operator ###
|
|
6
|
+
|
|
7
|
+
def build_thing_product_esim_operator_switch_services_message
|
|
8
|
+
Thing::Product::EsimOperatorSwitchServicesMessage.build(
|
|
9
|
+
data: {
|
|
10
|
+
imei: "123456789012345",
|
|
11
|
+
device_type: "dock",
|
|
12
|
+
esim_operator: Thing::Product::EsimOperatorSwitchServicesMessage::ESIM_OPERATOR_CHINA_MOBILE
|
|
13
|
+
}
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def build_thing_product_esim_operator_switch_services_reply_message(result: 0)
|
|
18
|
+
message_data = {
|
|
19
|
+
result: result
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
Thing::Product::EsimOperatorSwitchServicesReplyMessage.new(
|
|
23
|
+
bid: SecureRandom.uuid,
|
|
24
|
+
tid: SecureRandom.uuid,
|
|
25
|
+
timestamp: Message.current_timestamp,
|
|
26
|
+
_method: "esim_operator_switch",
|
|
27
|
+
_data: message_data,
|
|
28
|
+
data: message_data
|
|
29
|
+
)
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DjiMqttConnect
|
|
4
|
+
module Factories::ServicesMessages
|
|
5
|
+
### RTK Calibration ###
|
|
6
|
+
|
|
7
|
+
def build_thing_product_rtk_calibration_services_message
|
|
8
|
+
Thing::Product::RtkCalibrationServicesMessage.build(
|
|
9
|
+
devices: [
|
|
10
|
+
{
|
|
11
|
+
sn: "DOCKSN",
|
|
12
|
+
type: Thing::Product::RtkCalibrationServicesMessage::DEVICE_TYPE_MANUAL_CALIBRATION,
|
|
13
|
+
module: "3",
|
|
14
|
+
data: {
|
|
15
|
+
longitude: 114.898281,
|
|
16
|
+
latitude: 22.755022,
|
|
17
|
+
height: 60.285194
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def build_thing_product_rtk_calibration_services_reply_message(result: 0)
|
|
25
|
+
message_data = {
|
|
26
|
+
result: result,
|
|
27
|
+
output: {
|
|
28
|
+
status: "ok"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
Thing::Product::RtkCalibrationServicesReplyMessage.new(
|
|
33
|
+
bid: SecureRandom.uuid,
|
|
34
|
+
tid: SecureRandom.uuid,
|
|
35
|
+
timestamp: Message.current_timestamp,
|
|
36
|
+
_method: "rtk_calibration",
|
|
37
|
+
_data: message_data,
|
|
38
|
+
data: message_data
|
|
39
|
+
)
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DjiMqttConnect
|
|
4
|
+
module Factories::ServicesMessages
|
|
5
|
+
### Enhanced Image Transmission Switch ###
|
|
6
|
+
|
|
7
|
+
def build_thing_product_sdr_workmode_switch_services_message
|
|
8
|
+
Thing::Product::SdrWorkmodeSwitchServicesMessage.build(link_workmode: Thing::Product::SdrWorkmodeSwitchServicesMessage::LINK_WORKMODE_4G_ENHANCED)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def build_thing_product_sdr_workmode_switch_services_reply_message(result: 0)
|
|
12
|
+
message_data = {
|
|
13
|
+
result: result
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
Thing::Product::SdrWorkmodeSwitchServicesReplyMessage.new(
|
|
17
|
+
bid: SecureRandom.uuid,
|
|
18
|
+
tid: SecureRandom.uuid,
|
|
19
|
+
timestamp: Message.current_timestamp,
|
|
20
|
+
_method: "sdr_workmode_switch",
|
|
21
|
+
_data: message_data,
|
|
22
|
+
data: message_data
|
|
23
|
+
)
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DjiMqttConnect
|
|
4
|
+
module Factories::ServicesMessages
|
|
5
|
+
### Switch Between eSIM and SIM ###
|
|
6
|
+
|
|
7
|
+
def build_thing_product_sim_slot_switch_services_message
|
|
8
|
+
Thing::Product::SimSlotSwitchServicesMessage.build(
|
|
9
|
+
data: {
|
|
10
|
+
imei: "123456789012345",
|
|
11
|
+
device_type: "dock",
|
|
12
|
+
sim_slot: Thing::Product::SimSlotSwitchServicesMessage::SIM_SLOT_ESIM
|
|
13
|
+
}
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def build_thing_product_sim_slot_switch_services_reply_message(result: 0)
|
|
18
|
+
message_data = {
|
|
19
|
+
result: result
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
Thing::Product::SimSlotSwitchServicesReplyMessage.new(
|
|
23
|
+
bid: SecureRandom.uuid,
|
|
24
|
+
tid: SecureRandom.uuid,
|
|
25
|
+
timestamp: Message.current_timestamp,
|
|
26
|
+
_method: "sim_slot_switch",
|
|
27
|
+
_data: message_data,
|
|
28
|
+
data: message_data
|
|
29
|
+
)
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DjiMqttConnect
|
|
4
|
+
module Factories::ServicesMessages
|
|
5
|
+
### Disable Auxiliary Light ###
|
|
6
|
+
|
|
7
|
+
def build_thing_product_supplement_light_close_services_message
|
|
8
|
+
Thing::Product::SupplementLightCloseServicesMessage.build
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def build_thing_product_supplement_light_close_services_reply_message(result: 0)
|
|
12
|
+
message_data = {
|
|
13
|
+
result: result,
|
|
14
|
+
output: {
|
|
15
|
+
status: "ok"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
Thing::Product::SupplementLightCloseServicesReplyMessage.new(
|
|
20
|
+
bid: SecureRandom.uuid,
|
|
21
|
+
tid: SecureRandom.uuid,
|
|
22
|
+
timestamp: Message.current_timestamp,
|
|
23
|
+
_method: "supplement_light_close",
|
|
24
|
+
_data: message_data,
|
|
25
|
+
data: message_data
|
|
26
|
+
)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DjiMqttConnect
|
|
4
|
+
module Factories::ServicesMessages
|
|
5
|
+
### Enable Auxiliary Light ###
|
|
6
|
+
|
|
7
|
+
def build_thing_product_supplement_light_open_services_message
|
|
8
|
+
Thing::Product::SupplementLightOpenServicesMessage.build
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def build_thing_product_supplement_light_open_services_reply_message(result: 0)
|
|
12
|
+
message_data = {
|
|
13
|
+
result: result,
|
|
14
|
+
output: {
|
|
15
|
+
status: "ok"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
Thing::Product::SupplementLightOpenServicesReplyMessage.new(
|
|
20
|
+
bid: SecureRandom.uuid,
|
|
21
|
+
tid: SecureRandom.uuid,
|
|
22
|
+
timestamp: Message.current_timestamp,
|
|
23
|
+
_method: "supplement_light_open",
|
|
24
|
+
_data: message_data,
|
|
25
|
+
data: message_data
|
|
26
|
+
)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DjiMqttConnect
|
|
4
|
+
module Thing::Product
|
|
5
|
+
# Aircraft Data Formatting Progress
|
|
6
|
+
# https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/dock-to-cloud/mqtt/dock/dock3/cmd.html#aircraft-data-formatting-progress
|
|
7
|
+
class DroneFormatEventsMessage < EventsMessage
|
|
8
|
+
attribute :_method, Types::String.enum("drone_format")
|
|
9
|
+
|
|
10
|
+
attribute :data do
|
|
11
|
+
attribute :result, Types::ResultCode
|
|
12
|
+
include Mixins::ResultCode
|
|
13
|
+
|
|
14
|
+
attribute :output do
|
|
15
|
+
# {"sent":"sent","in_progress":"in progress","ok":"success","paused":"paused","rejected":"rejected","failed":"failed","canceled":"canceled or stopped","timeout":"timeout"}
|
|
16
|
+
attribute :status, Types::ServicesOutputStatus
|
|
17
|
+
include Mixins::ServicesOutputStatus
|
|
18
|
+
|
|
19
|
+
attribute :progress do
|
|
20
|
+
# {"min":"0","max":"100","step":"1"}
|
|
21
|
+
attribute :percent, Types::Integer.constrained(gteq: 0, lteq: 100)
|
|
22
|
+
|
|
23
|
+
# NOTE: step_key isn't in the documented field table for this message, only shown in the
|
|
24
|
+
# example payload with a placeholder value ("xxx"), so it's not constrained to Types::EventsProgressStepKey
|
|
25
|
+
attribute? :step_key, Types::String
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def humanized_summary_interpolation
|
|
31
|
+
super.merge(
|
|
32
|
+
status: data.output.humanized_status,
|
|
33
|
+
percent: data.output.progress.percent
|
|
34
|
+
)
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|