IoTivity C++ SDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OC::OCSecure Class Reference

Static Public Member Functions

static OCStackResult provisionInit (const std::string &dbPath)
 The API is responsible for initialization of the provisioning manager. More...
 
static OCStackResult provisionClose ()
 This method is used by provisioning manager to close provisioning database. More...
 
static OCStackResult discoverUnownedDevices (unsigned short timeout, DeviceList_t &list)
 API is responsible for discovery of devices in it's subnet. More...
 
static OCStackResult discoverOwnedDevices (unsigned short timeout, DeviceList_t &list)
 API is responsible for discovery of devices in it's subnet. More...
 
static OCStackResult discoverSingleDevice (unsigned short timeout, const OicUuid_t *deviceID, std::shared_ptr< OCSecureResource > &foundDevice)
 API is responsible for discovery of devices in specified endpoint/deviceID. More...
 
static OCStackResult setOwnerTransferCallbackData (OicSecOxm_t oxm, OTMCallbackData_t *callbackData, InputPinCallback inputPin)
 API for registering Ownership transfer methods for a particular transfer Type. More...
 
static OCStackResult discoverSingleDeviceInUnicast (unsigned short timeout, const OicUuid_t *deviceID, const std::string &hostAddress, OCConnectivityType connType, std::shared_ptr< OCSecureResource > &foundDevice)
 API is responsible for discovery of devices in specified endpoint/deviceID. More...
 
static OCStackResult setInputPinCallback (InputPinCallback inputPin)
 API for registering a pin input callback. More...
 
static OCStackResult unsetInputPinCallback ()
 API for de-registering a pin callback. More...
 
static OCStackResult registerInputPinCallback (InputPinCB inputPinCB, InputPinCallbackHandle *inputPinCallbackHandle)
 API to register for a callback to input a pin. More...
 
static OCStackResult deregisterInputPinCallback (InputPinCallbackHandle inputPinCallbackHandle)
 API to de-register the callback to input a pin. More...
 
static OCStackResult setDisplayPinCB (GeneratePinCallback displayPin)
 API to register a callback to display the stack generated PIN. More...
 
static OCStackResult unsetDisplayPinCB ()
 API for de-registering the display pin callback. More...
 
static OCStackResult setRandomPinPolicy (size_t pinSize, OicSecPinType_t pinType)
 API to set Pin Type policy. More...
 
static OCStackResult registerDisplayPinCallback (DisplayPinCB displayPinCB, DisplayPinCallbackHandle *displayPinCallbackHandle)
 API to register for a callback to display a pin. More...
 
static OCStackResult deregisterDisplayPinCallback (DisplayPinCallbackHandle displayPinCallbackHandle)
 API to de-register the callback to display a pin. More...
 
static OCStackResult getDevInfoFromNetwork (unsigned short timeout, DeviceList_t &ownedDevList, DeviceList_t &unownedDevList)
 API to get status of all the devices in current subnet. More...
 
static OCStackResult removeDeviceWithUuid (unsigned short waitTimeForOwnedDeviceDiscovery, std::string uuid, ResultCallBack resultCallback)
 API to remove device credential and ACL from all devices in subnet. More...
 
static OCStackResult saveACL (const OicSecAcl_t *acl)
 API to save ACL which has several ACE into Acl of SVR. More...
 
static OCStackResult registerDisplayNumCallback (DisplayNumCB displayNumCB)
 api to register Callback for displaying verifNum in verification Just-Works More...
 
static OCStackResult deregisterDisplayNumCallback ()
 API to De-register Callback for displaying verifNum in verification Just-Works. More...
 
static OCStackResult registerUserConfirmCallback (UserConfirmNumCB userConfirmCB)
 API to reister Callback for getting user confirmation in verification Just-Works. More...
 
static OCStackResult deregisterUserConfirmCallback ()
 API to De-register Callback for getting user confirmation in verification Just-Works. More...
 
static OCStackResult setVerifyOptionMask (VerifyOptionBitmask_t optionMask)
 Set option for Mutual Verified Just-Works The default is both display PIN and get user confirmation. More...
 
static OCStackResult pdmCleanupForTimeout ()
 API to cleanup PDM in case of timeout. More...
 
static OCStackResult configSelfOwnership ()
 This function configures SVR DB as self-ownership. More...
 

Member Function Documentation

static OCStackResult OC::OCSecure::configSelfOwnership ( )
static

This function configures SVR DB as self-ownership.

Returns
OC_STACK_OK in case of successful configue and other value otherwise.
static OCStackResult OC::OCSecure::deregisterDisplayNumCallback ( )
static

API to De-register Callback for displaying verifNum in verification Just-Works.

Returns
OC_STACK_OK in case of success and other value otherwise.
static OCStackResult OC::OCSecure::deregisterDisplayPinCallback ( DisplayPinCallbackHandle  displayPinCallbackHandle)
static

API to de-register the callback to display a pin.

Parameters
displayPinCallbackHandleHandle used to deregister the callback.
Returns
OC_STACK_OK in case of success and other value otherwise.
static OCStackResult OC::OCSecure::deregisterInputPinCallback ( InputPinCallbackHandle  inputPinCallbackHandle)
static

API to de-register the callback to input a pin.

Parameters
inputPinCallbackHandleHandle specifying which callback to deregister.
Returns
OC_STACK_OK in case of success and other value otherwise.
static OCStackResult OC::OCSecure::deregisterUserConfirmCallback ( )
static

API to De-register Callback for getting user confirmation in verification Just-Works.

Returns
OC_STACK_OK in case of success and other value otherwise.
static OCStackResult OC::OCSecure::discoverOwnedDevices ( unsigned short  timeout,
DeviceList_t list 
)
static

API is responsible for discovery of devices in it's subnet.

It will list all the device in subnet which are already owned by calling provisioning client.

Parameters
timeoutTimeout in seconds, time until which function will listen to responses from server before returning the list of devices.
listList of owned devices.
Returns
OC_STACK_OK in case of success and other value otherwise.
static OCStackResult OC::OCSecure::discoverSingleDevice ( unsigned short  timeout,
const OicUuid_t *  deviceID,
std::shared_ptr< OCSecureResource > &  foundDevice 
)
static

API is responsible for discovery of devices in specified endpoint/deviceID.

And this function will only return the specified device's response.

Parameters
timeoutTimeout in seconds, time until which function will listen to responses from server before returning the specified device.
deviceIDdeviceID of target device
foundDeviceOCSecureResource object of found device.
Returns
OC_STACK_OK in case of success and other value otherwise.
OC_STACK_INVALID_PARAM when deviceID is NULL or ppFoundDevice is not initailized.
static OCStackResult OC::OCSecure::discoverSingleDeviceInUnicast ( unsigned short  timeout,
const OicUuid_t *  deviceID,
const std::string &  hostAddress,
OCConnectivityType  connType,
std::shared_ptr< OCSecureResource > &  foundDevice 
)
static

API is responsible for discovery of devices in specified endpoint/deviceID.

And this function will only return the specified device's response.

Parameters
timeoutTimeout in seconds, time until which function will listen to responses from server before returning the specified device.
deviceIDdeviceID of target device.
hostAddressMAC address of target device.
connTypeConnectivityType for discovery.
foundDeviceOCSecureResource object of found device.
Returns
OC_STACK_OK in case of success and other value otherwise. OC_STACK_INVALID_PARAM when deviceID is NULL or ppFoundDevice is not initailized.
static OCStackResult OC::OCSecure::discoverUnownedDevices ( unsigned short  timeout,
DeviceList_t list 
)
static

API is responsible for discovery of devices in it's subnet.

It will list all the device in subnet which are not yet owned.

Parameters
timeoutTimeout in seconds, time until which function will listen to responses from server before returning the list of devices.
listList of candidate devices to be provisioned.
Returns
OC_STACK_OK in case of success and other value otherwise.
static OCStackResult OC::OCSecure::getDevInfoFromNetwork ( unsigned short  timeout,
DeviceList_t ownedDevList,
DeviceList_t unownedDevList 
)
static

API to get status of all the devices in current subnet.

The status include endpoint information and doxm information which can be extracted during owned and unowned discovery. Along with this information, API will provide information about devices' status. Device can have following states

  • ON/OFF: Device is switched on or off.
Parameters
timeoutWait time for the API.
ownedDevListList of owned devices.
unownedDevListList of unowned devices.
Returns
OC_STACK_OK in case of success and other value otherwise.
static OCStackResult OC::OCSecure::pdmCleanupForTimeout ( )
static

API to cleanup PDM in case of timeout.

It will remove the PDM_DEVICE_INIT state devices from PDM.

Returns
OC_STACK_OK in case of success and other value otherwise.
static OCStackResult OC::OCSecure::provisionClose ( )
static

This method is used by provisioning manager to close provisioning database.

See Also
OCSecure::provisionInit()
Returns
OC_STACK_OK in case of success and other value otherwise.
static OCStackResult OC::OCSecure::provisionInit ( const std::string &  dbPath)
static

The API is responsible for initialization of the provisioning manager.

It will load provisioning database which have owned device's list and their linked status.

See Also
OCSecure::provisionClose()
Parameters
dbPathfile path of the sqlite3 database.
Returns
OC_STACK_OK in case of success and other value otherwise.
static OCStackResult OC::OCSecure::registerDisplayNumCallback ( DisplayNumCB  displayNumCB)
static

api to register Callback for displaying verifNum in verification Just-Works

Parameters
displayNumCBCallback which is to be registered.
Returns
OC_STACK_OK in case of success and other value otherwise.
static OCStackResult OC::OCSecure::registerDisplayPinCallback ( DisplayPinCB  displayPinCB,
DisplayPinCallbackHandle displayPinCallbackHandle 
)
static

API to register for a callback to display a pin.

Only one display pin callback is allowed to be registered at a time by setDisplayPinCB and registerDisplayPinCallback. Use deregisterDisplayPinCallback to unregister a callback set by registerDisplayPinCallback.

Parameters
displayPinCBCallback which is to be registered.
displayPinCallbackHandlePointer to a handle that can be used to deregister the callback.
Returns
OC_STACK_OK in case of success and other value otherwise. OC_STACK_INVALID_CALLBACK if displayPinCB is invalid. OC_STACK_INVALID_PARAM if displayPinCallbackHandle is invalid. OC_STACK_DUPLICATE_REQUEST if a display pin callback has already been set.
static OCStackResult OC::OCSecure::registerInputPinCallback ( InputPinCB  inputPinCB,
InputPinCallbackHandle inputPinCallbackHandle 
)
static

API to register for a callback to input a pin.

Only one input pin callback is allowed to be registered at a time by setInputPinCallback and registerInputPinCallback. Use deregisterInputPinCallback to unregister a callback set by registerInputPinCallback.

Parameters
inputPinCBCallback which is to be registered.
inputPinCallbackHandlePointer to a handle that can be used to deregister the callback.
Returns
OC_STACK_OK in case of success and other values otherwise. OC_STACK_INVALID_CALLBACK if inputPinCB is invalid. OC_STACK_INVALID_PARAM if inputPinCallbackHandle is invalid. OC_STACK_DUPLICATE_REQUEST if an input pin callback has already been set.
static OCStackResult OC::OCSecure::registerUserConfirmCallback ( UserConfirmNumCB  userConfirmCB)
static

API to reister Callback for getting user confirmation in verification Just-Works.

Parameters
userConfirmCBCallback which is to be registered.
Returns
OC_STACK_OK in case of success and other value otherwise.
static OCStackResult OC::OCSecure::removeDeviceWithUuid ( unsigned short  waitTimeForOwnedDeviceDiscovery,
std::string  uuid,
ResultCallBack  resultCallback 
)
static

API to remove device credential and ACL from all devices in subnet.

Parameters
resultCallbackCallback provided by API user, callback will be called when credential revocation is finished.
uuidDevice uuid to be revoked.
waitTimeForOwnedDeviceDiscoveryMaximum wait time for owned device discovery in seconds.
Returns
OC_STACK_OK in case of success and other value otherwise.
static OCStackResult OC::OCSecure::saveACL ( const OicSecAcl_t *  acl)
static

API to save ACL which has several ACE into Acl of SVR.

Parameters
aclACL to be saved in Acl of SVR.
Returns
OC_STACK_OK in case of success and other value otherwise.
static OCStackResult OC::OCSecure::setDisplayPinCB ( GeneratePinCallback  displayPin)
static

API to register a callback to display the stack generated PIN.

Only one display pin callback is allowed to be registered at a time by setDisplayPinCB and registerDisplayPinCallback. Use unsetDisplayPinCB to unregister a callback set by setDisplayPinCB.

Deprecated:
Use registerDisplayPinCallback instead.
Parameters
displayPinCallback method to display a generated pin.
Returns
OC_STACK_OK in case of success and other value otherwise. OC_STACK_INVALID_CALLBACK if displayPin is invalid. OC_STACK_DUPLICATE_REQUEST if a display pin callback has already been set.
static OCStackResult OC::OCSecure::setInputPinCallback ( InputPinCallback  inputPin)
static

API for registering a pin input callback.

Only one input pin callback is allowed to be registered at a time by setInputPinCallback and registerInputPinCallback. Use unsetInputPinCallback to unregister a callback set by setInputPinCallback.

Deprecated:
Use registerInputPinCallback instead.
Parameters
inputPininputPin callback function.
Returns
OC_STACK_OK in case of success and other value otherwise. OC_STACK_INVALID_CALLBACK if inputPin is invalid. OC_STACK_DUPLICATE_REQUEST if an input pin callback has already been set.
static OCStackResult OC::OCSecure::setOwnerTransferCallbackData ( OicSecOxm_t  oxm,
OTMCallbackData_t *  callbackData,
InputPinCallback  inputPin 
)
static

API for registering Ownership transfer methods for a particular transfer Type.

Deprecated:
Use setInputPinCallback to set input pin callback value.
Parameters
oxmOwnership transfer method.
callbackDataCallbackData Methods for ownership transfer.
inputPinCallback method to input pin for verification.
Returns
OC_STACK_OK in case of success and other value otherwise.
static OCStackResult OC::OCSecure::setRandomPinPolicy ( size_t  pinSize,
OicSecPinType_t  pinType 
)
static

API to set Pin Type policy.

Parameters
pinSizepin Size
pinTypeType of the pin.
Returns
OC_STACK_OK in case of success and other value otherwise.
static OCStackResult OC::OCSecure::setVerifyOptionMask ( VerifyOptionBitmask_t  optionMask)
static

Set option for Mutual Verified Just-Works The default is both display PIN and get user confirmation.

static OCStackResult OC::OCSecure::unsetDisplayPinCB ( )
static

API for de-registering the display pin callback.

Deprecated:
Use deregisterDisplayPinCallback instead.
Returns
OC_STACK_OK in case of success and other value otherwise.
static OCStackResult OC::OCSecure::unsetInputPinCallback ( )
static

API for de-registering a pin callback.

Deprecated:
Use deregisterInputPinCallback instead.
Returns
OC_STACK_OK in case of success and other value otherwise.

The documentation for this class was generated from the following file: