From cc93d9cdcc0b0fd7aebb648b7a578f27352d1e8d Mon Sep 17 00:00:00 2001 From: sergiu Date: Thu, 13 Jan 2022 17:58:18 +0200 Subject: [PATCH 1/2] Call moveToChannel callback only if exists --- config/dev/default.toml | 9 +++++++-- src/asset.js | 7 +++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/config/dev/default.toml b/config/dev/default.toml index d7a52db..18d2890 100644 --- a/config/dev/default.toml +++ b/config/dev/default.toml @@ -17,8 +17,8 @@ accept_untrusted_certs = true [settings] max_fails = 3 send_voice = true -send_gps = true -send_group_monitoring_before_each_call = false +send_gps = 'true' +send_group_monitoring_before_each_call = 'true' gps_report_interval = 10000 # The interval in which the GPS is sent gps_lat_start_point = 46.217802 gps_lng_start_point = 24.776126 @@ -26,6 +26,11 @@ delay_between_clients = 300 testing_duration = 600 # seconds [assets] + +#ids = [ +# 5488, 5489, 5490, 5491, 5492, 5493, 5494, 5495, 5496, 5497, 5498, 5499, 5500, 5501, 5502 +#] + ids = [ 5488 ] diff --git a/src/asset.js b/src/asset.js index f182933..fcd5693 100644 --- a/src/asset.js +++ b/src/asset.js @@ -251,7 +251,6 @@ class Asset { } _moveToChannel(callback) { - console.log('_moveToChannel') Request.post( this.apiEndpoint + '/audio/enter-group/' + this.id + '/' + this.groupId, { @@ -277,9 +276,9 @@ class Asset { } )); utils.writeLog(`Asset ${this.id} mmonitoring group ${this.groupId}`) - return callback(); + if (callback) return callback(); } else { - return callback('Cannot send group-monitoring: Hub not connected'); + if (callback) return callback('Cannot send group-monitoring: Hub not connected'); } } else { console.log('_moveToChannel--------------------') @@ -376,7 +375,7 @@ class Asset { _makePtt(callback) { // Sending group monitoring before we make PTT() // Is used for the HUB load test(_moveToChannel is sent anyway after connecting to murmur-register) - if (this.configs.settings.send_group_monitoring_before_each_call) { + if (this.configs.settings.send_group_monitoring_before_each_call == 'true') { this._moveToChannel(); } -- 2.37.1 From b2caaede60db0896fe33c3341a5391ea52118b61 Mon Sep 17 00:00:00 2001 From: sergiu Date: Wed, 16 Mar 2022 10:25:35 +0200 Subject: [PATCH 2/2] LAPI-633: Added functionality to simulate only GPS --- config/dev/default.toml | 8 ++++---- src/asset.js | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/config/dev/default.toml b/config/dev/default.toml index 18d2890..bc956c6 100644 --- a/config/dev/default.toml +++ b/config/dev/default.toml @@ -16,10 +16,10 @@ accept_untrusted_certs = true [settings] max_fails = 3 -send_voice = true -send_gps = 'true' +send_voice = false +send_gps = true send_group_monitoring_before_each_call = 'true' -gps_report_interval = 10000 # The interval in which the GPS is sent +gps_report_interval = 300 # The interval in which the GPS is sent gps_lat_start_point = 46.217802 gps_lng_start_point = 24.776126 delay_between_clients = 300 @@ -32,7 +32,7 @@ testing_duration = 600 # seconds #] ids = [ - 5488 + 1868 ] [sounds] diff --git a/src/asset.js b/src/asset.js index fcd5693..f498852 100644 --- a/src/asset.js +++ b/src/asset.js @@ -498,7 +498,6 @@ class Asset { _sendGPS(callback) { let hub = this.hub; if (hub && hub.connected) { - let lat = this.configs.settings.gps_lat_start_point; let lng = this.configs.settings.gps_lng_start_point; @@ -521,7 +520,9 @@ class Asset { )); lat = new_lat; lng = new_lng; - + if (!this.configs.settings.send_voice) { + this._start(); + } }, this.configs.settings.gps_report_interval); } } -- 2.37.1