Module: DjiMqttConnect::Factories

Includes:
EventsMessages, ServicesMessages, StateMessages
Defined in:
lib/dji_mqtt_connect/factories.rb

Overview

Factories for building example messages Do not include this in your production code

Defined Under Namespace

Modules: EventsMessages, ServicesMessages, StateMessages

Instance Method Summary collapse

Methods included from StateMessages

#build_thing_product_state_message_with_ar_info_switch, #build_thing_product_state_message_with_commander_flight_height, #build_thing_product_state_message_with_commander_flight_mode, #build_thing_product_state_message_with_commander_mode_lost_action, #build_thing_product_state_message_with_current_commander_flight_mode, #build_thing_product_state_message_with_current_rth_mode, #build_thing_product_state_message_with_firmware_version, #build_thing_product_state_message_with_flysafe_database_version, #build_thing_product_state_message_with_geo_caging_status, #build_thing_product_state_message_with_live_capacity, #build_thing_product_state_message_with_live_status, #build_thing_product_state_message_with_mode_code_reason, #build_thing_product_state_message_with_offline_map_enable, #build_thing_product_state_message_with_payloads, #build_thing_product_state_message_with_rtcm_info, #build_thing_product_state_message_with_uom_real_name_state, #build_thing_product_state_message_with_wireless_link_topo, #build_thing_product_state_message_with_wpmz_version, #build_thing_proudct_state_message_with_rth_mode

Methods included from ServicesMessages

#build_thing_product_alarm_state_switch_services_message, #build_thing_product_cover_close_services_message, #build_thing_product_cover_open_services_message, #build_thing_product_debug_mode_close_services_message, #build_thing_product_debug_mode_open_services_message, #build_thing_product_drone_close_services_message, #build_thing_product_drone_open_services_message, #build_thing_product_fileupload_list_services_message, #build_thing_product_fileupload_start_services_message, #build_thing_product_flight_authority_grab_services_message, #build_thing_product_flight_authority_grab_services_reply_message, #build_thing_product_flighttask_execute_services_message, #build_thing_product_flighttask_pause_services_message, #build_thing_product_flighttask_prepare_services_message, #build_thing_product_flighttask_progress_get_services_message, #build_thing_product_flighttask_recovery_services_message, #build_thing_product_flighttask_stop_services_message, #build_thing_product_flighttask_undo_services_message, #build_thing_product_fly_to_point_services_message, #build_thing_product_fly_to_point_stop_services_message, #build_thing_product_fly_to_point_update_services_message, #build_thing_product_live_lens_change_services_message, #build_thing_product_live_set_quality_services_message, #build_thing_product_live_start_push_services_message, #build_thing_product_live_stop_push_services_message, #build_thing_product_return_home_cancel_services_message, #build_thing_product_return_home_services_message, #build_thing_product_return_specific_home_services_message, #build_thing_product_takeoff_to_point_services_message, #build_thing_product_takeoff_to_point_services_reply_message

Methods included from EventsMessages

#build_thing_product_airsense_warning_events_message, #build_thing_product_device_exit_homing_notify_events_message, #build_thing_product_device_reboot_events_message, #build_thing_product_drone_close_events_message, #build_thing_product_drone_open_events_message, #build_thing_product_file_upload_callback_events_message, #build_thing_product_fileupload_progress_events_message, #build_thing_product_flighttask_progress_events_message, #build_thing_product_flighttask_ready_events_message, #build_thing_product_fly_to_point_progress_events_message, #build_thing_product_highest_priority_upload_flighttask_media_events_message, #build_thing_product_offline_map_sync_progress_events_message, #build_thing_product_release_terminal_control_area_events_message, #build_thing_product_return_home_info_events_message, #build_thing_product_takeoff_to_point_progress_events_message

Instance Method Details

#build_thing_product_airport_bind_status_requests_messageObject



392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
# File 'lib/dji_mqtt_connect/factories.rb', line 392

def build_thing_product_airport_bind_status_requests_message
  message_data = {
    devices: [
      {
        sn: "DRONESN"
      },
      {
        sn: "DOCKSN"
      }
    ]
  }

  Thing::Product::AirportBindStatusRequestsMessage.new(
    _method: "airport_bind_status",
    _data: message_data,
    tid: Message.generate_tid,
    bid: Message.generate_bid,
    timestamp: Message.current_timestamp,
    data: message_data
  )
end

#build_thing_product_airport_bind_status_requests_reply_messageObject



414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
# File 'lib/dji_mqtt_connect/factories.rb', line 414

def build_thing_product_airport_bind_status_requests_reply_message
  airport_bind_status_request = build_thing_product_airport_bind_status_requests_message

  Thing::Product::AirportBindStatusRequestsReplyMessage.build_for(
    airport_bind_status_request,
    result: 0,
    bind_status: airport_bind_status_request.data.devices.map.with_index do |device, index|
      {
        sn: device.sn,
        is_device_bind_organization: (index % 2).zero?,
        organization_id: "12345678",
        organization_name: "12345",
        device_callsign: "Device organization callsign"
      }
    end
  )
end

#build_thing_product_airport_organization_bind_requests_messageObject



432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
# File 'lib/dji_mqtt_connect/factories.rb', line 432

def build_thing_product_airport_organization_bind_requests_message
  message_data = {
    bind_devices: [
      {
        device_binding_code: "",
        organization_id: "curo",
        device_callsign: "",
        sn: "DOCK01",
        device_secret: "DEVICE_SECRET",
        device_nonce: "DEVICE_NONCE",
        device_model_key: "3-1-0"
      },
      {
        device_binding_code: "",
        organization_id: "curo",
        device_callsign: "",
        sn: "M30DRONE01",
        device_secret: "DEVICE_SECRET",
        device_nonce: "DEVICE_NONCE",
        device_model_key: "0-67-0"
      }
    ]
  }

  Thing::Product::AirportOrganizationBindRequestsMessage.new(
    _method: "airport_organization_bind",
    _data: message_data,
    tid: Message.generate_tid,
    bid: Message.generate_bid,
    timestamp: Message.current_timestamp,
    data: message_data,
    gateway: "DOCK01"
  )
end

#build_thing_product_airport_organization_bind_requests_reply_messageObject



467
468
469
470
471
472
473
474
# File 'lib/dji_mqtt_connect/factories.rb', line 467

def build_thing_product_airport_organization_bind_requests_reply_message
  airport_organization_bind_request = build_thing_product_airport_organization_bind_requests_message

  Thing::Product::AirportOrganizationBindRequestsReplyMessage.build_for(
    airport_organization_bind_request,
    result: 0
  )
end

#build_thing_product_airport_organization_get_requests_messageObject



476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
# File 'lib/dji_mqtt_connect/factories.rb', line 476

def build_thing_product_airport_organization_get_requests_message
  message_data = {
    device_binding_code: "device_binding_code",
    organization_id: "organization_id"
  }

  Thing::Product::AirportOrganizationGetRequestsMessage.new(
    _method: "airport_organization_get",
    _data: message_data,
    tid: Message.generate_tid,
    bid: Message.generate_bid,
    timestamp: Message.current_timestamp,
    data: message_data
  )
end

#build_thing_product_airport_organization_get_requests_reply_messageObject



492
493
494
495
496
497
498
499
500
501
502
# File 'lib/dji_mqtt_connect/factories.rb', line 492

def build_thing_product_airport_organization_get_requests_reply_message
  airport_organization_get_request = build_thing_product_airport_organization_get_requests_message

  Thing::Product::AirportOrganizationGetRequestsReplyMessage.build_for(
    airport_organization_get_request,
    result: 0,
    output: {
      organization_name: "12345"
    }
  )
end

#build_thing_product_alarm_state_switch_services_reply_messageObject

Services Replies



684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
# File 'lib/dji_mqtt_connect/factories.rb', line 684

def build_thing_product_alarm_state_switch_services_reply_message
  message_data = {
    result: 0,
    output: {
      status: "in_progress"
    }
  }

  Thing::Product::AlarmStateSwitchServicesReplyMessage.new(
    bid: Message.generate_bid,
    tid: Message.generate_tid,
    timestamp: Message.current_timestamp,
    _method: "alarm_state_switch",
    data: message_data,
    _data: message_data
  )
end

#build_thing_product_config_requests_messageObject

Requests



363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
# File 'lib/dji_mqtt_connect/factories.rb', line 363

def build_thing_product_config_requests_message
  message_data = {
    config_type: "json",
    config_scope: "product"
  }

  Thing::Product::ConfigRequestsMessage.new(
    _method: "config",
    tid: Message.generate_tid,
    bid: Message.generate_bid,
    timestamp: Message.current_timestamp,
    gateway: "GATEWAYSN",
    data: message_data,
    _data: message_data.deep_stringify_keys
  )
end

#build_thing_product_config_requests_reply_messageObject



380
381
382
383
384
385
386
387
388
389
390
# File 'lib/dji_mqtt_connect/factories.rb', line 380

def build_thing_product_config_requests_reply_message
  request_message = build_thing_product_config_requests_message
  reply_data = {
    ntp_server_host: "http://time.google.com/",
    app_id: "123456",
    app_key: "app_key",
    app_license: "app_license"
  }

  Thing::Product::ConfigRequestsReplyMessage.build_for(request_message, data: reply_data)
end

#build_thing_product_cover_close_events_messageObject



720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
# File 'lib/dji_mqtt_connect/factories.rb', line 720

def build_thing_product_cover_close_events_message
  message_data = {
    result: 0,
    output: {
      status: "in_progress",
      progress: {
        percent: 50
      }
    }
  }

  Thing::Product::CoverCloseEventsMessage.new(
    bid: Message.generate_bid,
    tid: Message.generate_tid,
    timestamp: Message.current_timestamp,
    _method: "cover_close",
    data: message_data,
    _data: message_data
  )
end

#build_thing_product_cover_close_services_reply_messageObject



702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
# File 'lib/dji_mqtt_connect/factories.rb', line 702

def build_thing_product_cover_close_services_reply_message
  message_data = {
    result: 0,
    output: {
      status: "in_progress"
    }
  }

  Thing::Product::CoverCloseServicesReplyMessage.new(
    bid: Message.generate_bid,
    tid: Message.generate_tid,
    timestamp: Message.current_timestamp,
    _method: "cover_close",
    data: message_data,
    _data: message_data
  )
end

#build_thing_product_cover_open_events_messageObject



759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
# File 'lib/dji_mqtt_connect/factories.rb', line 759

def build_thing_product_cover_open_events_message
  message_data = {
    result: 0,
    output: {
      status: "in_progress",
      progress: {
        percent: 60
      }
    }
  }

  Thing::Product::CoverOpenEventsMessage.new(
    bid: Message.generate_bid,
    tid: Message.generate_tid,
    timestamp: Message.current_timestamp,
    _method: "cover_open",
    data: message_data,
    _data: message_data
  )
end

#build_thing_product_cover_open_services_reply_messageObject



741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
# File 'lib/dji_mqtt_connect/factories.rb', line 741

def build_thing_product_cover_open_services_reply_message
  message_data = {
    result: 0,
    output: {
      status: "ok"
    }
  }

  Thing::Product::CoverOpenServicesReplyMessage.new(
    bid: Message.generate_bid,
    tid: Message.generate_tid,
    timestamp: Message.current_timestamp,
    _method: "cover_open",
    data: message_data,
    _data: message_data
  )
end

#build_thing_product_debug_mode_close_services_reply_messageObject



780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
# File 'lib/dji_mqtt_connect/factories.rb', line 780

def build_thing_product_debug_mode_close_services_reply_message
  message_data = {
    result: 0,
    output: {
      status: "ok"
    }
  }

  Thing::Product::DebugModeCloseServicesReplyMessage.new(
    bid: Message.generate_bid,
    tid: Message.generate_tid,
    timestamp: Message.current_timestamp,
    _method: "debug_mode_close",
    data: message_data,
    _data: message_data
  )
end

#build_thing_product_debug_mode_open_services_reply_messageObject



798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
# File 'lib/dji_mqtt_connect/factories.rb', line 798

def build_thing_product_debug_mode_open_services_reply_message
  message_data = {
    result: 0,
    output: {
      status: "in_progress"
    }
  }

  Thing::Product::DebugModeOpenServicesReplyMessage.new(
    bid: Message.generate_bid,
    tid: Message.generate_tid,
    timestamp: Message.current_timestamp,
    _method: "debug_mode_open",
    data: message_data,
    _data: message_data
  )
end


136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# File 'lib/dji_mqtt_connect/factories.rb', line 136

def build_thing_product_dock_osd_message_with_link_status
  message_data = {
    drc_state: 0,
    flighttask_prepare_capacity: 1,
    flighttask_step_code: 255,
    media_file_detail: {
      remain_upload: 140
    },
    sdr: {
      down_quality: 0,
      frequency_band: 5.8,
      up_quality: 0
    },
    wireless_link: {
      _4g_freq_band: 2.4,
      _4g_gnd_quality: 0,
      _4g_link_state: 0,
      _4g_quality: 0,
      _4g_uav_quality: 0,
      dongle_number: 0,
      link_workmode: 0,
      sdr_freq_band: 2.4,
      sdr_link_state: 0,
      sdr_quality: 0
    }
  }

  Thing::Product::DockOsdMessage.new(
    tid: Message.generate_tid,
    bid: Message.generate_bid,
    timestamp: Message.current_timestamp,
    gateway: "GATEWAYSN",
    data: message_data,
    _data: message_data
  )
end

#build_thing_product_dock_osd_message_with_maintenance_statusObject



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/dji_mqtt_connect/factories.rb', line 85

def build_thing_product_dock_osd_message_with_maintenance_status
  message_data = {
    job_number: 52,
    acc_time: 146930,
    activation_time: 1682969151,
    maintain_status: {
      maintain_status_array: [
        {
          state: 0,
          last_maintain_type: 17,
          last_maintain_time: 0,
          last_maintain_work_sorties: 0
        }
      ]
    },
    electric_supply_voltage: 0,
    working_voltage: 0,
    working_current: 0,
    backup_battery: {
      voltage: 24365,
      temperature: 32767,
      switch: 1
    },
    drone_battery_maintenance_info: {
      batteries: [
        {
          index: 0,
          capacity_percent: 32767,
          voltage: 32767,
          temperature: 32767
        },
        {
          index: 1,
          capacity_percent: 32767,
          voltage: 32767,
          temperature: 32767
        }
      ]
    }
  }

  Thing::Product::DockOsdMessage.new(
    tid: Message.generate_tid,
    bid: Message.generate_bid,
    timestamp: Message.current_timestamp,
    gateway: "GATEWAYSN",
    data: message_data,
    _data: message_data
  )
end

#build_thing_product_dock_osd_message_with_sub_deviceObject

OSD



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/dji_mqtt_connect/factories.rb', line 17

def build_thing_product_dock_osd_message_with_sub_device
  message_data = {
    network_state: {
      type: 2,
      quality: 0,
      rate: 0.1459999978542328
    },
    drone_charge_state: {
      state: 0,
      capacity_percent: 0
    },
    drone_in_dock: 0,
    rainfall: 1,
    wind_speed: 0,
    environment_temperature: 18.8,
    temperature: 19.6,
    humidity: 58,
    latitude: 0,
    longitude: 0,
    height: 0,
    alternate_land_point: {
      latitude: "-33.865143",
      longitude: "151.209900",
      height: 0,
      safe_land_height: 30,
      is_configured: 0
    },
    first_power_on: 1631945855969,
    position_state: {
      is_calibration: 1,
      is_fixed: 1,
      quality: 1,
      gps_number: 0,
      rtk_number: 0
    },
    storage: {
      total: 82045336,
      used: 56385704
    },
    mode_code: 1,
    cover_state: 1,
    supplement_light_state: 0,
    emergency_stop_state: 0,
    air_conditioner: {
      air_conditioner_state: 32767,
      switch_time: 32767
    },
    battery_store_mode: 2,
    alarm_state: 0,
    putter_state: 1,
    sub_device: {
      device_sn: "M30DRONE01",
      device_model_key: "0-67-0",
      device_online_status: 0,
      device_paired: 0
    }
  }

  Thing::Product::DockOsdMessage.new(
    tid: Message.generate_tid,
    bid: Message.generate_bid,
    timestamp: Message.current_timestamp,
    gateway: "GATEWAYSN",
    data: message_data,
    _data: message_data
  )
end

#build_thing_product_flight_areas_drone_location_events_messageObject



504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
# File 'lib/dji_mqtt_connect/factories.rb', line 504

def build_thing_product_flight_areas_drone_location_events_message
  message_data = {
    drone_locations: [
      {
        area_id: "d275c4e1-d864-4736-8b5d-5f5882ee9bdd",
        area_distance: 100.11,
        is_in_area: true
      }
    ]
  }

  Thing::Product::FlightAreasDroneLocationEventsMessage.new(
    _method: "flight_areas_drone_location",
    tid: Message.generate_tid,
    bid: Message.generate_bid,
    timestamp: Message.current_timestamp,
    data: message_data,
    _data: message_data.deep_stringify_keys
  )
end

#build_thing_product_flight_areas_get_requests_messageObject



545
546
547
548
549
550
551
552
553
554
555
556
557
# File 'lib/dji_mqtt_connect/factories.rb', line 545

def build_thing_product_flight_areas_get_requests_message
  message_data = {}

  Thing::Product::FlightAreasGetRequestsMessage.new(
    _method: "flight_areas_get",
    tid: Message.generate_tid,
    bid: Message.generate_bid,
    timestamp: Message.current_timestamp,
    gateway: "GATEWAYSN",
    data: message_data,
    _data: message_data.deep_stringify_keys
  )
end

#build_thing_product_flight_areas_get_requests_reply_messageObject



559
560
561
562
# File 'lib/dji_mqtt_connect/factories.rb', line 559

def build_thing_product_flight_areas_get_requests_reply_message
  request_message = build_thing_product_flight_areas_get_requests_message
  Thing::Product::FlightAreasGetRequestsReplyMessage.build_for(request_message, files: [])
end

#build_thing_product_flight_areas_sync_progress_events_messageObject



525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
# File 'lib/dji_mqtt_connect/factories.rb', line 525

def build_thing_product_flight_areas_sync_progress_events_message
  message_data = {
    file: {
      name: "geofence_xxx.json",
      checksum: "sha256"
    },
    status: "synchronized",
    reason: 0
  }

  Thing::Product::FlightAreasSyncProgressEventsMessage.new(
    _method: "flight_areas_sync_progress",
    tid: Message.generate_tid,
    bid: Message.generate_bid,
    timestamp: Message.current_timestamp,
    data: message_data,
    _data: message_data.deep_stringify_keys
  )
end

#build_thing_product_flight_hub_dock_osd_messageObject



173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
# File 'lib/dji_mqtt_connect/factories.rb', line 173

def build_thing_product_flight_hub_dock_osd_message
  message_data = {
    host: {
      air_conditioner: {
        air_conditioner_state: 0,
        switch_time: 0
      },
      alarm_state: 0,
      alternate_land_point: {
        height: 0,
        is_configured: 1,
        latitude: -33.76867482124178,
        longitude: 150.94983762222526,
        safe_land_height: 30
      },
      battery_store_mode: 2,
      cover_state: 0,
      drone_charge_state: {
        capacity_percent: 95,
        state: 0
      },
      drone_in_dock: 1,
      emergency_stop_state: 0,
      environment_temperature: 24.8,
      first_power_on: 1631945855969,
      heading: 164.2085418701172,
      height: 62.20537567138672,
      home_position_is_valid: 2,
      humidity: 47,
      latitude: -33.768706649492614,
      longitude: 150.9497880000493,
      mode_code: 0,
      network_state: {
        quality: 0,
        rate: 3,
        type: 2
      },
      position_state: {
        gps_number: 6,
        is_calibration: 1,
        is_fixed: 3,
        quality: 5,
        rtk_number: 30
      },
      putter_state: 0,
      rainfall: 0,
      silent_mode: 0,
      storage: {
        total: 53082240,
        used: 14370264
      },
      sub_device: {
        device_online_status: 0,
        device_paired: 1,
        device_sn: "SN000002"
      },
      supplement_light_state: 0,
      temperature: 33.1,
      wind_speed: 0.8
    },
    sn: "SN00001"
  }

  Thing::Product::FlightHubDockOsdMessage.new(
    OrganizationUUID: "b13d0443-4379-461b-b985-18184ffd324d",
    biz_code: "device_osd",
    version: "1.0",
    timestamp: Message.current_timestamp,
    data: message_data,
    _data: message_data
  )
end

#build_thing_product_flight_hub_drone_osd_messageObject



246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
# File 'lib/dji_mqtt_connect/factories.rb', line 246

def build_thing_product_flight_hub_drone_osd_message
  message_data = {
    host: {
      activation_time: 1682969151,
      attitude_head: 164.2085418701172,
      attitude_pitch: -2.0999999046325684,
      attitude_roll: 0.30000001192092896,
      battery: {
        batteries: [
          {
            capacity_percent: 95,
            firmware_version: "01.00.0600",
            index: 0,
            loop_times: 27,
            sn: "BATTERY01",
            sub_type: 67,
            temperature: 38,
            type: 2,
            voltage: 24200
          }
        ],
        capacity_percent: 95,
        landing_power: 20,
        remain_flight_time: 19,
        return_home_power: 25
      },
      distance_limit_status: {
        distance_limit: 500,
        is_near_distance_limit: 0,
        state: 1
      },
      elevation: 62.20537567138672,
      firmware_version: "01.00.0600",
      gear: 0,
      height: 62.20537567138672,
      height_limit: 500,
      home_distance: 23.390625,
      horizontal_speed: 0.10000000149011612,
      latitude: -33.768706649492614,
      longitude: 150.9497880000493,
      mode_code: 0,
      position_state: {
        gps_number: 6,
        is_fixed: 3,
        quality: 5,
        rtk_number: 30
      },
      storage: {
        total: 53082240,
        used: 14370264
      },
      total_flight_distance: 1234.5,
      total_flight_time: 146930,
      track_id: nil,
      vertical_speed: -0.30000001192092896,
      wind_direction: 180,
      wind_speed: 0.800000011920929
    },
    sn: "DRONE01"
  }

  Thing::Product::FlightHubDroneOsdMessage.new(
    OrganizationUUID: "b13d0443-4379-461b-b985-18184ffd324d",
    biz_code: "device_osd",
    version: "1.0",
    timestamp: Message.current_timestamp,
    data: message_data,
    _data: message_data
  )
end

#build_thing_product_flighttask_execute_services_reply_messageObject



829
830
831
832
833
834
835
836
837
838
839
840
# File 'lib/dji_mqtt_connect/factories.rb', line 829

def build_thing_product_flighttask_execute_services_reply_message
  message_data = {result: 0}

  Thing::Product::FlighttaskExecuteServicesReplyMessage.new(
    bid: Message.generate_bid,
    tid: Message.generate_tid,
    timestamp: Message.current_timestamp,
    _method: "flighttask_execute",
    _data: message_data,
    data: message_data
  )
end

#build_thing_product_flighttask_pause_services_reply_messageObject



855
856
857
858
859
860
861
862
863
864
865
866
# File 'lib/dji_mqtt_connect/factories.rb', line 855

def build_thing_product_flighttask_pause_services_reply_message
  message_data = {result: 0}

  Thing::Product::FlighttaskPauseServicesReplyMessage.new(
    bid: Message.generate_bid,
    tid: Message.generate_tid,
    timestamp: Message.current_timestamp,
    _method: "flighttask_pause",
    _data: message_data,
    data: message_data
  )
end

#build_thing_product_flighttask_prepare_services_reply_messageObject



816
817
818
819
820
821
822
823
824
825
826
827
# File 'lib/dji_mqtt_connect/factories.rb', line 816

def build_thing_product_flighttask_prepare_services_reply_message
  message_data = {result: 0}

  Thing::Product::FlighttaskPrepareServicesReplyMessage.new(
    bid: Message.generate_bid,
    tid: Message.generate_tid,
    timestamp: Message.current_timestamp,
    _method: "flighttask_prepare",
    _data: message_data,
    data: message_data
  )
end

#build_thing_product_flighttask_recovery_services_reply_messageObject



868
869
870
871
872
873
874
875
876
877
878
879
# File 'lib/dji_mqtt_connect/factories.rb', line 868

def build_thing_product_flighttask_recovery_services_reply_message
  message_data = {result: 0}

  Thing::Product::FlighttaskRecoveryServicesReplyMessage.new(
    bid: Message.generate_bid,
    tid: Message.generate_tid,
    timestamp: Message.current_timestamp,
    _method: "flighttask_recovery",
    _data: message_data,
    data: message_data
  )
end

#build_thing_product_flighttask_resource_get_requests_messageObject



564
565
566
567
568
569
570
571
572
573
574
575
576
577
# File 'lib/dji_mqtt_connect/factories.rb', line 564

def build_thing_product_flighttask_resource_get_requests_message
  message_data = {
    flight_id: SecureRandom.uuid
  }

  Thing::Product::FlighttaskResourceGetRequestsMessage.new(
    tid: Message.generate_tid,
    bid: Message.generate_bid,
    timestamp: Message.current_timestamp,
    _method: "flighttask_resource_get",
    data: message_data,
    _data: message_data
  )
end

#build_thing_product_flighttask_resource_get_requests_reply_messageObject



579
580
581
582
583
584
585
586
587
588
589
# File 'lib/dji_mqtt_connect/factories.rb', line 579

def build_thing_product_flighttask_resource_get_requests_reply_message
  flighttask_resource_get_request = build_thing_product_flighttask_resource_get_requests_message
  Thing::Product::FlighttaskResourceGetRequestsReplyMessage.build_for(
    flighttask_resource_get_request,
    result: 0,
    file: {
      fingerprint: "signxxxx",
      url: "https://xx.oss-cn-hangzhou.aliyuncs.com/xx.kmz?Expires=xx&OSSAccessKeyId=xxx&Signature=xxx"
    }
  )
end

#build_thing_product_flighttask_undo_services_reply_messageObject



842
843
844
845
846
847
848
849
850
851
852
853
# File 'lib/dji_mqtt_connect/factories.rb', line 842

def build_thing_product_flighttask_undo_services_reply_message
  message_data = {result: 0}

  Thing::Product::FlighttaskUndoServicesReplyMessage.new(
    bid: Message.generate_bid,
    tid: Message.generate_tid,
    timestamp: Message.current_timestamp,
    _method: "flighttask_undo",
    _data: message_data,
    data: message_data
  )
end

#build_thing_product_live_lens_change_services_reply_messageObject

Live Stream (Services Reply Messages) ###



883
884
885
886
887
888
889
890
891
892
893
894
# File 'lib/dji_mqtt_connect/factories.rb', line 883

def build_thing_product_live_lens_change_services_reply_message
  message_data = {result: 0}

  Thing::Product::LiveLensChangeServicesReplyMessage.new(
    bid: Message.generate_bid,
    tid: Message.generate_tid,
    timestamp: Message.current_timestamp,
    _method: "live_lens_change",
    _data: message_data,
    data: message_data
  )
end

#build_thing_product_live_set_quality_services_reply_messageObject



896
897
898
899
900
901
902
903
904
905
906
907
# File 'lib/dji_mqtt_connect/factories.rb', line 896

def build_thing_product_live_set_quality_services_reply_message
  message_data = {result: 0}

  Thing::Product::LiveSetQualityServicesReplyMessage.new(
    bid: Message.generate_bid,
    tid: Message.generate_tid,
    timestamp: Message.current_timestamp,
    _method: "live_set_quality",
    _data: message_data,
    data: message_data
  )
end

#build_thing_product_live_start_push_services_reply_messageObject



909
910
911
912
913
914
915
916
917
918
919
920
# File 'lib/dji_mqtt_connect/factories.rb', line 909

def build_thing_product_live_start_push_services_reply_message
  message_data = {result: 0}

  Thing::Product::LiveStartPushServicesReplyMessage.new(
    bid: Message.generate_bid,
    tid: Message.generate_tid,
    timestamp: Message.current_timestamp,
    _method: "live_start_push",
    _data: message_data,
    data: message_data
  )
end

#build_thing_product_live_stop_push_services_reply_messageObject



922
923
924
925
926
927
928
929
930
931
932
933
# File 'lib/dji_mqtt_connect/factories.rb', line 922

def build_thing_product_live_stop_push_services_reply_message
  message_data = {result: 0}

  Thing::Product::LiveStopPushServicesReplyMessage.new(
    bid: Message.generate_bid,
    tid: Message.generate_tid,
    timestamp: Message.current_timestamp,
    _method: "live_stop_push",
    _data: message_data,
    data: message_data
  )
end

#build_thing_product_offline_map_get_requests_messageObject

offline_map_get ###



593
594
595
596
597
598
599
600
601
602
603
604
605
# File 'lib/dji_mqtt_connect/factories.rb', line 593

def build_thing_product_offline_map_get_requests_message
  message_data = {}

  Thing::Product::OfflineMapGetRequestsMessage.new(
    _method: "offline_map_get",
    _data: message_data,
    tid: Message.generate_tid,
    bid: Message.generate_bid,
    timestamp: Message.current_timestamp,
    gateway: "GATEWAYSN",
    data: message_data
  )
end

#build_thing_product_offline_map_get_requests_reply_messageObject



607
608
609
610
611
612
613
614
# File 'lib/dji_mqtt_connect/factories.rb', line 607

def build_thing_product_offline_map_get_requests_reply_message
  request_message = build_thing_product_offline_map_get_requests_message

  Thing::Product::OfflineMapGetRequestsReplyMessage.build_for(
    request_message,
    result: 0
  )
end

#build_thing_product_offline_map_get_v2_requests_messageObject

offline_map_get_v2 ###



618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
# File 'lib/dji_mqtt_connect/factories.rb', line 618

def build_thing_product_offline_map_get_v2_requests_message
  message_data = {
    tile_type: ["base_map_dem", "semantic_info"]
  }

  Thing::Product::OfflineMapGetV2RequestsMessage.new(
    _method: "offline_map_get_v2",
    _data: message_data,
    tid: Message.generate_tid,
    bid: Message.generate_bid,
    timestamp: Message.current_timestamp,
    gateway: "GATEWAYSN",
    data: message_data
  )
end

#build_thing_product_offline_map_get_v2_requests_reply_messageObject



634
635
636
637
638
639
640
641
# File 'lib/dji_mqtt_connect/factories.rb', line 634

def build_thing_product_offline_map_get_v2_requests_reply_message
  request_message = build_thing_product_offline_map_get_v2_requests_message

  Thing::Product::OfflineMapGetV2RequestsReplyMessage.build_for(
    request_message,
    result: 0
  )
end

#build_thing_product_return_home_cancel_services_reply_messageObject



951
952
953
954
955
956
957
958
959
960
961
962
# File 'lib/dji_mqtt_connect/factories.rb', line 951

def build_thing_product_return_home_cancel_services_reply_message
  message_data = {result: 0}

  Thing::Product::ReturnHomeCancelServicesReplyMessage.new(
    bid: Message.generate_bid,
    tid: Message.generate_tid,
    timestamp: Message.current_timestamp,
    _method: "return_home_cancel",
    _data: message_data,
    data: message_data
  )
end

#build_thing_product_return_home_services_reply_messageObject



935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
# File 'lib/dji_mqtt_connect/factories.rb', line 935

def build_thing_product_return_home_services_reply_message
  message_data = {
    result: 0,
    output: {status: "ok"}
  }

  Thing::Product::ReturnHomeServicesReplyMessage.new(
    bid: Message.generate_bid,
    tid: Message.generate_tid,
    timestamp: Message.current_timestamp,
    _method: "return_home",
    _data: message_data,
    data: message_data
  )
end

#build_thing_product_storage_config_get_requests_messageObject

storage_config_get ###



645
646
647
648
649
650
651
652
653
654
655
656
657
658
# File 'lib/dji_mqtt_connect/factories.rb', line 645

def build_thing_product_storage_config_get_requests_message
  message_data = {
    module: 0
  }

  Thing::Product::StorageConfigGetRequestsMessage.new(
    _method: "storage_config_get",
    _data: message_data,
    tid: Message.generate_tid,
    bid: Message.generate_bid,
    timestamp: Message.current_timestamp,
    data: message_data
  )
end

#build_thing_product_storage_config_get_requests_reply_messageObject



660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
# File 'lib/dji_mqtt_connect/factories.rb', line 660

def build_thing_product_storage_config_get_requests_reply_message
  storage_config_get_request = build_thing_product_storage_config_get_requests_message

  Thing::Product::StorageConfigGetRequestsReplyMessage.build_for(
    storage_config_get_request,
    result: 0,
    output: {
      bucket: "bucket_name",
      credentials: {
        access_key_id: "access_key_id",
        access_key_secret: "access_key_secret",
        expire: 3600,
        security_token: "security_token"
      },
      endpoint: "https://oss-cn-hangzhou.aliyuncs.com",
      object_key_prefix: "b4cfaae6-bd9d-4cd0-8472-63b608c3c581",
      provider: "ali",
      region: "hz"
    }
  )
end

#build_thing_product_update_topo_message_with_online_deviceObject

Status



319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
# File 'lib/dji_mqtt_connect/factories.rb', line 319

def build_thing_product_update_topo_message_with_online_device
  message_data = {
    type: 98,
    sub_type: 0,
    device_secret: "secret",
    nonce: "nonce",
    version: 1,
    sub_devices: [
      {
        sn: "SUBDEVICESN",
        type: 116,
        sub_type: 0,
        index: "A",
        device_secret: "secret",
        nonce: "nonce",
        version: 1
      }
    ]
  }

  Sys::Product::UpdateTopoStatusMessage.new(
    _method: "update_topo",
    tid: Message.generate_tid,
    bid: Message.generate_bid,
    timestamp: Message.current_timestamp,
    data: message_data,
    _data: message_data.deep_stringify_keys
  )
end

#build_thing_product_update_topo_status_reply_messageObject



349
350
351
352
353
354
355
356
357
358
359
# File 'lib/dji_mqtt_connect/factories.rb', line 349

def build_thing_product_update_topo_status_reply_message
  Sys::Product::UpdateTopoStatusReplyMessage.new(
    _method: "update_topo",
    tid: Message.generate_tid,
    bid: Message.generate_bid,
    timestamp: Message.current_timestamp,
    data: {
      result: 0
    }
  )
end