+void connectRequestStatusCallback(std::shared_ptr< ConnectRequestStatus > requestStatus)
+{
+ if(requestStatus->getESResult() != ES_OK)
+ {
+ cout << "Request to connection is failed." << endl;
+ return;
+ }
+ else
+ {
+ cout << "Request to connection is success." << endl;
+ }
+}
+
+void requestToConnect()
+{
+ if(!remoteEnrollee)
+ {
+ std::cout << "RemoteEnrollee is null, retry Discovery EnrolleeResource." << endl;
+ return;
+ }
+
+ try
+ {
+ std::vector<ES_CONNECT_TYPE> types;
+ types.push_back(ES_CONNECT_WIFI);
+ types.push_back(ES_CONNECT_COAPCLOUD);
+ remoteEnrollee->requestToConnect(types, connectRequestStatusCallback);
+ }
+ catch (OCException &e)
+ {
+ std::cout << "Exception during provisionDeviceProperties call" << e.reason();
+ return;
+ }
+}
+