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_fileupload_list_services_message, #build_thing_product_fileupload_start_services_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_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

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_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_highest_priority_upload_flighttask_media_events_message, #build_thing_product_offline_map_sync_progress_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



248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
# File 'lib/dji_mqtt_connect/factories.rb', line 248

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



270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
# File 'lib/dji_mqtt_connect/factories.rb', line 270

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



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
316
317
318
319
320
321
# File 'lib/dji_mqtt_connect/factories.rb', line 288

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



323
324
325
326
327
328
329
330
# File 'lib/dji_mqtt_connect/factories.rb', line 323

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



332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
# File 'lib/dji_mqtt_connect/factories.rb', line 332

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



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

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



509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
# File 'lib/dji_mqtt_connect/factories.rb', line 509

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



219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
# File 'lib/dji_mqtt_connect/factories.rb', line 219

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



236
237
238
239
240
241
242
243
244
245
246
# File 'lib/dji_mqtt_connect/factories.rb', line 236

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



545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
# File 'lib/dji_mqtt_connect/factories.rb', line 545

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



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 527

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



584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
# File 'lib/dji_mqtt_connect/factories.rb', line 584

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



566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
# File 'lib/dji_mqtt_connect/factories.rb', line 566

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



605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
# File 'lib/dji_mqtt_connect/factories.rb', line 605

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



623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
# File 'lib/dji_mqtt_connect/factories.rb', line 623

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



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

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



401
402
403
404
405
406
407
408
409
410
411
412
413
# File 'lib/dji_mqtt_connect/factories.rb', line 401

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



415
416
417
418
# File 'lib/dji_mqtt_connect/factories.rb', line 415

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



381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
# File 'lib/dji_mqtt_connect/factories.rb', line 381

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_flighttask_execute_services_reply_messageObject



654
655
656
657
658
659
660
661
662
663
664
665
# File 'lib/dji_mqtt_connect/factories.rb', line 654

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



680
681
682
683
684
685
686
687
688
689
690
691
# File 'lib/dji_mqtt_connect/factories.rb', line 680

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



641
642
643
644
645
646
647
648
649
650
651
652
# File 'lib/dji_mqtt_connect/factories.rb', line 641

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



693
694
695
696
697
698
699
700
701
702
703
704
# File 'lib/dji_mqtt_connect/factories.rb', line 693

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



420
421
422
423
424
425
426
427
428
429
430
431
432
433
# File 'lib/dji_mqtt_connect/factories.rb', line 420

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



435
436
437
438
439
440
441
442
443
444
445
# File 'lib/dji_mqtt_connect/factories.rb', line 435

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



667
668
669
670
671
672
673
674
675
676
677
678
# File 'lib/dji_mqtt_connect/factories.rb', line 667

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) ###



708
709
710
711
712
713
714
715
716
717
718
719
# File 'lib/dji_mqtt_connect/factories.rb', line 708

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



721
722
723
724
725
726
727
728
729
730
731
732
# File 'lib/dji_mqtt_connect/factories.rb', line 721

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



734
735
736
737
738
739
740
741
742
743
744
745
# File 'lib/dji_mqtt_connect/factories.rb', line 734

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



747
748
749
750
751
752
753
754
755
756
757
758
# File 'lib/dji_mqtt_connect/factories.rb', line 747

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



447
448
449
450
451
452
453
454
455
456
457
458
459
# File 'lib/dji_mqtt_connect/factories.rb', line 447

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



461
462
463
464
465
466
467
468
# File 'lib/dji_mqtt_connect/factories.rb', line 461

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_return_home_cancel_services_reply_messageObject



776
777
778
779
780
781
782
783
784
785
786
787
# File 'lib/dji_mqtt_connect/factories.rb', line 776

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



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

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



470
471
472
473
474
475
476
477
478
479
480
481
482
483
# File 'lib/dji_mqtt_connect/factories.rb', line 470

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



485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
# File 'lib/dji_mqtt_connect/factories.rb', line 485

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



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
# File 'lib/dji_mqtt_connect/factories.rb', line 175

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



205
206
207
208
209
210
211
212
213
214
215
# File 'lib/dji_mqtt_connect/factories.rb', line 205

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