static OCConnectivityType OC_CONNTYPE = CT_IP_USE_V4;
static OCConnectivityType OC_CONNTYPE_BLE = CT_ADAPTER_GATT_BTLE;
-static const char * UNICAST_PROVISIONING_QUERY = "coap://%s:%d/oic/res?rt=oic.prov";
+static const char * UNICAST_PROVISIONING_QUERY = "coap://%s:%d/oic/res?rt=oic.r.prov";
static const char * UNICAST_PROV_STATUS_QUERY = "coap://%s:%d%s";
/**
sprintf(g_prov.tnn, "Unknown");
sprintf(g_prov.cd, "Unknown");
- OCStackResult res = OCCreateResource(&g_prov.handle, "oic.prov", OC_RSRVD_INTERFACE_DEFAULT,
+ OCStackResult res = OCCreateResource(&g_prov.handle, "oic.r.prov", OC_RSRVD_INTERFACE_DEFAULT,
OC_RSRVD_ES_URI_PROV, OCEntityHandlerCb, NULL, OC_DISCOVERABLE | OC_OBSERVABLE);
OC_LOG_V(INFO, TAG, "Created Prov resource with result: %s", getResult(res));
OC_LOG_V(INFO, TAG, "SSID: %s", g_net.cnn);
OC_LOG_V(INFO, TAG, "IP Address: %s", g_net.ipaddr);
- OCStackResult res = OCCreateResource(&g_net.handle, "oic.net", OC_RSRVD_INTERFACE_DEFAULT,
+ OCStackResult res = OCCreateResource(&g_net.handle, "oic.r.net", OC_RSRVD_INTERFACE_DEFAULT,
OC_RSRVD_ES_URI_NET, OCEntityHandlerCb,NULL, OC_DISCOVERABLE | OC_OBSERVABLE);
OC_LOG_V(INFO, TAG, "Created Net resource with result: %s", getResult(res));
OCStackResult StartProvisioning(const EnrolleeNWProvInfo_t *netInfo) {
char findQuery[64] = {0};
-
- if (netInfo->connType == CT_IP_USE_V4) {
- snprintf(findQuery, sizeof(findQuery), UNICAST_PROVISIONING_QUERY,
- netInfo->netAddressInfo.WIFI.ipAddress, IP_PORT);
- }
+ snprintf(findQuery, sizeof(findQuery) - 1, UNICAST_PROVISIONING_QUERY,
+ netInfo->netAddressInfo.WIFI.ipAddress, IP_PORT);
return StartProvisioningProcess(netInfo, cbData, findQuery);
}
return result;
}
+
return OC_STACK_ERROR;
}
- pthread_join(thread_handle, NULL);
-
- ResetProgress();
-
return OC_STACK_OK;
}
OCStackResult result = OC_STACK_ERROR;
- strncpy(szFindResourceQueryUri, findResQuery, sizeof(szFindResourceQueryUri, findResQuery) - 1);
-
+ snprintf(szFindResourceQueryUri, sizeof(szFindResourceQueryUri) - 1, findResQuery);
char *string = "Starting provisioning process ";
pthread_t thread_handle;