Add discovery site and realm into client_certification_tests
@@ -131,6 +131,8 @@ display_menu(void)
PRINT("[20] Send ping message\n");
PRINT("-----------------------------------------------\n");
#endif /* OC_TCP */
+ PRINT("[40] Discover using site local\n");
+ PRINT("[41] Discover using realm local\n");
PRINT("[99] Exit\n");
PRINT("################################################\n");
PRINT("\nSelect option: \n");
@@ -488,6 +490,30 @@ discover_resources(void)
signal_event_loop();
}
+static void
+discover_site_local_resources(void)
+{
+ pthread_mutex_lock(&app_sync_lock);
+ free_all_resources();
+ if (!oc_do_site_local_ipv6_discovery_all(&discovery, NULL)) {
+ PRINT("\nERROR: Could not issue discovery request\n");
+ }
+ pthread_mutex_unlock(&app_sync_lock);
+ signal_event_loop();
+}
+
+static void
+discover_realm_local_resources(void)
+{
+ pthread_mutex_lock(&app_sync_lock);
+ free_all_resources();
+ if (!oc_do_realm_local_ipv6_discovery_all(&discovery, NULL)) {
+ PRINT("\nERROR: Could not issue discovery request\n");
+ }
+ pthread_mutex_unlock(&app_sync_lock);
+ signal_event_loop();
+}
+
#ifdef OC_SECURITY
void
random_pin_cb(const unsigned char *pin, size_t pin_len, void *data)
@@ -699,6 +725,12 @@ main(void)
cloud_send_ping();
break;
#endif /* OC_TCP */
+ case 40:
+ discover_site_local_resources();
+ break;
+ case 41:
+ discover_realm_local_resources();
+ break;
case 99:
handle_signal(0);
break;
