Module: DjiMqttConnect::Factories::StateMessages

Included in:
DjiMqttConnect::Factories
Defined in:
lib/dji_mqtt_connect/factories/state_messages.rb

Instance Method Summary collapse

Instance Method Details

#build_thing_product_state_message_with_ar_info_switchObject

Payload Messages ###



156
157
158
159
160
161
162
163
164
165
166
167
168
169
# File 'lib/dji_mqtt_connect/factories/state_messages.rb', line 156

def build_thing_product_state_message_with_ar_info_switch
  message_data = {
    ar_info_switch: 1
  }

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

#build_thing_product_state_message_with_commander_flight_heightObject



171
172
173
174
175
176
177
178
179
180
181
182
183
184
# File 'lib/dji_mqtt_connect/factories/state_messages.rb', line 171

def build_thing_product_state_message_with_commander_flight_height
  message_data = {
    commander_flight_height: 50
  }

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

#build_thing_product_state_message_with_commander_flight_modeObject



186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/dji_mqtt_connect/factories/state_messages.rb', line 186

def build_thing_product_state_message_with_commander_flight_mode
  message_data = {
    commander_flight_mode: 0
  }

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

#build_thing_product_state_message_with_commander_mode_lost_actionObject



201
202
203
204
205
206
207
208
209
210
211
212
213
214
# File 'lib/dji_mqtt_connect/factories/state_messages.rb', line 201

def build_thing_product_state_message_with_commander_mode_lost_action
  message_data = {
    commander_mode_lost_action: 1
  }

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

#build_thing_product_state_message_with_current_commander_flight_modeObject



216
217
218
219
220
221
222
223
224
225
226
227
228
229
# File 'lib/dji_mqtt_connect/factories/state_messages.rb', line 216

def build_thing_product_state_message_with_current_commander_flight_mode
  message_data = {
    current_commander_flight_mode: 0
  }

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

#build_thing_product_state_message_with_current_rth_modeObject



231
232
233
234
235
236
237
238
239
240
241
242
243
244
# File 'lib/dji_mqtt_connect/factories/state_messages.rb', line 231

def build_thing_product_state_message_with_current_rth_mode
  message_data = {
    current_rth_mode: 1
  }

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

#build_thing_product_state_message_with_firmware_versionObject

Gateway Messages ###



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

def build_thing_product_state_message_with_firmware_version
  message_data = {
    firmware_version: "10.01.1607",
    compatible_status: 0,
    firmware_upgrade_status: 0
  }

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

#build_thing_product_state_message_with_flysafe_database_versionObject



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

def build_thing_product_state_message_with_flysafe_database_version
  message_data = {
    flysafe_database_version: "01.00.01.35"
  }

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

#build_thing_product_state_message_with_geo_caging_statusObject



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

def build_thing_product_state_message_with_geo_caging_status
  message_data = {
    geo_caging_status: {
      state: 0
    }
  }

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

#build_thing_product_state_message_with_live_capacityObject



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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/dji_mqtt_connect/factories/state_messages.rb', line 24

def build_thing_product_state_message_with_live_capacity
  message_data = {
    live_capacity: {
      available_video_number: 3,
      coexist_video_number_max: 2,
      device_list: [
        {
          sn: "DOCK01",
          available_video_number: 1,
          coexist_video_number_max: 1,
          camera_list: [
            {
              camera_index: "165-0-7",
              available_video_number: 1,
              coexist_video_number_max: 1,
              video_list: [
                {
                  video_index: "normal-0",
                  video_type: "normal",
                  switchable_video_types: [
                    "normal"
                  ]
                }
              ]
            }
          ]
        },
        {
          sn: "DRONE01",
          available_video_number: 2,
          coexist_video_number_max: 2,
          camera_list: [
            {
              camera_index: "39-0-7",
              available_video_number: 1,
              coexist_video_number_max: 1,
              video_list: [
                {
                  video_index: "normal-0",
                  video_type: "normal",
                  switchable_video_types: [
                    "normal"
                  ]
                }
              ]
            },
            {
              camera_index: "52-0-0",
              available_video_number: 1,
              coexist_video_number_max: 1,
              video_list: [
                {
                  video_index: "normal-0",
                  video_type: "wide",
                  switchable_video_types: [
                    "wide",
                    "zoom",
                    "ir"
                  ]
                }
              ]
            }
          ]
        }
      ]
    }
  }

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

#build_thing_product_state_message_with_live_statusObject



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

def build_thing_product_state_message_with_live_status
  message_data = {

    live_status: [
      {
        video_id: "1581F6QAD242M00BD78G/80-0-0/normal-0",
        video_type: "wide",
        video_quality: 0,
        status: 1,
        error_status: 0
      },
      {
        video_id: "7CTDM2100BQ58L/165-0-7/normal-0",
        video_type: "normal",
        video_quality: 0,
        status: 1,
        error_status: 0
      }
    ]
  }

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

#build_thing_product_state_message_with_mode_code_reasonObject



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

def build_thing_product_state_message_with_mode_code_reason
  message_data = {
    mode_code_reason: 0
  }

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

#build_thing_product_state_message_with_offline_map_enableObject



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

def build_thing_product_state_message_with_offline_map_enable
  message_data = {
    offline_map_enable: true
  }

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

#build_thing_product_state_message_with_payloadsObject



308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
# File 'lib/dji_mqtt_connect/factories/state_messages.rb', line 308

def build_thing_product_state_message_with_payloads
  message_data = {
    payloads: [
      {
        control_source: "A",
        payload_index: "80-0-0"
      }
    ]
  }

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

#build_thing_product_state_message_with_rtcm_infoObject



133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# File 'lib/dji_mqtt_connect/factories/state_messages.rb', line 133

def build_thing_product_state_message_with_rtcm_info
  message_data = {
    rtcm_info: {
      host: "192.168.0.1",
      mount_point: "RTCM3X",
      port: "2101",
      rtcm_device_type: 1,
      source_type: 3
    }
  }

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

#build_thing_product_state_message_with_uom_real_name_stateObject



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

def build_thing_product_state_message_with_uom_real_name_state
  message_data = {
    uom_real_name_state: 11
  }

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


358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
# File 'lib/dji_mqtt_connect/factories/state_messages.rb', line 358

def build_thing_product_state_message_with_wireless_link_topo
  message_data = {
    wireless_link_topo: {
      center_node: {
        sdr_id: 836770082,
        sn: "WIRELESSLINK01"
      },
      leaf_nodes: [{
        control_source_index: 1,
        sdr_id: 961551644,
        sn: "LEAFNODE01",

        valid: true
      }, {
        control_source_index: 2,
        sdr_id: 878711578,
        sn: "LEAFNODE02",
        valid: true
      }],
      secret_code: [0, 0, 0, 0, 1, 0, 0, 0, 126, 180, 137, 135, 192, 229, 237, 97, 34, 58, 71, 58, 139, 30, 218, 120, 160, 254, 117, 250]
    }
  }

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

#build_thing_product_state_message_with_wpmz_versionObject



392
393
394
395
396
397
398
399
400
401
402
403
404
405
# File 'lib/dji_mqtt_connect/factories/state_messages.rb', line 392

def build_thing_product_state_message_with_wpmz_version
  message_data = {
    wpmz_version: "1.0.6"
  }

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

#build_thing_proudct_state_message_with_rth_modeObject



328
329
330
331
332
333
334
335
336
337
338
339
340
341
# File 'lib/dji_mqtt_connect/factories/state_messages.rb', line 328

def build_thing_proudct_state_message_with_rth_mode
  message_data = {
    rth_mode: 1
  }

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