Module: DjiMqttConnect::Factories

Includes:
EventsMessages, OsdMessages, 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, OsdMessages, 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_camera_aim_services_message, #build_thing_product_camera_aim_services_message_data, #build_thing_product_camera_aim_services_reply_message, #build_thing_product_camera_exposure_mode_set_services_message, #build_thing_product_camera_exposure_mode_set_services_message_data, #build_thing_product_camera_exposure_mode_set_services_reply_message, #build_thing_product_camera_exposure_set_services_message, #build_thing_product_camera_exposure_set_services_message_data, #build_thing_product_camera_exposure_set_services_reply_message, #build_thing_product_camera_focal_length_set_services_message, #build_thing_product_camera_focal_length_set_services_message_data, #build_thing_product_camera_focal_length_set_services_reply_message, #build_thing_product_camera_focus_mode_set_services_message, #build_thing_product_camera_focus_mode_set_services_message_data, #build_thing_product_camera_focus_mode_set_services_reply_message, #build_thing_product_camera_focus_value_set_services_message, #build_thing_product_camera_focus_value_set_services_message_data, #build_thing_product_camera_focus_value_set_services_reply_message, #build_thing_product_camera_frame_zoom_services_message, #build_thing_product_camera_frame_zoom_services_message_data, #build_thing_product_camera_frame_zoom_services_reply_message, #build_thing_product_camera_look_at_services_message, #build_thing_product_camera_look_at_services_message_data, #build_thing_product_camera_look_at_services_reply_message, #build_thing_product_camera_mode_switch_services_message, #build_thing_product_camera_mode_switch_services_message_data, #build_thing_product_camera_mode_switch_services_reply_message, #build_thing_product_camera_photo_stop_services_message, #build_thing_product_camera_photo_stop_services_reply_message, #build_thing_product_camera_photo_take_services_message, #build_thing_product_camera_photo_take_services_reply_message, #build_thing_product_camera_point_focus_action_services_message, #build_thing_product_camera_point_focus_action_services_message_data, #build_thing_product_camera_point_focus_action_services_reply_message, #build_thing_product_camera_recording_start_services_message, #build_thing_product_camera_recording_start_services_reply_message, #build_thing_product_camera_recording_stop_services_message, #build_thing_product_camera_recording_stop_services_reply_message, #build_thing_product_camera_screen_drag_services_message, #build_thing_product_camera_screen_drag_services_message_data, #build_thing_product_camera_screen_drag_services_reply_message, #build_thing_product_camera_screen_split_services_message, #build_thing_product_camera_screen_split_services_message_data, #build_thing_product_camera_screen_split_services_reply_message, #build_thing_product_charge_close_services_message, #build_thing_product_charge_close_services_reply_message, #build_thing_product_charge_open_services_message, #build_thing_product_charge_open_services_reply_message, #build_thing_product_cover_close_services_message, #build_thing_product_cover_force_close_services_message, #build_thing_product_cover_force_close_services_reply_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_drc_mode_enter_services_message, #build_thing_product_drc_mode_enter_services_message_data, #build_thing_product_drc_mode_enter_services_reply_message, #build_thing_product_drc_mode_exit_services_message, #build_thing_product_drc_mode_exit_services_reply_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_gimbal_reset_services_message, #build_thing_product_gimbal_reset_services_message_data, #build_thing_product_gimbal_reset_services_reply_message, #build_thing_product_ir_metering_area_set_services_message, #build_thing_product_ir_metering_area_set_services_message_data, #build_thing_product_ir_metering_area_set_services_reply_message, #build_thing_product_ir_metering_mode_set_services_message, #build_thing_product_ir_metering_mode_set_services_message_data, #build_thing_product_ir_metering_mode_set_services_reply_message, #build_thing_product_ir_metering_point_set_services_message, #build_thing_product_ir_metering_point_set_services_message_data, #build_thing_product_ir_metering_point_set_services_reply_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_ota_create_services_message, #build_thing_product_ota_create_services_message_data, #build_thing_product_ota_create_services_reply_message, #build_thing_product_payload_authority_grab_services_message, #build_thing_product_payload_authority_grab_services_reply_message, #build_thing_product_photo_storage_set_services_message, #build_thing_product_photo_storage_set_services_message_data, #build_thing_product_photo_storage_set_services_reply_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, #build_thing_product_video_storage_set_services_message, #build_thing_product_video_storage_set_services_message_data, #build_thing_product_video_storage_set_services_reply_message

Methods included from OsdMessages

#build_thing_product_dock_osd_message_with_link_status, #build_thing_product_dock_osd_message_with_maintenance_status, #build_thing_product_dock_osd_message_with_sub_device, #build_thing_product_drone_osd_message, #build_thing_product_flight_hub_dock_osd_message, #build_thing_product_flight_hub_drone_osd_message

Methods included from EventsMessages

#build_thing_product_airsense_warning_events_message, #build_thing_product_camera_photo_take_progress_events_message, #build_thing_product_charge_close_events_message, #build_thing_product_charge_open_events_message, #build_thing_product_cover_close_events_message, #build_thing_product_cover_force_close_events_message, #build_thing_product_cover_open_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_obstacle_avoidance_notify_events_message, #build_thing_product_offline_map_sync_progress_events_message, #build_thing_product_ota_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



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# File 'lib/dji_mqtt_connect/factories.rb', line 92

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



114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/dji_mqtt_connect/factories.rb', line 114

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



132
133
134
135
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
# File 'lib/dji_mqtt_connect/factories.rb', line 132

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



167
168
169
170
171
172
173
174
# File 'lib/dji_mqtt_connect/factories.rb', line 167

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



176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# File 'lib/dji_mqtt_connect/factories.rb', line 176

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



192
193
194
195
196
197
198
199
200
201
202
# File 'lib/dji_mqtt_connect/factories.rb', line 192

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



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

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



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/dji_mqtt_connect/factories.rb', line 63

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



80
81
82
83
84
85
86
87
88
89
90
# File 'lib/dji_mqtt_connect/factories.rb', line 80

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_services_reply_messageObject



402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
# File 'lib/dji_mqtt_connect/factories.rb', line 402

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_services_reply_messageObject



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

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



438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
# File 'lib/dji_mqtt_connect/factories.rb', line 438

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



456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
# File 'lib/dji_mqtt_connect/factories.rb', line 456

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

#build_thing_product_flight_areas_drone_location_events_messageObject



204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
# File 'lib/dji_mqtt_connect/factories.rb', line 204

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



245
246
247
248
249
250
251
252
253
254
255
256
257
# File 'lib/dji_mqtt_connect/factories.rb', line 245

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



259
260
261
262
# File 'lib/dji_mqtt_connect/factories.rb', line 259

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



225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
# File 'lib/dji_mqtt_connect/factories.rb', line 225

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



487
488
489
490
491
492
493
494
495
496
497
498
# File 'lib/dji_mqtt_connect/factories.rb', line 487

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



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

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



474
475
476
477
478
479
480
481
482
483
484
485
# File 'lib/dji_mqtt_connect/factories.rb', line 474

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



526
527
528
529
530
531
532
533
534
535
536
537
# File 'lib/dji_mqtt_connect/factories.rb', line 526

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



264
265
266
267
268
269
270
271
272
273
274
275
276
277
# File 'lib/dji_mqtt_connect/factories.rb', line 264

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



279
280
281
282
283
284
285
286
287
288
289
# File 'lib/dji_mqtt_connect/factories.rb', line 279

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



500
501
502
503
504
505
506
507
508
509
510
511
# File 'lib/dji_mqtt_connect/factories.rb', line 500

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



541
542
543
544
545
546
547
548
549
550
551
552
# File 'lib/dji_mqtt_connect/factories.rb', line 541

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



554
555
556
557
558
559
560
561
562
563
564
565
# File 'lib/dji_mqtt_connect/factories.rb', line 554

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



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

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



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

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



293
294
295
296
297
298
299
300
301
302
303
304
305
# File 'lib/dji_mqtt_connect/factories.rb', line 293

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



307
308
309
310
311
312
313
314
# File 'lib/dji_mqtt_connect/factories.rb', line 307

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



318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
# File 'lib/dji_mqtt_connect/factories.rb', line 318

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



334
335
336
337
338
339
340
341
# File 'lib/dji_mqtt_connect/factories.rb', line 334

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



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

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



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

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



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

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



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

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



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

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



49
50
51
52
53
54
55
56
57
58
59
# File 'lib/dji_mqtt_connect/factories.rb', line 49

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