//
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-/**
- * @file
- *
- * This file contains SDK APIs for device operating in Enrollee Mode of EasySetup
- */
#ifndef EASYSETUP_ENROLLEE_H__
#define EASYSETUP_ENROLLEE_H__
#include "escommon.h"
+/**
+ * @file
+ *
+ * This file contains Enrollee APIs
+ */
+
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
//
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
#ifndef EASYSETUP_ENROLLEE_ONBOARDING_H__
#define EASYSETUP_ENROLLEE_ONBOARDING_H__
#include "networkhandler.h"
/**
- * It will on-board the Enrollee device. This is a template method that has
- * core business logic & negotiation algorithm on various on-boarding methods.
+ * @file
+ *
+ * This file contains APIs to on-board ( connect ) Enrollee device into Ad-hoc network
+ * @Note : Some of the APIs of this file need to be modified by the OEM according to the device configuration
*/
+
+/**
+ * This function on-board Enrollee device onto ad-hoc network.
+ * @param ssid SSID of the target SoftAP network to which the Enrollee is connecting.
+ * @param passwd Password of the target SoftAP network to which the Enrollee is connecting.
+ * @param NetworkEventCallback Callback function for result update
+ * @return ::True, if on-boarding is successful.
+ */
+
bool ESOnboard(const char * ssid, const char* passwd, NetworkEventCallback cb);
/**
- * It will return true on-boarding type is soft AP.
+ * This function verify if the on-boarding is through SoftAP.
+ * @return ::True, if Soft AP on-boarding enabled.
+ * @Note : This API to be modified by the OEM according to the device configuration
*/
bool ESSoftapOnboarding();
/**
- * It will return true on-boarding type is BLE.
+ * This function verify if the on-boarding is through Ble beacons.
+ * @return ::True, if Ble beacons enabled.
+ * @Note : This API to be modified by the OEM according to the device configuration
*/
bool ESBleOnboarding();
//
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
#ifndef EASYSETUP_ENROLLEE_SOFTAP_H__
#define EASYSETUP_ENROLLEE_SOFTAP_H__
#include "escommon.h"
#include "networkhandler.h"
-//#ifdef __cplusplus
-//extern "C" {
-//#endif // __cplusplus
-
/**
* @file
*
- * This file contains the configuration for SoftAP
+ * This file contains platform agnostic API for creation of Soft AP
+ * @Note : Some of the APIs of this file need to be modified by the OEM according to the device configuration
*/
/**
- * It will return true if the Soft AP is created at Enrollee device
+ * This function verify if the Soft AP is created at Enrollee device.
+ * @return ::True, if Soft AP is created at Enrollee device.
+ * @Note : This API needs to be modified by the OEM according to the device configuration
*/
-bool ESSoftapAtEnrollee();
+bool ESSoftapAtEnrollee();
/**
- * It will return true if the Soft AP is created at Mediator device
+ * This function verify if the Soft AP is created at Mediator device.
+ * @return ::True, if Soft AP is created at Mediator device.
+ * @Note : This API needs to be modified by the OEM according to the device configuration
*/
bool ESSoftapAtMediator();
+
/**
- * It will return Device which is creating Soft AP ; Devices are identified by their role
- * i.e. Enrollee or Mediator.
+ * This function finds which Device (Enrollee or Mediator) is creating Soft AP.
+ * @return ::DeviceRole (ENROLLEE or MEDIATOR)
+ * @Note : This API needs to be modified by the OEM according to the device configuration
*/
+
DeviceRole ESSoftapHost();
/**
- * Handle Soft AP creation
+ * This function Initializes the EasySetup. This API must be called prior to invoking any other API
+ *
+ * @param ssid SSID of the target SoftAP network to which the Enrollee is connecting.
+ * @param passwd Password of the target SoftAP network to which the Enrollee is connecting
+ * @param NetworkEventCallback Callback function for result update
+ * @return ::void.
*/
void ESCreateSoftap(const char * ssid, const char* passwd, NetworkEventCallback cb);
//
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-/**
- * @file
- *
- * This file contains the API declaration for creating & configuration for SoftAP
- */
+
#ifndef EASYSETUP_ENROLLEE_SOFTAP_H__
#define EASYSETUP_ENROLLEE_SOFTAP_H__
#define SOFTAP_SUCCESS 1
#define SOFTAP_FAILED 0
+/**
+ * @file
+ *
+ * This file contains the API declaration for creating & configuration for SoftAP
+ */
//This callback signagure may get changed as per the native implementation.
typedef void (*SoftAPCallbackNative)(int result, const char *ip, const char* mac_addr,
const char*device_name);
+/**
+ * This API creats the Soft AP using the platform specific native system calls.
+ * @Note This API to be implemented by the OEM if Enrollee device SoC supports SoftAP
+ *
+ * @param networkType NetworkType on which OnBoarding has to be performed.
+ * @param ssid SSID of the target SoftAP network to which the Enrollee is connecting.
+ * @param passwd Password of the target SoftAP network to which the Enrollee is connecting
+ * @param SoftAPCallbackNative EventCallback for for updating the Enrollee OnBoarding status result to the application
+ */
void ESCreateSoftapNative(const char * ssid, const char* passwd, SoftAPCallbackNative cb);
//
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-/**
- * @file
- *
- * This file contains the declaration of exception classes for easy setup
- */
+
#ifndef EASY_SETUP_EXCEPTION_H
#define EASY_SETUP_EXCEPTION_H
#include <string>
#include <octypes.h>
-
+/**
+ * @file
+ *
+ * This file contains the declaration of exception classes for easy setup
+ */
namespace OIC
{
namespace Service
class ESPlatformException: public ESException
{
public:
+
+ /**
+ * Constructs an exception with a description.
+ *
+ * @param OCStackResult The description for the error.
+ */
explicit ESPlatformException(OCStackResult reason);
/**
OCStackResult getReasonCode() const;
/**
- * Returns the reason description.
+ * This function returns description of the exception.
*
*/
std::string getReason() const;
class ESBadRequestException: public ESException
{
public:
+ /**
+ * Constructs an exception with a description.
+ *
+ * @param OCStackResult The description for the error.
+ */
explicit ESBadRequestException(const std::string& what);
+ /**
+ * @overload
+ */
explicit ESBadRequestException(std::string&& what);
};
class ESInvalidParameterException: public ESException
{
public:
+ /**
+ * Constructs an exception with a description.
+ *
+ * @param OCStackResult The description for the error.
+ */
explicit ESInvalidParameterException(const std::string& what);
+ /**
+ * @overload
+ */
explicit ESInvalidParameterException(std::string&& what);
};
class ESBadGetException: public ESException
{
public:
+ /**
+ * Constructs an exception with a description.
+ *
+ * @param OCStackResult The description for the error.
+ */
explicit ESBadGetException(const std::string& what);
+ /**
+ * @overload
+ */
explicit ESBadGetException(std::string&& what);
};
class ESInvalidKeyException: public ESException
{
public:
+ /**
+ * Constructs an exception with a description.
+ *
+ * @param OCStackResult The description for the error.
+ */
explicit ESInvalidKeyException(const std::string& what);
+ /**
+ * @overload
+ */
explicit ESInvalidKeyException(std::string&& what);
};
}
/**
* This API is used for creating a remote Enrollee device instance.
- * @param enrolleeNWProvIndo Provisioning information for configuring the Enrollee.
+ * @param ProvConfig Provisioning information for configuring the Enrollee.
+ * @param WiFiOnboadingConnection Onboarding connection information for configuring the Enrollee.
*
* @throws ESBadRequestException If createEnrolleeDevice is invoked with the same
* provisioning information.