Skip to content

Commit

Permalink
Read in the streaming options from the QR Code MQTT settings
Browse files Browse the repository at this point in the history
  • Loading branch information
christianrowlands committed Jul 30, 2024
1 parent 07b9866 commit 292d0b2
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 12 deletions.
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
</a>
</p>

The Network Survey Android App provides a basic survey capability for logging and analyzing
Cellular networks, Wi-Fi networks, Bluetooth Devices, and GNSS constellations. Capture detailed
records of signal strength, network information, and device data. All data can be conveniently
logged to GeoPackage or CSV files for offline analysis. Alternatively, choose to live stream the
The Network Survey Android App provides a basic survey capability for logging and analyzing
Cellular networks, Wi-Fi networks, Bluetooth Devices, and GNSS constellations. Capture detailed
records of signal strength, network information, and device data. All data can be conveniently
logged to GeoPackage or CSV files for offline analysis. Alternatively, choose to live stream the
data via MQTT or gRPC protocols for real-time monitoring and integration with other systems.

The Network Survey user manual can be found [here](https://networksurvey.app/manual).
Expand Down Expand Up @@ -63,8 +63,8 @@ If you're interested in CDR logging that includes SMS events and call details:

## Tracking And Privacy

The version of this app on the Play Store has Firebase Crashlytics and Analytics set up. This means
that app crash logs and analytics are sent off the device to Firebase. If you don't want to
The version of this app on the Play Store has Firebase Crashlytics and Analytics set up. This means
that app crash logs and analytics are sent off the device to Firebase. If you don't want to
participate in this type of tracking then you have three options.

1. Install the app
Expand All @@ -89,8 +89,8 @@ If you want to build using the command line, the apk can be built and installed
commands. Make sure your phone is connected to your computer before running the install command.

There are two build variants available for this app. The default build variant is the regular
version of the app which is the "Google Play" version. As noted in the privacy section, the
"Google Play" version has Firebase Crashlytics and Analytics enabled. The second build variant is
version of the app which is the "Google Play" version. As noted in the privacy section, the
"Google Play" version has Firebase Crashlytics and Analytics enabled. The second build variant is
the "CDR" version. The "CDR" version does not have Firebase Crashlytics and Analytics enabled, and
it has the extended CDR logging features (as discussed above).

Expand Down Expand Up @@ -174,7 +174,9 @@ you can use the `mqtt_topic_prefix` field to change the topic to something like
"mqtt_port": 8883,
"mqtt_client": "aclient",
"mqtt_tls": true,
"mqtt_topic_prefix": "my/custom/topic/path/"
"mqtt_topic_prefix": "my/custom/topic/path/",
"cellular_stream_enabled": true,
"wifi_stream_enabled": true
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,14 @@ public class CodeScannerFragment extends Fragment
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState)
{
final Activity activity = getActivity();
View root = inflater.inflate(R.layout.fragment_scanner, container, false);

final Activity activity = getActivity();
if (activity == null) return null;

CodeScannerView scannerView = root.findViewById(R.id.scanner_view);
codeScanner = new CodeScanner(activity, scannerView);
codeScanner.setDecodeCallback(result -> activity.runOnUiThread(() -> {

if (!result.getText().isEmpty())
{
try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public record MqttConnectionSettings(
@SerializedName("wifi_stream_enabled") Boolean wifiStreamEnabled,
@SerializedName("bluetooth_stream_enabled") Boolean bluetoothStreamEnabled,
@SerializedName("gnss_stream_enabled") Boolean gnssStreamEnabled,
@SerializedName("device_status_stream_enabled") Boolean deviceStatusStreamEnabled // TODO Handle these fields in the QR Code scanner
@SerializedName("device_status_stream_enabled") Boolean deviceStatusStreamEnabled
) implements Serializable
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,26 @@ public static void populatePrefsFromMqttConnectionSettings(MqttConnectionSetting
{
edit.putString(MqttConstants.PROPERTY_MQTT_TOPIC_PREFIX, mqttConnectionSettings.mqttTopicPrefix());
}
if (mqttConnectionSettings.cellularStreamEnabled() != null)
{
edit.putBoolean(NetworkSurveyConstants.PROPERTY_MQTT_CELLULAR_STREAM_ENABLED, mqttConnectionSettings.cellularStreamEnabled());
}
if (mqttConnectionSettings.wifiStreamEnabled() != null)
{
edit.putBoolean(NetworkSurveyConstants.PROPERTY_MQTT_WIFI_STREAM_ENABLED, mqttConnectionSettings.wifiStreamEnabled());
}
if (mqttConnectionSettings.bluetoothStreamEnabled() != null)
{
edit.putBoolean(NetworkSurveyConstants.PROPERTY_MQTT_BLUETOOTH_STREAM_ENABLED, mqttConnectionSettings.bluetoothStreamEnabled());
}
if (mqttConnectionSettings.gnssStreamEnabled() != null)
{
edit.putBoolean(NetworkSurveyConstants.PROPERTY_MQTT_GNSS_STREAM_ENABLED, mqttConnectionSettings.gnssStreamEnabled());
}
if (mqttConnectionSettings.deviceStatusStreamEnabled() != null)
{
edit.putBoolean(NetworkSurveyConstants.PROPERTY_MQTT_DEVICE_STATUS_STREAM_ENABLED, mqttConnectionSettings.deviceStatusStreamEnabled());
}

edit.apply();
}
Expand Down

0 comments on commit 292d0b2

Please sign in to comment.