From 1cb4733d9d16055048703fc13a0b83f7db04b192 Mon Sep 17 00:00:00 2001 From: Jay Sharma Date: Mon, 14 Mar 2016 15:57:23 +0530 Subject: [PATCH] [Easy-setup] Updated Doxygen comments - [Enrollee] Moved files from inc to src folder (which are not exposed to developers) Change-Id: I93c3703c39556a2673e034ede4890d1f4ef10b71 Signed-off-by: Jay Sharma Reviewed-on: https://gerrit.iotivity.org/gerrit/5871 Tested-by: jenkins-iotivity Reviewed-by: Madan Lanka --- service/easy-setup/enrollee/inc/easysetup.h | 11 ++--- .../easy-setup/enrollee/{inc => src}/onboarding.h | 24 ++++++++-- .../enrollee/{inc => src}/resourcehandler.h | 0 service/easy-setup/enrollee/{inc => src}/softap.h | 32 ++++++++----- .../easy-setup/enrollee/tizen/wifi/softapnative.h | 20 ++++++--- .../easy-setup/mediator/richsdk/inc/ESException.h | 52 +++++++++++++++++++--- .../easy-setup/mediator/richsdk/inc/EasySetup.h | 3 +- 7 files changed, 109 insertions(+), 33 deletions(-) rename service/easy-setup/enrollee/{inc => src}/onboarding.h (55%) rename service/easy-setup/enrollee/{inc => src}/resourcehandler.h (100%) mode change 100755 => 100644 rename service/easy-setup/enrollee/{inc => src}/softap.h (50%) diff --git a/service/easy-setup/enrollee/inc/easysetup.h b/service/easy-setup/enrollee/inc/easysetup.h index 7de994f..d3d20db 100755 --- a/service/easy-setup/enrollee/inc/easysetup.h +++ b/service/easy-setup/enrollee/inc/easysetup.h @@ -18,17 +18,18 @@ // //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -/** - * @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 diff --git a/service/easy-setup/enrollee/inc/onboarding.h b/service/easy-setup/enrollee/src/onboarding.h similarity index 55% rename from service/easy-setup/enrollee/inc/onboarding.h rename to service/easy-setup/enrollee/src/onboarding.h index 715ca96..ce3bc87 100644 --- a/service/easy-setup/enrollee/inc/onboarding.h +++ b/service/easy-setup/enrollee/src/onboarding.h @@ -18,6 +18,7 @@ // //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + #ifndef EASYSETUP_ENROLLEE_ONBOARDING_H__ #define EASYSETUP_ENROLLEE_ONBOARDING_H__ @@ -28,18 +29,33 @@ extern "C" { #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(); diff --git a/service/easy-setup/enrollee/inc/resourcehandler.h b/service/easy-setup/enrollee/src/resourcehandler.h old mode 100755 new mode 100644 similarity index 100% rename from service/easy-setup/enrollee/inc/resourcehandler.h rename to service/easy-setup/enrollee/src/resourcehandler.h diff --git a/service/easy-setup/enrollee/inc/softap.h b/service/easy-setup/enrollee/src/softap.h similarity index 50% rename from service/easy-setup/enrollee/inc/softap.h rename to service/easy-setup/enrollee/src/softap.h index 60080d4..3ae3c51 100644 --- a/service/easy-setup/enrollee/inc/softap.h +++ b/service/easy-setup/enrollee/src/softap.h @@ -18,42 +18,52 @@ // //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + #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); diff --git a/service/easy-setup/enrollee/tizen/wifi/softapnative.h b/service/easy-setup/enrollee/tizen/wifi/softapnative.h index 35c3773..a72410e 100644 --- a/service/easy-setup/enrollee/tizen/wifi/softapnative.h +++ b/service/easy-setup/enrollee/tizen/wifi/softapnative.h @@ -18,11 +18,7 @@ // //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -/** - * @file - * - * This file contains the API declaration for creating & configuration for SoftAP - */ + #ifndef EASYSETUP_ENROLLEE_SOFTAP_H__ #define EASYSETUP_ENROLLEE_SOFTAP_H__ @@ -35,10 +31,24 @@ extern "C" { #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); diff --git a/service/easy-setup/mediator/richsdk/inc/ESException.h b/service/easy-setup/mediator/richsdk/inc/ESException.h index 78723d8..d5096bf 100644 --- a/service/easy-setup/mediator/richsdk/inc/ESException.h +++ b/service/easy-setup/mediator/richsdk/inc/ESException.h @@ -18,17 +18,17 @@ // //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -/** - * @file - * - * This file contains the declaration of exception classes for easy setup - */ + #ifndef EASY_SETUP_EXCEPTION_H #define EASY_SETUP_EXCEPTION_H #include #include - +/** + * @file + * + * This file contains the declaration of exception classes for easy setup + */ namespace OIC { namespace Service @@ -81,6 +81,12 @@ namespace OIC class ESPlatformException: public ESException { public: + + /** + * Constructs an exception with a description. + * + * @param OCStackResult The description for the error. + */ explicit ESPlatformException(OCStackResult reason); /** @@ -90,7 +96,7 @@ namespace OIC OCStackResult getReasonCode() const; /** - * Returns the reason description. + * This function returns description of the exception. * */ std::string getReason() const; @@ -106,7 +112,15 @@ namespace OIC 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); }; @@ -117,7 +131,15 @@ namespace OIC 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); }; @@ -127,7 +149,15 @@ namespace OIC 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); }; @@ -138,7 +168,15 @@ namespace OIC 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); }; } diff --git a/service/easy-setup/mediator/richsdk/inc/EasySetup.h b/service/easy-setup/mediator/richsdk/inc/EasySetup.h index 9cc10d7..b7914f4 100644 --- a/service/easy-setup/mediator/richsdk/inc/EasySetup.h +++ b/service/easy-setup/mediator/richsdk/inc/EasySetup.h @@ -51,7 +51,8 @@ namespace OIC /** * 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. -- 2.7.4