Skip to content

Commit

Permalink
java/iot3examples: add check for secured connection
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieu1fb committed Oct 24, 2024
1 parent 845c180 commit de073f8
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ public void mqttUnsubscriptionComplete(Throwable unsubscribeFailure) {
}

private static void onConnectionComplete() {
// Check if MQTT connection is secured
if(ioT3Core.isMqttConnectionSecured()) System.out.println("MQTT connection is SECURED");
else System.out.println("MQTT connection is NOT SECURED");
// subscribe to the root test topic and to all iot3 topics using the wildcard #
ioT3Core.mqttSubscribe("test");
ioT3Core.mqttSubscribe("test/iot3/#");
Expand Down

0 comments on commit de073f8

Please sign in to comment.