Site Tools


common_resources

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
common_resources [2017/05/03 12:45]
poiema72 [Resource Interface]
common_resources [2018/06/21 08:24]
wmatrix [Resource Type]
Line 26: Line 26:
   * OCSetDeviceInfo - A function that sets device information   * OCSetDeviceInfo - A function that sets device information
  
-It is used like so:+It is used like this:
 <​code>​ <​code>​
   OCStackResult OCSetDeviceInfo(OCDeviceInfo deviceInfo);​   OCStackResult OCSetDeviceInfo(OCDeviceInfo deviceInfo);​
Line 51: Line 51:
   * Data model version.   * Data model version.
  
-Like the C API, the device name is the only mandatory field, all others are optional. It's a wrapper that uses OCSetDeviceInfo internally to store the device information. Here's an example of how it'​s ​used+Like the C API, the device name is the only mandatory field, all others are optional. It's a wrapper that uses OCSetDeviceInfo internally to store the device information. Here's an example of how it is used:
  
 <​code> ​ <​code> ​
Line 76: Line 76:
 IoTivity supports the following resource types: IoTivity supports the following resource types:
  
-^ Resource Type Name ^  Resource type value^ +^ Resource Type Name ^ Resource type value ^ 
-| Device ​ | oic.wk.d|+| Device ​ | oic.wk.d |
 | Platform | oic.wk.p | | Platform | oic.wk.p |
 | Discovery | oic.wk.res | | Discovery | oic.wk.res |
Line 89: Line 89:
  
 === C API ===  === C API === 
-**OCCreateResource** - A single ​interface ​type can be added to the resource when it's initially created:+**OCCreateResource** - A single ​resource ​type can be added to the resource when it's initially created:
 <​code>​ <​code>​
   OCStackResult OCCreateResource(OCResourceHandle *handle,** const char *resourceTypeName**,​ ...);   OCStackResult OCCreateResource(OCResourceHandle *handle,** const char *resourceTypeName**,​ ...);
Line 109: Line 109:
 </​code>​ </​code>​
  
-**OCDeleteResource** - delete a resource. Please note: there is no API available to delete only an interface ​type, it's only possible to delete the entire resource:+**OCDeleteResource** - delete a resource. Please note: there is no API available to delete only an resource ​type, it's only possible to delete the entire resource:
 <​code>​ <​code>​
   OCStackResult OCDeleteResource(OCResourceHandle* handle);   OCStackResult OCDeleteResource(OCResourceHandle* handle);
Line 118: Line 118:
 The C++ API has more functions to add and retrieve resource types. Please note: all API rely on the C API internally to handle all functionality. The C++ API functions are wrappers on top of C APIs. The C++ API has more functions to add and retrieve resource types. Please note: all API rely on the C API internally to handle all functionality. The C++ API functions are wrappers on top of C APIs.
  
-**OCPlatform::​registerResource** - A single ​interface ​type can be added to the resource when it's initially created:+**OCPlatform::​registerResource** - A single ​resource ​type can be added to the resource when it's initially created:
 <​code>​ <​code>​
   OCStackResult registerResource(OCResourceHandle &​handle,​** std::string &​resourceTypeName**,​ ...);   OCStackResult registerResource(OCResourceHandle &​handle,​** std::string &​resourceTypeName**,​ ...);
Line 133: Line 133:
 </​code>​ </​code>​
  
-**OCPlatform::​unregisterResource** - delete a resource. Please note: there is no API available to delete only an interface ​type, it's only possible to delete the entire resource:+**OCPlatform::​unregisterResource** - delete a resource. Please note: there is no API available to delete only an resource ​type, it's only possible to delete the entire resource:
 <​code>​ <​code>​
   OCStackResult unregisterResource(const OCResourceHandle &​resourceHandle);​   OCStackResult unregisterResource(const OCResourceHandle &​resourceHandle);​
common_resources.txt · Last modified: 2018/06/21 08:24 by wmatrix