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

This class represents a secure virtual device, which can be provisioned by the provisioning client. More...

Public Member Functions

 OCSecureResource ()
 
 OCSecureResource (std::weak_ptr< std::recursive_mutex > csdkLock, OCProvisionDev_t *dPtr)
 
 ~OCSecureResource ()
 
OCStackResult provisionPairwiseDevices (const Credential &cred, const OicSecAcl_t *acl1, const OCSecureResource &device2, const OicSecAcl_t *acl2, ResultCallBack resultCallback)
 API to provision credentials between two devices and ACLs for the devices who act as a server. More...
 
OCStackResult doOwnershipTransfer (ResultCallBack resultCallback)
 API to do ownership transfer for un-owned device. More...
 
OCStackResult provisionACL (const OicSecAcl_t *acl, ResultCallBack resultCallback)
 API to send ACL information to resource. More...
 
OCStackResult provisionCredentials (const Credential &cred, const OCSecureResource &device2, ResultCallBack resultCallback)
 API to provision credential to devices. More...
 
OCStackResult unlinkDevices (const OCSecureResource &device2, ResultCallBack resultCallback)
 API to remove the credential & relationship between the two devices. More...
 
OCStackResult removeDevice (unsigned short waitTimeForOwnedDeviceDiscovery, ResultCallBack resultCallback)
 API to remove device credential from all devices in subnet. More...
 
OCStackResult getLinkedDevices (UuidList_t &uuidList)
 This method is used to get linked devices' IDs. More...
 
std::string getDeviceID ()
 API to get the device ID of this resource. More...
 
OCProvisionDev_t * getDevPtr () const
 API to get the information of device for provisioning. More...
 
std::string getDevAddr ()
 This function returns the device's IP address. More...
 
int getDeviceStatus ()
 This function returns the device's Status. More...
 
bool getOwnedStatus ()
 This function provides the owned status of the device. More...
 
OicSecOxm_t getSelectedOwnershipTransferMethod ()
 This function provides the selected ownership transfer method of the device. More...
 
OCStackResult getOTMethod (OicSecOxm_t *oxm)
 API to get the proper OxM for OT. More...
 

Detailed Description

This class represents a secure virtual device, which can be provisioned by the provisioning client.

Constructor & Destructor Documentation

OC::OCSecureResource::OCSecureResource ( )
OC::OCSecureResource::OCSecureResource ( std::weak_ptr< std::recursive_mutex >  csdkLock,
OCProvisionDev_t *  dPtr 
)
OC::OCSecureResource::~OCSecureResource ( )

Member Function Documentation

OCStackResult OC::OCSecureResource::doOwnershipTransfer ( ResultCallBack  resultCallback)

API to do ownership transfer for un-owned device.

Parameters
resultCallbackResult callback function to be invoked when ownership transfer finished.
Returns
OC_STACK_OK in case of success and other value otherwise.
std::string OC::OCSecureResource::getDevAddr ( )

This function returns the device's IP address.

Returns
device address.
std::string OC::OCSecureResource::getDeviceID ( )

API to get the device ID of this resource.

Returns
device ID.
int OC::OCSecureResource::getDeviceStatus ( )

This function returns the device's Status.

Returns
Device status (1 = ON and 2 = OFF).
OCProvisionDev_t* OC::OCSecureResource::getDevPtr ( ) const

API to get the information of device for provisioning.

Returns
OCProvisionDev_t Reference provides information of device for provisioning.
OCStackResult OC::OCSecureResource::getLinkedDevices ( UuidList_t uuidList)

This method is used to get linked devices' IDs.

Parameters
uuidListInformation about the list of linked devices uuids.
Returns
OC_STACK_OK in case of success and other value otherwise.
OCStackResult OC::OCSecureResource::getOTMethod ( OicSecOxm_t *  oxm)

API to get the proper OxM for OT.

Parameters
oxmAddress to save the selected OxM.
Returns
OC_STACK_OK in case of success and other value otherwise.
bool OC::OCSecureResource::getOwnedStatus ( )

This function provides the owned status of the device.

Returns
Device owned status.
OicSecOxm_t OC::OCSecureResource::getSelectedOwnershipTransferMethod ( )

This function provides the selected ownership transfer method of the device.

Returns
Selected ownership transfer method.
OCStackResult OC::OCSecureResource::provisionACL ( const OicSecAcl_t *  acl,
ResultCallBack  resultCallback 
)

API to send ACL information to resource.

Parameters
aclACL to provision.
resultCallbackCallback will be called when provisioning request receives a response from resource server.
Returns
OC_STACK_OK in case of success and other value otherwise.
OCStackResult OC::OCSecureResource::provisionCredentials ( const Credential cred,
const OCSecureResource device2,
ResultCallBack  resultCallback 
)

API to provision credential to devices.

Parameters
credType of credentials to be provisioned to the device.
device2Second device' instance, representing resource to be provisioned.
resultCallbackCallback will be called when provisioning request receives a response from first resource server.
Returns
OC_STACK_OK in case of success and other value otherwise.
OCStackResult OC::OCSecureResource::provisionPairwiseDevices ( const Credential cred,
const OicSecAcl_t *  acl1,
const OCSecureResource device2,
const OicSecAcl_t *  acl2,
ResultCallBack  resultCallback 
)

API to provision credentials between two devices and ACLs for the devices who act as a server.

Parameters
credType of credentials & key size to be provisioned to the device.
acl1ACL for device 1. If this is not required set NULL.
device2Second device to be provisioned.
acl2ACL for device 2. If this is not required set NULL.
resultCallbackCallback will be called when provisioning request receives a response from first resource server.
Returns
OC_STACK_OK in case of success and other value otherwise.
OCStackResult OC::OCSecureResource::removeDevice ( unsigned short  waitTimeForOwnedDeviceDiscovery,
ResultCallBack  resultCallback 
)

API to remove device credential from all devices in subnet.

Parameters
resultCallbackCallback provided by API user, callback will be called when credential revocation is finished.
waitTimeForOwnedDeviceDiscoveryMaximum wait time for owned device discovery in seconds.
Returns
OC_STACK_OK in case of success and other value otherwise.
OCStackResult OC::OCSecureResource::unlinkDevices ( const OCSecureResource device2,
ResultCallBack  resultCallback 
)

API to remove the credential & relationship between the two devices.

Parameters
device2Second device information to be unlinked.
resultCallbackCallback provided by API user, callback will be called when device unlink is finished.
Returns
OC_STACK_OK in case of success and other value otherwise.

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