*
* @return ::OC_STACK_OK on success, some other value upon failure.
*/
-OCStackResult OCSetDefaultDeviceEntityHandler(OCDeviceEntityHandler entityHandler, void* callbackParameter);
+OCStackResult OCSetDefaultDeviceEntityHandler(OCDeviceEntityHandler entityHandler,
+ void* callbackParameter);
/**
* This function sets device information.
const char *OCGetResourceInterfaceName(OCResourceHandle handle, uint8_t index);
/**
- * This function gets methods of resource interface of the resource.
- *
- * @param handle Handle of resource.
- * @param index Index of resource, 0 to Count - 1.
- *
- * @return Allowed methods if resource found or NULL if resource not found.
- */
-uint8_t OCGetResourceInterfaceAllowedMethods(OCResourceHandle handle, uint8_t index);
-
-/**
* This function gets resource handle from the collection resource by index.
*
* @param collectionHandle Handle of collection resource.
*
* @return ::OC_STACK_OK on success, some other value upon failure.
*/
-OCStackResult
-OCNotifyListOfObservers (OCResourceHandle handle,
- OCObservationId *obsIdList,
- uint8_t numberOfIds,
- const OCRepPayload *payload,
- OCQualityOfService qos);
-
+OCStackResult OCNotifyListOfObservers (OCResourceHandle handle,
+ OCObservationId *obsIdList,
+ uint8_t numberOfIds,
+ const OCRepPayload *payload,
+ OCQualityOfService qos);
/**
* This function sends a response to a request.
*/
OCStackResult OCDoDirectPairing(void *ctx, OCDPDev_t* peer, OCPrm_t pmSel, char *pinNumber,
OCDirectPairingCB resultCallback);
+//#endif // DIRECT_PAIRING
/**
* This function sets uri being used for proxy.
*/
OCStackResult OCGetResourceIns(OCResourceHandle handle, uint8_t *ins);
-#endif
-
-/**
-* This function gets a resource handle by resource uri.
-*
-* @param uri Uri of Resource to get Resource handle.
-*
-* @return Found resource handle or NULL if not found.
-*/
-OCResourceHandle OCGetResourceHandleAtUri(const char *uri);
-
#ifdef RD_SERVER
/**
* Sets the filename to be used for database persistent storage.
*
* @return ::OC_STACK_OK in case of success or else other value.
*/
-OCStackResult OCRDDatabaseDiscoveryPayloadCreate(const char *interfaceType, const char *resourceType,
- OCDiscoveryPayload **discPayload);
-#endif
-//#endif // DIRECT_PAIRING
+OCStackResult OCRDDatabaseDiscoveryPayloadCreate(const char *interfaceType,
+ const char *resourceType,
+ OCDiscoveryPayload **discPayload);
+#endif // RD_SERVER
+#endif // RD_CLIENT || RD_SERVER
+
+/**
+* This function gets a resource handle by resource uri.
+*
+* @param uri Uri of Resource to get Resource handle.
+*
+* @return Found resource handle or NULL if not found.
+*/
+OCResourceHandle OCGetResourceHandleAtUri(const char *uri);
/**
* Add a header option to the given header option array.
*
* @return ::OC_STACK_OK on success and other value otherwise.
*/
-OCStackResult
-OCSetHeaderOption(OCHeaderOption* ocHdrOpt,
- size_t* numOptions,
- uint16_t optionID,
- void* optionData,
- size_t optionDataLength);
+OCStackResult OCSetHeaderOption(OCHeaderOption* ocHdrOpt,
+ size_t* numOptions,
+ uint16_t optionID,
+ void* optionData,
+ size_t optionDataLength);
/**
* Get data value of the option with specified option ID from given header option array.
*
* @return ::OC_STACK_OK on success and other value otherwise.
*/
-OCStackResult
-OCGetHeaderOption(OCHeaderOption* ocHdrOpt,
- size_t numOptions,
- uint16_t optionID,
- void* optionData,
- size_t optionDataLength,
- uint16_t* receivedDatalLength);
+OCStackResult OCGetHeaderOption(OCHeaderOption* ocHdrOpt,
+ size_t numOptions,
+ uint16_t optionID,
+ void* optionData,
+ size_t optionDataLength,
+ uint16_t* receivedDatalLength);
/**
* gets the deviceId of the client
* Encode an address string to match RFC 6874.
*
* @param outputAddress a char array to be written with the encoded string.
- *
* @param outputSize size of outputAddress buffer.
- *
* @param inputAddress a char array of size <= CA_MAX_URI_LENGTH
* containing a valid IPv6 address string.
*
* Decode an address string according to RFC 6874.
*
* @param outputAddress a char array to be written with the decoded string.
- *
* @param outputSize size of outputAddress buffer.
- *
* @param inputAddress a valid percent-encoded address string.
- *
* @param end NULL if the entire entire inputAddress is a null-terminated percent-
* encoded address string. Otherwise, a pointer to the first byte that
* is not part of the address string (e.g., ']' in a URI).
return OC_STACK_OK;
}
+OCStackResult OCGetResourceIns(OCResourceHandle handle, uint8_t *ins)
+{
+ OCResource *resource = NULL;
+
+ VERIFY_NON_NULL(handle, ERROR, OC_STACK_INVALID_PARAM);
+ VERIFY_NON_NULL(ins, ERROR, OC_STACK_INVALID_PARAM);
+
+ resource = findResource((OCResource *) handle);
+ if (resource)
+ {
+ *ins = resource->ins;
+ return OC_STACK_OK;
+ }
+ return OC_STACK_ERROR;
+}
+#endif // RD_CLIENT || RD_SERVER
+
OCResourceHandle OCGetResourceHandleAtUri(const char *uri)
{
if (!uri)
return NULL;
}
-OCStackResult OCGetResourceIns(OCResourceHandle handle, uint8_t *ins)
-{
- OCResource *resource = NULL;
-
- VERIFY_NON_NULL(handle, ERROR, OC_STACK_INVALID_PARAM);
- VERIFY_NON_NULL(ins, ERROR, OC_STACK_INVALID_PARAM);
-
- resource = findResource((OCResource *) handle);
- if (resource)
- {
- *ins = resource->ins;
- return OC_STACK_OK;
- }
- return OC_STACK_ERROR;
-}
-#endif
-
OCStackResult OCSetHeaderOption(OCHeaderOption* ocHdrOpt, size_t* numOptions, uint16_t optionID,
void* optionData, size_t optionDataLength)
{