Module: DjiMqttConnect::Factories::ServicesMessages

Included in:
DjiMqttConnect::Factories
Defined in:
lib/dji_mqtt_connect/factories/services_messages.rb,
lib/dji_mqtt_connect/factories/services/camera_aim.rb,
lib/dji_mqtt_connect/factories/services/ota_create.rb,
lib/dji_mqtt_connect/factories/services/charge_open.rb,
lib/dji_mqtt_connect/factories/services/charge_close.rb,
lib/dji_mqtt_connect/factories/services/gimbal_reset.rb,
lib/dji_mqtt_connect/factories/services/live_control.rb,
lib/dji_mqtt_connect/factories/services/drc_mode_exit.rb,
lib/dji_mqtt_connect/factories/services/camera_look_at.rb,
lib/dji_mqtt_connect/factories/services/drc_mode_enter.rb,
lib/dji_mqtt_connect/factories/services/camera_photo_stop.rb,
lib/dji_mqtt_connect/factories/services/camera_photo_take.rb,
lib/dji_mqtt_connect/factories/services/cover_force_close.rb,
lib/dji_mqtt_connect/factories/services/photo_storage_set.rb,
lib/dji_mqtt_connect/factories/services/video_storage_set.rb,
lib/dji_mqtt_connect/factories/services/camera_mode_switch.rb,
lib/dji_mqtt_connect/factories/services/camera_screen_drag.rb,
lib/dji_mqtt_connect/factories/services/camera_exposure_set.rb,
lib/dji_mqtt_connect/factories/services/camera_screen_split.rb,
lib/dji_mqtt_connect/factories/services/ir_metering_area_set.rb,
lib/dji_mqtt_connect/factories/services/ir_metering_mode_set.rb,
lib/dji_mqtt_connect/factories/services/camera_focus_mode_set.rb,
lib/dji_mqtt_connect/factories/services/camera_recording_stop.rb,
lib/dji_mqtt_connect/factories/services/ir_metering_point_set.rb,
lib/dji_mqtt_connect/factories/services/camera_focus_value_set.rb,
lib/dji_mqtt_connect/factories/services/camera_recording_start.rb,
lib/dji_mqtt_connect/factories/services/camera_focal_length_set.rb,
lib/dji_mqtt_connect/factories/services/camera_exposure_mode_set.rb,
lib/dji_mqtt_connect/factories/services/camera_point_focus_action.rb

Instance Method Summary collapse

Instance Method Details

#build_thing_product_alarm_state_switch_services_messageObject



5
6
7
# File 'lib/dji_mqtt_connect/factories/services_messages.rb', line 5

def build_thing_product_alarm_state_switch_services_message
  Thing::Product::AlarmStateSwitchServicesMessage.build(action: Thing::Product::AlarmStateSwitchServicesMessage::ACTION_OPEN)
end

#build_thing_product_camera_aim_services_message(data: build_thing_product_camera_aim_services_message_data) ⇒ Object

Payload control - Double tap to AIM ###



7
8
9
10
11
# File 'lib/dji_mqtt_connect/factories/services/camera_aim.rb', line 7

def build_thing_product_camera_aim_services_message(data: build_thing_product_camera_aim_services_message_data)
  Thing::Product::CameraAimServicesMessage.build(
    data: data
  )
end

#build_thing_product_camera_aim_services_message_dataObject



13
14
15
16
17
18
19
20
21
# File 'lib/dji_mqtt_connect/factories/services/camera_aim.rb', line 13

def build_thing_product_camera_aim_services_message_data
  {
    locked: true,
    payload_index: "39-0-7",
    camera_type: Thing::Product::CameraAimServicesMessage::CAMERA_TYPE_WIDE,
    x: 0.5,
    y: 0.5
  }
end

#build_thing_product_camera_aim_services_reply_message(result: 0) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/dji_mqtt_connect/factories/services/camera_aim.rb', line 23

def build_thing_product_camera_aim_services_reply_message(result: 0)
  message_data = {
    result: result
  }

  Thing::Product::CameraAimServicesReplyMessage.new(
    bid: SecureRandom.uuid,
    tid: SecureRandom.uuid,
    timestamp: Message.current_timestamp,
    _method: "camera_aim",
    _data: message_data,
    data: message_data
  )
end

#build_thing_product_camera_exposure_mode_set_services_message(data: build_thing_product_camera_exposure_mode_set_services_message_data) ⇒ Object

Payload control - Camera exposure mode setting ###



7
8
9
10
11
# File 'lib/dji_mqtt_connect/factories/services/camera_exposure_mode_set.rb', line 7

def build_thing_product_camera_exposure_mode_set_services_message(data: build_thing_product_camera_exposure_mode_set_services_message_data)
  Thing::Product::CameraExposureModeSetServicesMessage.build(
    data: data
  )
end

#build_thing_product_camera_exposure_mode_set_services_message_dataObject



13
14
15
16
17
18
19
# File 'lib/dji_mqtt_connect/factories/services/camera_exposure_mode_set.rb', line 13

def build_thing_product_camera_exposure_mode_set_services_message_data
  {
    camera_type: "zoom",
    exposure_mode: 1,
    payload_index: "39-0-7"
  }
end

#build_thing_product_camera_exposure_mode_set_services_reply_message(result: 0) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/dji_mqtt_connect/factories/services/camera_exposure_mode_set.rb', line 21

def build_thing_product_camera_exposure_mode_set_services_reply_message(result: 0)
  message_data = {
    result: result
  }

  Thing::Product::CameraExposureModeSetServicesReplyMessage.new(
    bid: SecureRandom.uuid,
    tid: SecureRandom.uuid,
    timestamp: Message.current_timestamp,
    _method: "camera_exposure_mode_set",
    _data: message_data,
    data: message_data
  )
end

#build_thing_product_camera_exposure_set_services_message(data: build_thing_product_camera_exposure_set_services_message_data) ⇒ Object

Payload control - Camera exposure mode setting ###



7
8
9
10
11
# File 'lib/dji_mqtt_connect/factories/services/camera_exposure_set.rb', line 7

def build_thing_product_camera_exposure_set_services_message(data: build_thing_product_camera_exposure_set_services_message_data)
  Thing::Product::CameraExposureSetServicesMessage.build(
    data: data
  )
end

#build_thing_product_camera_exposure_set_services_message_dataObject



13
14
15
16
17
18
19
# File 'lib/dji_mqtt_connect/factories/services/camera_exposure_set.rb', line 13

def build_thing_product_camera_exposure_set_services_message_data
  {
    camera_type: Thing::Product::CameraExposureSetServicesMessage::CAMERA_TYPE_ZOOM,
    exposure_value: Thing::Product::CameraExposureSetServicesMessage::EXPOSURE_VALUE_FIXED,
    payload_index: "39-0-7"
  }
end

#build_thing_product_camera_exposure_set_services_reply_message(result: 0) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/dji_mqtt_connect/factories/services/camera_exposure_set.rb', line 21

def build_thing_product_camera_exposure_set_services_reply_message(result: 0)
  message_data = {
    result: result
  }

  Thing::Product::CameraExposureSetServicesReplyMessage.new(
    bid: SecureRandom.uuid,
    tid: SecureRandom.uuid,
    timestamp: Message.current_timestamp,
    _method: "camera_exposure_set",
    _data: message_data,
    data: message_data
  )
end

#build_thing_product_camera_focal_length_set_services_message(data: build_thing_product_camera_focal_length_set_services_message_data) ⇒ Object

Payload control - Zoom ###



7
8
9
10
11
# File 'lib/dji_mqtt_connect/factories/services/camera_focal_length_set.rb', line 7

def build_thing_product_camera_focal_length_set_services_message(data: build_thing_product_camera_focal_length_set_services_message_data)
  Thing::Product::CameraFocalLengthSetServicesMessage.build(
    data: data
  )
end

#build_thing_product_camera_focal_length_set_services_message_dataObject



13
14
15
16
17
18
19
# File 'lib/dji_mqtt_connect/factories/services/camera_focal_length_set.rb', line 13

def build_thing_product_camera_focal_length_set_services_message_data
  {
    payload_index: "39-0-7",
    camera_type: Thing::Product::CameraFocalLengthSetServicesMessage::CAMERA_TYPE_WIDE,
    zoom_factor: 10.0
  }
end

#build_thing_product_camera_focal_length_set_services_reply_message(result: 0) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/dji_mqtt_connect/factories/services/camera_focal_length_set.rb', line 21

def build_thing_product_camera_focal_length_set_services_reply_message(result: 0)
  message_data = {
    result: result
  }

  Thing::Product::CameraFocalLengthSetServicesReplyMessage.new(
    bid: SecureRandom.uuid,
    tid: SecureRandom.uuid,
    timestamp: Message.current_timestamp,
    _method: "camera_focal_length_set",
    _data: message_data,
    data: message_data
  )
end

#build_thing_product_camera_focus_mode_set_services_message(data: build_thing_product_camera_focus_mode_set_services_message_data) ⇒ Object

Payload control - Camera exposure mode setting ###



7
8
9
10
11
# File 'lib/dji_mqtt_connect/factories/services/camera_focus_mode_set.rb', line 7

def build_thing_product_camera_focus_mode_set_services_message(data: build_thing_product_camera_focus_mode_set_services_message_data)
  Thing::Product::CameraFocusModeSetServicesMessage.build(
    data: data
  )
end

#build_thing_product_camera_focus_mode_set_services_message_dataObject



13
14
15
16
17
18
19
# File 'lib/dji_mqtt_connect/factories/services/camera_focus_mode_set.rb', line 13

def build_thing_product_camera_focus_mode_set_services_message_data
  {
    camera_type: Thing::Product::CameraFocusModeSetServicesMessage::CAMERA_TYPE_ZOOM,
    focus_mode: Thing::Product::CameraFocusModeSetServicesMessage::FOCUS_MODE_MF,
    payload_index: "39-0-7"
  }
end

#build_thing_product_camera_focus_mode_set_services_reply_message(result: 0) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/dji_mqtt_connect/factories/services/camera_focus_mode_set.rb', line 21

def build_thing_product_camera_focus_mode_set_services_reply_message(result: 0)
  message_data = {
    result: result
  }

  Thing::Product::CameraFocusModeSetServicesReplyMessage.new(
    bid: SecureRandom.uuid,
    tid: SecureRandom.uuid,
    timestamp: Message.current_timestamp,
    _method: "camera_focus_mode_set",
    _data: message_data,
    data: message_data
  )
end

#build_thing_product_camera_focus_value_set_services_message(data: build_thing_product_camera_focus_value_set_services_message_data) ⇒ Object

Payload control - Camera focus value setting ###



7
8
9
10
11
# File 'lib/dji_mqtt_connect/factories/services/camera_focus_value_set.rb', line 7

def build_thing_product_camera_focus_value_set_services_message(data: build_thing_product_camera_focus_value_set_services_message_data)
  Thing::Product::CameraFocusValueSetServicesMessage.build(
    data: data
  )
end

#build_thing_product_camera_focus_value_set_services_message_dataObject



13
14
15
16
17
18
19
# File 'lib/dji_mqtt_connect/factories/services/camera_focus_value_set.rb', line 13

def build_thing_product_camera_focus_value_set_services_message_data
  {
    camera_type: Thing::Product::CameraFocusValueSetServicesMessage::CAMERA_TYPE_ZOOM,
    focus_value: 10,
    payload_index: "39-0-7"
  }
end

#build_thing_product_camera_focus_value_set_services_reply_message(result: 0) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/dji_mqtt_connect/factories/services/camera_focus_value_set.rb', line 21

def build_thing_product_camera_focus_value_set_services_reply_message(result: 0)
  message_data = {
    result: result
  }

  Thing::Product::CameraFocusValueSetServicesReplyMessage.new(
    bid: SecureRandom.uuid,
    tid: SecureRandom.uuid,
    timestamp: Message.current_timestamp,
    _method: "camera_focus_value_set",
    _data: message_data,
    data: message_data
  )
end

#build_thing_product_camera_frame_zoom_services_message(data: build_thing_product_camera_frame_zoom_services_message_data) ⇒ Object

Payload control - subject zoom



55
56
57
58
59
# File 'lib/dji_mqtt_connect/factories/services/live_control.rb', line 55

def build_thing_product_camera_frame_zoom_services_message(data: build_thing_product_camera_frame_zoom_services_message_data)
  Thing::Product::CameraFrameZoomServicesMessage.build(
    data: data
  )
end

#build_thing_product_camera_frame_zoom_services_message_dataObject



61
62
63
64
65
66
67
68
69
70
71
# File 'lib/dji_mqtt_connect/factories/services/live_control.rb', line 61

def build_thing_product_camera_frame_zoom_services_message_data
  {
    camera_type: "zoom",
    height: 0.2,
    locked: true,
    payload_index: "39-0-7",
    width: 0.2,
    x: 0.5,
    y: 0.5
  }
end

#build_thing_product_camera_frame_zoom_services_reply_message(result: 0) ⇒ Object



73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/dji_mqtt_connect/factories/services/live_control.rb', line 73

def build_thing_product_camera_frame_zoom_services_reply_message(result: 0)
  message_data = {
    result: result
  }

  Thing::Product::CameraFrameZoomServicesReplyMessage.new(
    bid: SecureRandom.uuid,
    tid: SecureRandom.uuid,
    timestamp: Message.current_timestamp,
    _method: "camera_frame_zoom",
    _data: message_data,
    data: message_data
  )
end

#build_thing_product_camera_look_at_services_message(data: build_thing_product_camera_look_at_services_message_data) ⇒ Object

Payload control - Reset gimbal ###



7
8
9
10
11
# File 'lib/dji_mqtt_connect/factories/services/camera_look_at.rb', line 7

def build_thing_product_camera_look_at_services_message(data: build_thing_product_camera_look_at_services_message_data)
  Thing::Product::CameraLookAtServicesMessage.build(
    data: data
  )
end

#build_thing_product_camera_look_at_services_message_dataObject



13
14
15
16
17
18
19
20
21
# File 'lib/dji_mqtt_connect/factories/services/camera_look_at.rb', line 13

def build_thing_product_camera_look_at_services_message_data
  {
    payload_index: "39-0-7",
    locked: true,
    latitude: "37.7749",
    longitude: "-122.4194",
    height: "100.0"
  }
end

#build_thing_product_camera_look_at_services_reply_message(result: 0) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/dji_mqtt_connect/factories/services/camera_look_at.rb', line 23

def build_thing_product_camera_look_at_services_reply_message(result: 0)
  message_data = {
    result: result
  }

  Thing::Product::CameraLookAtServicesReplyMessage.new(
    bid: SecureRandom.uuid,
    tid: SecureRandom.uuid,
    timestamp: Message.current_timestamp,
    _method: "camera_look_at",
    _data: message_data,
    data: message_data
  )
end

#build_thing_product_camera_mode_switch_services_message(data: build_thing_product_camera_mode_switch_services_message_data) ⇒ Object

Payload control - Switch Camera Mode



7
8
9
10
11
# File 'lib/dji_mqtt_connect/factories/services/camera_mode_switch.rb', line 7

def build_thing_product_camera_mode_switch_services_message(data: build_thing_product_camera_mode_switch_services_message_data)
  Thing::Product::CameraModeSwitchServicesMessage.build(
    data: data
  )
end

#build_thing_product_camera_mode_switch_services_message_dataObject



13
14
15
16
17
18
# File 'lib/dji_mqtt_connect/factories/services/camera_mode_switch.rb', line 13

def build_thing_product_camera_mode_switch_services_message_data
  {
    camera_mode: 0,
    payload_index: "39-0-7"
  }
end

#build_thing_product_camera_mode_switch_services_reply_message(result: 0) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/dji_mqtt_connect/factories/services/camera_mode_switch.rb', line 20

def build_thing_product_camera_mode_switch_services_reply_message(result: 0)
  message_data = {
    result: result
  }

  Thing::Product::CameraModeSwitchServicesReplyMessage.new(
    bid: SecureRandom.uuid,
    tid: SecureRandom.uuid,
    timestamp: Message.current_timestamp,
    _method: "camera_mode_switch",
    _data: message_data,
    data: message_data
  )
end

#build_thing_product_camera_photo_stop_services_message(payload_index: "39-0-7") ⇒ Object

Payload control - Stop capturing ###



7
8
9
10
11
12
13
14
15
# File 'lib/dji_mqtt_connect/factories/services/camera_photo_stop.rb', line 7

def build_thing_product_camera_photo_stop_services_message(payload_index: "39-0-7")
  message_data = {
    payload_index: payload_index
  }

  Thing::Product::CameraPhotoStopServicesMessage.build(
    data: message_data
  )
end

#build_thing_product_camera_photo_stop_services_reply_message(result: 0) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/dji_mqtt_connect/factories/services/camera_photo_stop.rb', line 17

def build_thing_product_camera_photo_stop_services_reply_message(result: 0)
  message_data = {
    result: result
  }

  Thing::Product::CameraPhotoStopServicesReplyMessage.new(
    bid: SecureRandom.uuid,
    tid: SecureRandom.uuid,
    timestamp: Message.current_timestamp,
    _method: "camera_photo_stop",
    _data: message_data,
    data: message_data
  )
end

#build_thing_product_camera_photo_take_services_message(payload_index: "39-0-7") ⇒ Object

Payload control - Start capturing ###



7
8
9
10
11
12
13
14
15
# File 'lib/dji_mqtt_connect/factories/services/camera_photo_take.rb', line 7

def build_thing_product_camera_photo_take_services_message(payload_index: "39-0-7")
  message_data = {
    payload_index: payload_index
  }

  Thing::Product::CameraPhotoTakeServicesMessage.build(
    data: message_data
  )
end

#build_thing_product_camera_photo_take_services_reply_message(result: 0) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/dji_mqtt_connect/factories/services/camera_photo_take.rb', line 17

def build_thing_product_camera_photo_take_services_reply_message(result: 0)
  message_data = {
    result: result
  }

  Thing::Product::CameraPhotoTakeServicesReplyMessage.new(
    bid: SecureRandom.uuid,
    tid: SecureRandom.uuid,
    timestamp: Message.current_timestamp,
    _method: "camera_photo_take",
    _data: message_data,
    data: message_data
  )
end

#build_thing_product_camera_point_focus_action_services_message(data: build_thing_product_camera_point_focus_action_services_message_data) ⇒ Object

Payload control - Spot AF ###



7
8
9
10
11
# File 'lib/dji_mqtt_connect/factories/services/camera_point_focus_action.rb', line 7

def build_thing_product_camera_point_focus_action_services_message(data: build_thing_product_camera_point_focus_action_services_message_data)
  Thing::Product::CameraPointFocusActionServicesMessage.build(
    data: data
  )
end

#build_thing_product_camera_point_focus_action_services_message_dataObject



13
14
15
16
17
18
19
20
# File 'lib/dji_mqtt_connect/factories/services/camera_point_focus_action.rb', line 13

def build_thing_product_camera_point_focus_action_services_message_data
  {
    camera_type: Thing::Product::CameraPointFocusActionServicesMessage::CAMERA_TYPE_ZOOM,
    x: 0.5,
    y: 0.5,
    payload_index: "39-0-7"
  }
end

#build_thing_product_camera_point_focus_action_services_reply_message(result: 0) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/dji_mqtt_connect/factories/services/camera_point_focus_action.rb', line 22

def build_thing_product_camera_point_focus_action_services_reply_message(result: 0)
  message_data = {
    result: result
  }

  Thing::Product::CameraPointFocusActionServicesReplyMessage.new(
    bid: SecureRandom.uuid,
    tid: SecureRandom.uuid,
    timestamp: Message.current_timestamp,
    _method: "camera_point_focus_action",
    _data: message_data,
    data: message_data
  )
end

#build_thing_product_camera_recording_start_services_message(payload_index: "39-0-7") ⇒ Object

Payload control - Start capturing ###



7
8
9
10
11
12
13
14
15
# File 'lib/dji_mqtt_connect/factories/services/camera_recording_start.rb', line 7

def build_thing_product_camera_recording_start_services_message(payload_index: "39-0-7")
  message_data = {
    payload_index: payload_index
  }

  Thing::Product::CameraRecordingStartServicesMessage.build(
    data: message_data
  )
end

#build_thing_product_camera_recording_start_services_reply_message(result: 0) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/dji_mqtt_connect/factories/services/camera_recording_start.rb', line 17

def build_thing_product_camera_recording_start_services_reply_message(result: 0)
  message_data = {
    result: result
  }

  Thing::Product::CameraRecordingStartServicesReplyMessage.new(
    bid: SecureRandom.uuid,
    tid: SecureRandom.uuid,
    timestamp: Message.current_timestamp,
    _method: "camera_recording_start",
    _data: message_data,
    data: message_data
  )
end

#build_thing_product_camera_recording_stop_services_message(payload_index: "39-0-7") ⇒ Object

Payload control - Stop Recording ###



7
8
9
10
11
12
13
14
15
# File 'lib/dji_mqtt_connect/factories/services/camera_recording_stop.rb', line 7

def build_thing_product_camera_recording_stop_services_message(payload_index: "39-0-7")
  message_data = {
    payload_index: payload_index
  }

  Thing::Product::CameraRecordingStopServicesMessage.build(
    data: message_data
  )
end

#build_thing_product_camera_recording_stop_services_reply_message(result: 0) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/dji_mqtt_connect/factories/services/camera_recording_stop.rb', line 17

def build_thing_product_camera_recording_stop_services_reply_message(result: 0)
  message_data = {
    result: result
  }

  Thing::Product::CameraRecordingStopServicesReplyMessage.new(
    bid: SecureRandom.uuid,
    tid: SecureRandom.uuid,
    timestamp: Message.current_timestamp,
    _method: "camera_recording_stop",
    _data: message_data,
    data: message_data
  )
end

#build_thing_product_camera_screen_drag_services_message(data: build_thing_product_camera_screen_drag_services_message_data) ⇒ Object

Payload control - Screen Drag Control ###



7
8
9
10
11
# File 'lib/dji_mqtt_connect/factories/services/camera_screen_drag.rb', line 7

def build_thing_product_camera_screen_drag_services_message(data: build_thing_product_camera_screen_drag_services_message_data)
  Thing::Product::CameraScreenDragServicesMessage.build(
    data: data
  )
end

#build_thing_product_camera_screen_drag_services_message_dataObject



13
14
15
16
17
18
19
20
# File 'lib/dji_mqtt_connect/factories/services/camera_screen_drag.rb', line 13

def build_thing_product_camera_screen_drag_services_message_data
  {
    locked: true,
    payload_index: "39-0-7",
    pitch_speed: 0.1,
    yaw_speed: 0.1
  }
end

#build_thing_product_camera_screen_drag_services_reply_message(result: 0) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/dji_mqtt_connect/factories/services/camera_screen_drag.rb', line 22

def build_thing_product_camera_screen_drag_services_reply_message(result: 0)
  message_data = {
    result: result
  }

  Thing::Product::CameraScreenDragServicesReplyMessage.new(
    bid: SecureRandom.uuid,
    tid: SecureRandom.uuid,
    timestamp: Message.current_timestamp,
    _method: "camera_screen_drag",
    _data: message_data,
    data: message_data
  )
end

#build_thing_product_camera_screen_split_services_message(data: build_thing_product_camera_screen_split_services_message_data) ⇒ Object

Payload control - Split Screen ###



7
8
9
10
11
# File 'lib/dji_mqtt_connect/factories/services/camera_screen_split.rb', line 7

def build_thing_product_camera_screen_split_services_message(data: build_thing_product_camera_screen_split_services_message_data)
  Thing::Product::CameraScreenSplitServicesMessage.build(
    data: data
  )
end

#build_thing_product_camera_screen_split_services_message_dataObject



13
14
15
16
17
18
# File 'lib/dji_mqtt_connect/factories/services/camera_screen_split.rb', line 13

def build_thing_product_camera_screen_split_services_message_data
  {
    payload_index: "39-0-7",
    enable: true
  }
end

#build_thing_product_camera_screen_split_services_reply_message(result: 0) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/dji_mqtt_connect/factories/services/camera_screen_split.rb', line 20

def build_thing_product_camera_screen_split_services_reply_message(result: 0)
  message_data = {
    result: result
  }

  Thing::Product::CameraScreenSplitServicesReplyMessage.new(
    bid: SecureRandom.uuid,
    tid: SecureRandom.uuid,
    timestamp: Message.current_timestamp,
    _method: "camera_screen_split",
    _data: message_data,
    data: message_data
  )
end

#build_thing_product_charge_close_services_messageObject

Stop Charging ###



7
8
9
# File 'lib/dji_mqtt_connect/factories/services/charge_close.rb', line 7

def build_thing_product_charge_close_services_message
  Thing::Product::ChargeCloseServicesMessage.build
end

#build_thing_product_charge_close_services_reply_message(result: 0) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/dji_mqtt_connect/factories/services/charge_close.rb', line 11

def build_thing_product_charge_close_services_reply_message(result: 0)
  message_data = {
    result: result,
    output: {
      status: "ok"
    }
  }

  Thing::Product::ChargeCloseServicesReplyMessage.new(
    bid: SecureRandom.uuid,
    tid: SecureRandom.uuid,
    timestamp: Message.current_timestamp,
    _method: "charge_close",
    _data: message_data,
    data: message_data
  )
end

#build_thing_product_charge_open_services_messageObject

Stop Charging ###



7
8
9
# File 'lib/dji_mqtt_connect/factories/services/charge_open.rb', line 7

def build_thing_product_charge_open_services_message
  Thing::Product::ChargeOpenServicesMessage.build
end

#build_thing_product_charge_open_services_reply_message(result: 0) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/dji_mqtt_connect/factories/services/charge_open.rb', line 11

def build_thing_product_charge_open_services_reply_message(result: 0)
  message_data = {
    result: result,
    output: {
      status: "ok"
    }
  }

  Thing::Product::ChargeOpenServicesReplyMessage.new(
    bid: SecureRandom.uuid,
    tid: SecureRandom.uuid,
    timestamp: Message.current_timestamp,
    _method: "charge_open",
    _data: message_data,
    data: message_data
  )
end

#build_thing_product_cover_close_services_messageObject



9
10
11
# File 'lib/dji_mqtt_connect/factories/services_messages.rb', line 9

def build_thing_product_cover_close_services_message
  Thing::Product::CoverCloseServicesMessage.build
end

#build_thing_product_cover_force_close_services_messageObject

Force Close ###



7
8
9
# File 'lib/dji_mqtt_connect/factories/services/cover_force_close.rb', line 7

def build_thing_product_cover_force_close_services_message
  Thing::Product::CoverForceCloseServicesMessage.build
end

#build_thing_product_cover_force_close_services_reply_message(result: 0) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/dji_mqtt_connect/factories/services/cover_force_close.rb', line 11

def build_thing_product_cover_force_close_services_reply_message(result: 0)
  message_data = {
    result: result,
    output: {
      status: "ok"
    }
  }

  Thing::Product::CoverForceCloseServicesReplyMessage.new(
    bid: SecureRandom.uuid,
    tid: SecureRandom.uuid,
    timestamp: Message.current_timestamp,
    _method: "cover_force_close",
    _data: message_data,
    data: message_data
  )
end

#build_thing_product_cover_open_services_messageObject



13
14
15
# File 'lib/dji_mqtt_connect/factories/services_messages.rb', line 13

def build_thing_product_cover_open_services_message
  Thing::Product::CoverOpenServicesMessage.build
end

#build_thing_product_debug_mode_close_services_messageObject



17
18
19
# File 'lib/dji_mqtt_connect/factories/services_messages.rb', line 17

def build_thing_product_debug_mode_close_services_message
  Thing::Product::DebugModeCloseServicesMessage.build
end

#build_thing_product_debug_mode_open_services_messageObject



21
22
23
# File 'lib/dji_mqtt_connect/factories/services_messages.rb', line 21

def build_thing_product_debug_mode_open_services_message
  Thing::Product::DebugModeOpenServicesMessage.build
end

#build_thing_product_drc_mode_enter_services_message(data: build_thing_product_drc_mode_enter_services_message_data) ⇒ Object



5
6
7
8
9
# File 'lib/dji_mqtt_connect/factories/services/drc_mode_enter.rb', line 5

def build_thing_product_drc_mode_enter_services_message(data: build_thing_product_drc_mode_enter_services_message_data)
  Thing::Product::DrcModeEnterServicesMessage.build(
    data: data
  )
end

#build_thing_product_drc_mode_enter_services_message_dataObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/dji_mqtt_connect/factories/services/drc_mode_enter.rb', line 11

def build_thing_product_drc_mode_enter_services_message_data
  {
    hsi_frequency: 1,
    mqtt_broker: {
      address: "mqtt.dji.com:8883",
      client_id: "sn_a",
      enable_tls: true,
      expire_time: 1672744922,
      password: "jwt_token",
      username: "sn_a_username"
    },
    osd_frequency: 10
  }
end

#build_thing_product_drc_mode_enter_services_reply_message(result: 0) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/dji_mqtt_connect/factories/services/drc_mode_enter.rb', line 26

def build_thing_product_drc_mode_enter_services_reply_message(result: 0)
  message_data = {
    result: result
  }

  Thing::Product::DrcModeEnterServicesReplyMessage.new(
    bid: SecureRandom.uuid,
    tid: SecureRandom.uuid,
    timestamp: Message.current_timestamp,
    _method: "drc_mode_enter",
    _data: message_data,
    data: message_data
  )
end

#build_thing_product_drc_mode_exit_services_messageObject



5
6
7
# File 'lib/dji_mqtt_connect/factories/services/drc_mode_exit.rb', line 5

def build_thing_product_drc_mode_exit_services_message
  Thing::Product::DrcModeExitServicesMessage.build
end

#build_thing_product_drc_mode_exit_services_reply_message(result: 0) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/dji_mqtt_connect/factories/services/drc_mode_exit.rb', line 9

def build_thing_product_drc_mode_exit_services_reply_message(result: 0)
  message_data = {
    result: result
  }

  Thing::Product::DrcModeExitServicesReplyMessage.new(
    bid: SecureRandom.uuid,
    tid: SecureRandom.uuid,
    timestamp: Message.current_timestamp,
    _method: "drc_mode_exit",
    _data: message_data,
    data: message_data
  )
end

#build_thing_product_drone_close_services_messageObject



25
26
27
# File 'lib/dji_mqtt_connect/factories/services_messages.rb', line 25

def build_thing_product_drone_close_services_message
  Thing::Product::DroneCloseServicesMessage.build
end

#build_thing_product_drone_open_services_messageObject



29
30
31
# File 'lib/dji_mqtt_connect/factories/services_messages.rb', line 29

def build_thing_product_drone_open_services_message
  Thing::Product::DroneOpenServicesMessage.build
end

#build_thing_product_fileupload_list_services_messageObject



33
34
35
36
37
# File 'lib/dji_mqtt_connect/factories/services_messages.rb', line 33

def build_thing_product_fileupload_list_services_message
  Thing::Product::FileuploadListServicesMessage.build(
    module_list: [0, 3]
  )
end

#build_thing_product_fileupload_start_services_messageObject



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

def build_thing_product_fileupload_start_services_message
  timestamp = Message.current_timestamp
  Thing::Product::FileuploadStartServicesMessage.build(
    data: {
      bucket: "stg-dji-service-hz-ksd7",
      region: "hz",
      credentials: {
        access_key_id: "STS.access_key_id",
        access_key_secret: "access_key_secret",
        expire: 3600,
        security_token: "security_token"
      },
      endpoint: "https://oss-cn-hangzhou.aliyuncs.com",
      params: {
        files: [
          {
            list: [
              {
                boot_index: 1111,
                end_time: timestamp - 3000,
                size: 33789,
                start_time: timestamp - 4000
              },
              {
                boot_index: 22222,
                end_time: timestamp - 1000,
                size: 33789,
                start_time: timestamp - 2000
              }
            ],
            module: "3",
            object_key: "object_key"
          }
        ]
      },
      provider: "ali"
    }
  )
end

#build_thing_product_flight_authority_grab_services_messageObject

Flight Authority Grab ###



7
8
9
# File 'lib/dji_mqtt_connect/factories/services/live_control.rb', line 7

def build_thing_product_flight_authority_grab_services_message
  Thing::Product::FlightAuthorityGrabServicesMessage.build
end

#build_thing_product_flight_authority_grab_services_reply_message(result: 0) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/dji_mqtt_connect/factories/services/live_control.rb', line 11

def build_thing_product_flight_authority_grab_services_reply_message(result: 0)
  message_data = {
    result: result
  }

  Thing::Product::FlightAuthorityGrabServicesReplyMessage.new(
    bid: SecureRandom.uuid,
    tid: SecureRandom.uuid,
    timestamp: Message.current_timestamp,
    _method: "flight_authority_grab",
    _data: message_data,
    data: message_data
  )
end

#build_thing_product_flighttask_execute_services_messageObject

Flighttask Execute ###



81
82
83
# File 'lib/dji_mqtt_connect/factories/services_messages.rb', line 81

def build_thing_product_flighttask_execute_services_message
  Thing::Product::FlighttaskExecuteServicesMessage.build(flight_id: SecureRandom.uuid)
end

#build_thing_product_flighttask_pause_services_messageObject



85
86
87
# File 'lib/dji_mqtt_connect/factories/services_messages.rb', line 85

def build_thing_product_flighttask_pause_services_message
  Thing::Product::FlighttaskPauseServicesMessage.build
end

#build_thing_product_flighttask_prepare_services_messageObject



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

def build_thing_product_flighttask_prepare_services_message
  Thing::Product::FlighttaskPrepareServicesMessage.build(
    data: {
      execute_time: 1234567890123,
      flight_id: "xxxxxxx",
      task_type: 2,
      file: {
        url: "https://xxx.com/xxxx",
        fingerprint: "xxxx"
      },
      ready_conditions: {
        battery_capacity: 90,
        begin_time: 1234567890123,
        end_time: 1234567890123
      },
      executable_conditions: {
        storage_capacity: 1000
      },
      break_point: {
        index: 1,
        state: 0,
        progress: 0.34,
        wayline_id: 0
      },
      rth_altitude: 100,
      rth_mode: 1,
      out_of_control_action: 0,
      exit_wayline_when_rc_lost: 0,
      wayline_precision_type: 0
    }
  )
end

#build_thing_product_flighttask_progress_get_services_messageObject



126
127
128
129
130
131
132
# File 'lib/dji_mqtt_connect/factories/services_messages.rb', line 126

def build_thing_product_flighttask_progress_get_services_message
  Thing::Product::FlighttaskProgressGetServicesMessage.build(
    data: {
      sn: "SN1234567890"
    }
  )
end

#build_thing_product_flighttask_recovery_services_messageObject



122
123
124
# File 'lib/dji_mqtt_connect/factories/services_messages.rb', line 122

def build_thing_product_flighttask_recovery_services_message
  Thing::Product::FlighttaskRecoveryServicesMessage.build
end

#build_thing_product_flighttask_stop_services_messageObject



134
135
136
137
138
139
140
141
# File 'lib/dji_mqtt_connect/factories/services_messages.rb', line 134

def build_thing_product_flighttask_stop_services_message
  Thing::Product::FlighttaskStopServicesMessage.build(
    data: {
      flight_id: SecureRandom.uuid,
      reason: 0
    }
  )
end

#build_thing_product_flighttask_undo_services_messageObject



143
144
145
146
147
# File 'lib/dji_mqtt_connect/factories/services_messages.rb', line 143

def build_thing_product_flighttask_undo_services_message
  Thing::Product::FlighttaskUndoServicesMessage.build(
    flight_ids: [SecureRandom.uuid, SecureRandom.uuid]
  )
end

#build_thing_product_fly_to_point_services_messageObject

Fly to Point (Services Messages) ###



151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# File 'lib/dji_mqtt_connect/factories/services_messages.rb', line 151

def build_thing_product_fly_to_point_services_message
  message_data = {
    fly_to_id: SecureRandom.uuid,
    points: [
      {
        latitude: 37.7749,
        longitude: -122.4194,
        height: 100
      }
    ],
    max_speed: 5
  }

  Thing::Product::FlyToPointServicesMessage.build(
    data: message_data
  )
end

#build_thing_product_fly_to_point_stop_services_messageObject



169
170
171
# File 'lib/dji_mqtt_connect/factories/services_messages.rb', line 169

def build_thing_product_fly_to_point_stop_services_message
  Thing::Product::FlyToPointStopServicesMessage.build
end

#build_thing_product_fly_to_point_update_services_messageObject



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

def build_thing_product_fly_to_point_update_services_message
  message_data = {
    points: [
      {
        latitude: 37.7750,
        longitude: -122.4195,
        height: 120
      }
    ],
    max_speed: 6
  }

  Thing::Product::FlyToPointUpdateServicesMessage.build(
    data: message_data
  )
end

#build_thing_product_gimbal_reset_services_message(data: build_thing_product_gimbal_reset_services_message_data) ⇒ Object

Payload control - Reset gimbal ###



7
8
9
10
11
# File 'lib/dji_mqtt_connect/factories/services/gimbal_reset.rb', line 7

def build_thing_product_gimbal_reset_services_message(data: build_thing_product_gimbal_reset_services_message_data)
  Thing::Product::GimbalResetServicesMessage.build(
    data: data
  )
end

#build_thing_product_gimbal_reset_services_message_dataObject



13
14
15
16
17
18
# File 'lib/dji_mqtt_connect/factories/services/gimbal_reset.rb', line 13

def build_thing_product_gimbal_reset_services_message_data
  {
    payload_index: "39-0-7",
    reset_mode: Thing::Product::GimbalResetServicesMessage::RESET_MODE_RESET
  }
end

#build_thing_product_gimbal_reset_services_reply_message(result: 0) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/dji_mqtt_connect/factories/services/gimbal_reset.rb', line 20

def build_thing_product_gimbal_reset_services_reply_message(result: 0)
  message_data = {
    result: result
  }

  Thing::Product::GimbalResetServicesReplyMessage.new(
    bid: SecureRandom.uuid,
    tid: SecureRandom.uuid,
    timestamp: Message.current_timestamp,
    _method: "gimbal_reset",
    _data: message_data,
    data: message_data
  )
end

#build_thing_product_ir_metering_area_set_services_message(data: build_thing_product_ir_metering_area_set_services_message_data) ⇒ Object

Payload control - Infrared temperature measurement area setting ###



7
8
9
10
11
# File 'lib/dji_mqtt_connect/factories/services/ir_metering_area_set.rb', line 7

def build_thing_product_ir_metering_area_set_services_message(data: build_thing_product_ir_metering_area_set_services_message_data)
  Thing::Product::IrMeteringAreaSetServicesMessage.build(
    data: data
  )
end

#build_thing_product_ir_metering_area_set_services_message_dataObject



13
14
15
16
17
18
19
20
21
# File 'lib/dji_mqtt_connect/factories/services/ir_metering_area_set.rb', line 13

def build_thing_product_ir_metering_area_set_services_message_data
  {
    x: 0.5,
    y: 0.5,
    width: 0.3,
    height: 0.3,
    payload_index: "39-0-7"
  }
end

#build_thing_product_ir_metering_area_set_services_reply_message(result: 0) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/dji_mqtt_connect/factories/services/ir_metering_area_set.rb', line 23

def build_thing_product_ir_metering_area_set_services_reply_message(result: 0)
  message_data = {
    result: result
  }

  Thing::Product::IrMeteringAreaSetServicesReplyMessage.new(
    bid: SecureRandom.uuid,
    tid: SecureRandom.uuid,
    timestamp: Message.current_timestamp,
    _method: "ir_metering_area_set",
    _data: message_data,
    data: message_data
  )
end

#build_thing_product_ir_metering_mode_set_services_message(data: build_thing_product_ir_metering_mode_set_services_message_data) ⇒ Object

Payload control - Infrared temperature measurement mode setting ###



7
8
9
10
11
# File 'lib/dji_mqtt_connect/factories/services/ir_metering_mode_set.rb', line 7

def build_thing_product_ir_metering_mode_set_services_message(data: build_thing_product_ir_metering_mode_set_services_message_data)
  Thing::Product::IrMeteringModeSetServicesMessage.build(
    data: data
  )
end

#build_thing_product_ir_metering_mode_set_services_message_dataObject



13
14
15
16
17
18
# File 'lib/dji_mqtt_connect/factories/services/ir_metering_mode_set.rb', line 13

def build_thing_product_ir_metering_mode_set_services_message_data
  {
    mode: Thing::Product::IrMeteringModeSetServicesMessage::MODE_POINT,
    payload_index: "39-0-7"
  }
end

#build_thing_product_ir_metering_mode_set_services_reply_message(result: 0) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/dji_mqtt_connect/factories/services/ir_metering_mode_set.rb', line 20

def build_thing_product_ir_metering_mode_set_services_reply_message(result: 0)
  message_data = {
    result: result
  }

  Thing::Product::IrMeteringModeSetServicesReplyMessage.new(
    bid: SecureRandom.uuid,
    tid: SecureRandom.uuid,
    timestamp: Message.current_timestamp,
    _method: "ir_metering_mode_set",
    _data: message_data,
    data: message_data
  )
end

#build_thing_product_ir_metering_point_set_services_message(data: build_thing_product_ir_metering_point_set_services_message_data) ⇒ Object

Payload control - Infrared temperature measurement point setting ###



7
8
9
10
11
# File 'lib/dji_mqtt_connect/factories/services/ir_metering_point_set.rb', line 7

def build_thing_product_ir_metering_point_set_services_message(data: build_thing_product_ir_metering_point_set_services_message_data)
  Thing::Product::IrMeteringPointSetServicesMessage.build(
    data: data
  )
end

#build_thing_product_ir_metering_point_set_services_message_dataObject



13
14
15
16
17
18
19
# File 'lib/dji_mqtt_connect/factories/services/ir_metering_point_set.rb', line 13

def build_thing_product_ir_metering_point_set_services_message_data
  {
    x: 0.5,
    y: 0.5,
    payload_index: "39-0-7"
  }
end

#build_thing_product_ir_metering_point_set_services_reply_message(result: 0) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/dji_mqtt_connect/factories/services/ir_metering_point_set.rb', line 21

def build_thing_product_ir_metering_point_set_services_reply_message(result: 0)
  message_data = {
    result: result
  }

  Thing::Product::IrMeteringPointSetServicesReplyMessage.new(
    bid: SecureRandom.uuid,
    tid: SecureRandom.uuid,
    timestamp: Message.current_timestamp,
    _method: "ir_metering_point_set",
    _data: message_data,
    data: message_data
  )
end

#build_thing_product_live_camera_change_services_messageObject

Live Stream (Services Messages) ###



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

def build_thing_product_live_camera_change_services_message
  Thing::Product::LiveCameraChangeServicesMessage.build(
    data: {
      video_id: "1ZNDH1D0010098/165-0-7/normal-0",
      camera_position: 0
    }
  )
end

#build_thing_product_live_lens_change_services_messageObject



201
202
203
204
205
206
207
208
# File 'lib/dji_mqtt_connect/factories/services_messages.rb', line 201

def build_thing_product_live_lens_change_services_message
  Thing::Product::LiveLensChangeServicesMessage.build(
    data: {
      video_id: "1ZNDH1D0010098/39-0-7/normal-0",
      video_type: "wide"
    }
  )
end

#build_thing_product_live_set_quality_services_messageObject



210
211
212
213
214
215
216
217
# File 'lib/dji_mqtt_connect/factories/services_messages.rb', line 210

def build_thing_product_live_set_quality_services_message
  Thing::Product::LiveSetQualityServicesMessage.build(
    data: {
      video_id: "1ZNDH1D0010098/39-0-7/normal-0",
      video_quality: 0
    }
  )
end

#build_thing_product_live_start_push_services_messageObject



219
220
221
222
223
224
225
226
227
228
# File 'lib/dji_mqtt_connect/factories/services_messages.rb', line 219

def build_thing_product_live_start_push_services_message
  Thing::Product::LiveStartPushServicesMessage.build(
    data: {
      url: "channel=1ZNDH1D0010098_39-0-7&sn=1ZNDH1D0010098&token=006dca67721582a48768ec4d817b7b25a86IADk%2Fcm%2Fdv%2BHY6qT%2FAKM6y7TcUe4lXNvZpycH7vUMAlM6pFALUKF2zyCIgA82pQE8cCoYAQAAQDxwKhgAgDxwKhgAwDxwKhgBADxwKhg&uid=50000",
      url_type: 0,
      video_id: "1ZNDH1D0010098/39-0-7/normal-0",
      video_quality: 0
    }
  )
end

#build_thing_product_live_stop_push_services_messageObject



230
231
232
233
234
235
236
# File 'lib/dji_mqtt_connect/factories/services_messages.rb', line 230

def build_thing_product_live_stop_push_services_message
  Thing::Product::LiveStopPushServicesMessage.build(
    data: {
      video_id: "1ZNDH1D0010098/39-0-7/normal-0"
    }
  )
end

#build_thing_product_ota_create_services_message(data: build_thing_product_ota_create_services_message_data) ⇒ Object



5
6
7
8
9
# File 'lib/dji_mqtt_connect/factories/services/ota_create.rb', line 5

def build_thing_product_ota_create_services_message(data: build_thing_product_ota_create_services_message_data)
  Thing::Product::OtaCreateServicesMessage.build(
    data: data
  )
end

#build_thing_product_ota_create_services_message_dataObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/dji_mqtt_connect/factories/services/ota_create.rb', line 11

def build_thing_product_ota_create_services_message_data
  {
    devices: [
      {
        file_name: "wm245_1.00.223.zip",
        file_size: 653467234,
        file_url: "https://s3.com/xxx.zip",
        firmware_upgrade_type: 2,
        md5: "abcdefabcdefabcdef",
        product_version: "1.00.223",
        sn: "DRONESN"
      },
      {
        firmware_upgrade_type: 3,
        product_version: "1.00.223",
        sn: "DOCKSN"
      }
    ]
  }
end

#build_thing_product_ota_create_services_reply_message(status: "ok", result: 0) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/dji_mqtt_connect/factories/services/ota_create.rb', line 32

def build_thing_product_ota_create_services_reply_message(status: "ok", result: 0)
  message_data = {
    status: status,
    result: result
  }

  Thing::Product::OtaCreateServicesReplyMessage.new(
    bid: SecureRandom.uuid,
    tid: SecureRandom.uuid,
    timestamp: Message.current_timestamp,
    _method: "ota_create",
    _data: message_data,
    data: message_data
  )
end

#build_thing_product_payload_authority_grab_services_message(payload_index: "39-0-7") ⇒ Object

Payload Authority Grab ###



28
29
30
31
32
33
34
35
36
# File 'lib/dji_mqtt_connect/factories/services/live_control.rb', line 28

def build_thing_product_payload_authority_grab_services_message(payload_index: "39-0-7")
  message_data = {
    payload_index: payload_index
  }

  Thing::Product::PayloadAuthorityGrabServicesMessage.build(
    data: message_data
  )
end

#build_thing_product_payload_authority_grab_services_reply_message(result: 0) ⇒ Object



38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/dji_mqtt_connect/factories/services/live_control.rb', line 38

def build_thing_product_payload_authority_grab_services_reply_message(result: 0)
  message_data = {
    result: result
  }

  Thing::Product::PayloadAuthorityGrabServicesReplyMessage.new(
    bid: SecureRandom.uuid,
    tid: SecureRandom.uuid,
    timestamp: Message.current_timestamp,
    _method: "payload_authority_grab",
    _data: message_data,
    data: message_data
  )
end

#build_thing_product_photo_storage_set_services_message(data: build_thing_product_photo_storage_set_services_message_data) ⇒ Object

Payload control - Photo storage settings ###



7
8
9
10
11
# File 'lib/dji_mqtt_connect/factories/services/photo_storage_set.rb', line 7

def build_thing_product_photo_storage_set_services_message(data: build_thing_product_photo_storage_set_services_message_data)
  Thing::Product::PhotoStorageSetServicesMessage.build(
    data: data
  )
end

#build_thing_product_photo_storage_set_services_message_dataObject



13
14
15
16
17
18
19
20
21
22
# File 'lib/dji_mqtt_connect/factories/services/photo_storage_set.rb', line 13

def build_thing_product_photo_storage_set_services_message_data
  {
    payload_index: "39-0-7",
    photo_storage_settings: [
      "current",
      "vision",
      "ir"
    ]
  }
end

#build_thing_product_photo_storage_set_services_reply_message(result: 0) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/dji_mqtt_connect/factories/services/photo_storage_set.rb', line 24

def build_thing_product_photo_storage_set_services_reply_message(result: 0)
  message_data = {
    result: result
  }

  Thing::Product::PhotoStorageSetServicesReplyMessage.new(
    bid: SecureRandom.uuid,
    tid: SecureRandom.uuid,
    timestamp: Message.current_timestamp,
    _method: "photo_storage_set",
    _data: message_data,
    data: message_data
  )
end

#build_thing_product_return_home_cancel_services_messageObject



242
243
244
# File 'lib/dji_mqtt_connect/factories/services_messages.rb', line 242

def build_thing_product_return_home_cancel_services_message
  Thing::Product::ReturnHomeCancelServicesMessage.build
end

#build_thing_product_return_home_services_messageObject



238
239
240
# File 'lib/dji_mqtt_connect/factories/services_messages.rb', line 238

def build_thing_product_return_home_services_message
  Thing::Product::ReturnHomeServicesMessage.build
end

#build_thing_product_return_specific_home_services_message(home_dock_sn: "SN1234567890") ⇒ Object



246
247
248
# File 'lib/dji_mqtt_connect/factories/services_messages.rb', line 246

def build_thing_product_return_specific_home_services_message(home_dock_sn: "SN1234567890")
  Thing::Product::ReturnSpecificHomeServicesMessage.build(home_dock_sn: home_dock_sn)
end

#build_thing_product_takeoff_to_point_services_messageObject

Takeoff to Point (Services Messages) ###



252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
# File 'lib/dji_mqtt_connect/factories/services_messages.rb', line 252

def build_thing_product_takeoff_to_point_services_message
  message_data = {
    flight_id: SecureRandom.uuid,
    target_latitude: 37.7749,
    target_longitude: -122.4194,
    target_height: 100,
    max_speed: 5,
    rth_mode: 1,
    rth_altitude: 30,
    security_takeoff_height: 10,
    rc_lost_action: 1,
    commander_mode_lost_action: 0,
    commander_flight_mode: 1,
    commander_flight_height: 50,
    flight_safety_advance_check: 1
  }

  Thing::Product::TakeoffToPointServicesMessage.build(
    data: message_data
  )
end

#build_thing_product_takeoff_to_point_services_reply_messageObject



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

def build_thing_product_takeoff_to_point_services_reply_message
  message_data = {
    result: 0
  }

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

#build_thing_product_video_storage_set_services_message(data: build_thing_product_video_storage_set_services_message_data) ⇒ Object

Payload control - Video storage settings ###



7
8
9
10
11
# File 'lib/dji_mqtt_connect/factories/services/video_storage_set.rb', line 7

def build_thing_product_video_storage_set_services_message(data: build_thing_product_video_storage_set_services_message_data)
  Thing::Product::VideoStorageSetServicesMessage.build(
    data: data
  )
end

#build_thing_product_video_storage_set_services_message_dataObject



13
14
15
16
17
18
19
20
21
22
# File 'lib/dji_mqtt_connect/factories/services/video_storage_set.rb', line 13

def build_thing_product_video_storage_set_services_message_data
  {
    payload_index: "39-0-7",
    video_storage_settings: [
      "current",
      "vision",
      "ir"
    ]
  }
end

#build_thing_product_video_storage_set_services_reply_message(result: 0) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/dji_mqtt_connect/factories/services/video_storage_set.rb', line 24

def build_thing_product_video_storage_set_services_reply_message(result: 0)
  message_data = {
    result: result
  }

  Thing::Product::VideoStorageSetServicesReplyMessage.new(
    bid: SecureRandom.uuid,
    tid: SecureRandom.uuid,
    timestamp: Message.current_timestamp,
    _method: "video_storage_set",
    _data: message_data,
    data: message_data
  )
end