int initThread();
void *loop(void *threadid);
-time_t registerTimer(const time_t seconds, int *id, TimerCallback cb);
-void unregisterTimer(int id);
+time_t OC_CALL registerTimer(const time_t seconds, int *id, TimerCallback cb);
+void OC_CALL unregisterTimer(int id);
#else
time_t timeToSecondsFromNow(tmElements_t *t);
-time_t registerTimer(const time_t seconds, int *id, TimerCallback cb);
-void unregisterTimer(int id);
+time_t OC_CALL registerTimer(const time_t seconds, int *id, TimerCallback cb);
+void OC_CALL unregisterTimer(int id);
#endif
return delayed_time;
}
-time_t registerTimer(const time_t seconds, int *id, TimerCallback cb)
+time_t OC_CALL registerTimer(const time_t seconds, int *id, TimerCallback cb)
{
time_t now, then;
time_t next;
return timeout_list[idx].timeout_time;
}
-void unregisterTimer(int idx)
+void OC_CALL unregisterTimer(int idx)
{
if (0 <= idx && idx < TIMEOUTS)
timeout_list[idx].timeout_state = TIMEOUT_UNUSED;
return (time_t) (then - t);
}
-time_t registerTimer(const time_t seconds, int *id, TimerCallback cb)
+time_t OC_CALL registerTimer(const time_t seconds, int *id, TimerCallback cb)
{
time_t t, then;
time_t next;
return timeout_list[idx].timeout_time;
}
-void unregisterTimer(int idx)
+void OC_CALL unregisterTimer(int idx)
{
if (0 <= idx && idx < TIMEOUTS)
timeout_list[idx].timeout_state = TIMEOUT_UNUSED;
*
* @return ::OC_STACK_OK on success, some other value upon failure.
*/
-OCStackResult OCRDDiscover(OCDoHandle *handle, OCConnectivityType connectivityType,
+OCStackResult OC_CALL OCRDDiscover(OCDoHandle *handle, OCConnectivityType connectivityType,
OCCallbackData *cbBiasFactor, OCQualityOfService qos);
/**
*
* @return ::OC_STACK_OK on success, some other value upon failure.
*/
-OCStackResult OCRDPublish(OCDoHandle *handle, const char *host,
+OCStackResult OC_CALL OCRDPublish(OCDoHandle *handle, const char *host,
OCConnectivityType connectivityType,
OCResourceHandle *resourceHandles, uint8_t nHandles,
OCCallbackData *cbData, OCQualityOfService qos);
*
* @return ::OC_STACK_OK on success, some other value upon failure.
*/
-OCStackResult OCRDPublishWithDeviceId(OCDoHandle *handle, const char *host,
+OCStackResult OC_CALL OCRDPublishWithDeviceId(OCDoHandle *handle, const char *host,
const unsigned char *id,
OCConnectivityType connectivityType,
OCResourceHandle *resourceHandles, uint8_t nHandles,
*
* @return ::OC_STACK_OK on success, some other value upon failure.
*/
-OCStackResult OCRDDelete(OCDoHandle *handle, const char *host,
+OCStackResult OC_CALL OCRDDelete(OCDoHandle *handle, const char *host,
OCConnectivityType connectivityType,
OCResourceHandle *resourceHandles, uint8_t nHandles,
OCCallbackData *cbData, OCQualityOfService qos);
* - ::OC_STACK_INVALID_URI generated URI exceeds MAX_URI_LENGTH try fewer resourceHandles
* - some other value upon failure.
*/
-OCStackResult OCRDDeleteWithDeviceId(OCDoHandle *handle, const char *host,
+OCStackResult OC_CALL OCRDDeleteWithDeviceId(OCDoHandle *handle, const char *host,
const unsigned char *id,
OCConnectivityType connectivityType,
OCResourceHandle *resourceHandles, uint8_t nHandles,
*
* @return ::OC_STACK_OK in case of success or else other value.
*/
-OCStackResult OCRDDatabaseInit();
+OCStackResult OC_CALL OCRDDatabaseInit();
/**
* Stores in database the published resource.
*
* @return ::OC_STACK_OK in case of success or else other value.
*/
-OCStackResult OCRDDatabaseStoreResources(const OCRepPayload *payload);
+OCStackResult OC_CALL OCRDDatabaseStoreResources(const OCRepPayload *payload);
/**
* Delete the RD resources
*
* @return ::OC_STACK_OK in case of success or else other value.
*/
-OCStackResult OCRDDatabaseDeleteResources(const char *deviceId, const int64_t *instanceIds,
+OCStackResult OC_CALL OCRDDatabaseDeleteResources(const char *deviceId, const int64_t *instanceIds,
uint16_t nInstanceIds);
/**
*
* @return ::OC_STACK_OK in case of success or else other value.
*/
-OCStackResult OCRDDatabaseClose();
+OCStackResult OC_CALL OCRDDatabaseClose();
#endif
*
* @return ::OC_STACK_OK upon success, ::OC_STACK_ERROR in case of error.
*/
-OCStackResult OCRDStart();
+OCStackResult OC_CALL OCRDStart();
/**
* Stops resource directory.
* @return ::OC_STACK_OK upon success, ::OC_STACK_ERROR is returned except
* the case that OC_STACK_SUCCESS is returned.
*/
-OCStackResult OCRDStop();
+OCStackResult OC_CALL OCRDStop();
/**
* Checks based on the resource type if the entity exists in the resource directory.
* @return ::OC_STACK_OK upon success, ::OC_STACK_ERROR is returned except
* the case that OC_STACK_SUCCESS is returned.
*/
-OCStackResult OCRDCheckPublishedResource(const char *interfaceType, const char *resourceType,
+OCStackResult OC_CALL OCRDCheckPublishedResource(const char *interfaceType, const char *resourceType,
OCDiscoveryPayload **payload);
#endif
return res;
}
-OCStackResult OCRDDatabaseInit()
+OCStackResult OC_CALL OCRDDatabaseInit()
{
if (SQLITE_OK == sqlite3_config(SQLITE_CONFIG_LOG, errorCallback))
{
}
}
-OCStackResult OCRDDatabaseClose()
+OCStackResult OC_CALL OCRDDatabaseClose()
{
CHECK_DATABASE_INIT;
int res;
return (SQLITE_OK == res) ? OC_STACK_OK : OC_STACK_ERROR;
}
-OCStackResult OCRDDatabaseStoreResources(OCRepPayload *payload)
+OCStackResult OC_CALL OCRDDatabaseStoreResources(OCRepPayload *payload)
{
CHECK_DATABASE_INIT;
int res;
return (SQLITE_OK == res) ? OC_STACK_OK : OC_STACK_ERROR;
}
-OCStackResult OCRDDatabaseDeleteResources(const char *deviceId, const uint8_t *instanceIds,
+OCStackResult OC_CALL OCRDDatabaseDeleteResources(const char *deviceId, const uint8_t *instanceIds,
uint8_t nInstanceIds)
{
CHECK_DATABASE_INIT;
#ifdef RD_CLIENT
-OCStackResult OCRDDiscover(OCDoHandle *handle, OCConnectivityType connectivityType,
- OCCallbackData *cbBiasFactor, OCQualityOfService qos)
+OCStackResult OC_CALL OCRDDiscover(OCDoHandle *handle, OCConnectivityType connectivityType,
+ OCCallbackData *cbBiasFactor, OCQualityOfService qos)
{
if (!cbBiasFactor || !cbBiasFactor->cb)
{
return cbData->cb(cbData->context, handle, clientResponse);
}
-OCStackResult OCRDPublish(OCDoHandle *handle, const char *host,
- OCConnectivityType connectivityType,
- OCResourceHandle *resourceHandles, uint8_t nHandles,
- OCCallbackData *cbData, OCQualityOfService qos)
+OCStackResult OC_CALL OCRDPublish(OCDoHandle *handle, const char *host,
+ OCConnectivityType connectivityType,
+ OCResourceHandle *resourceHandles, uint8_t nHandles,
+ OCCallbackData *cbData, OCQualityOfService qos)
{
// Validate input parameters.
if (!host)
return rdPayload;
}
-OCStackResult OCRDPublishWithDeviceId(OCDoHandle *handle, const char *host,
- const unsigned char *id,
- OCConnectivityType connectivityType,
- OCResourceHandle *resourceHandles, uint8_t nHandles,
- OCCallbackData *cbData, OCQualityOfService qos)
+OCStackResult OC_CALL OCRDPublishWithDeviceId(OCDoHandle *handle, const char *host,
+ const unsigned char *id,
+ OCConnectivityType connectivityType,
+ OCResourceHandle *resourceHandles, uint8_t nHandles,
+ OCCallbackData *cbData, OCQualityOfService qos)
{
// Validate input parameters.
if (!host || !cbData || !cbData->cb || !id)
connectivityType, qos, &rdPublishCbData, options, (uint8_t)numOptions);
}
-OCStackResult OCRDDelete(OCDoHandle *handle, const char *host,
- OCConnectivityType connectivityType,
- OCResourceHandle *resourceHandles, uint8_t nHandles,
- OCCallbackData *cbData, OCQualityOfService qos)
+OCStackResult OC_CALL OCRDDelete(OCDoHandle *handle, const char *host,
+ OCConnectivityType connectivityType,
+ OCResourceHandle *resourceHandles, uint8_t nHandles,
+ OCCallbackData *cbData, OCQualityOfService qos)
{
// Validate input parameters
if (!host)
cbData, qos);
}
-OCStackResult OCRDDeleteWithDeviceId(OCDoHandle *handle, const char *host,
- const unsigned char *id,
- OCConnectivityType connectivityType,
- OCResourceHandle *resourceHandles, uint8_t nHandles,
- OCCallbackData *cbData, OCQualityOfService qos)
+OCStackResult OC_CALL OCRDDeleteWithDeviceId(OCDoHandle *handle, const char *host,
+ const unsigned char *id,
+ OCConnectivityType connectivityType,
+ OCResourceHandle *resourceHandles, uint8_t nHandles,
+ OCCallbackData *cbData, OCQualityOfService qos)
{
// Validate input parameters
if (!host || !cbData || !cbData->cb || !id)
if (payload)
{
OIC_LOG_PAYLOAD(DEBUG, (OCPayload *) payload);
- if (OC_STACK_OK == OCRDDatabaseInit(NULL))
+ if (OC_STACK_OK == OCRDDatabaseInit())
{
if (OC_STACK_OK == OCRDDatabaseStoreResources(payload))
{
OIC_LOG_V(DEBUG, TAG, "Received OC_REST_DELETE from client with query: %s.", ehRequest->query);
- if (OC_STACK_OK != OCRDDatabaseInit(NULL))
+ if (OC_STACK_OK != OCRDDatabaseInit())
{
goto exit;
}
/**
* Registers RD resource
*/
-OCStackResult OCRDStart()
+OCStackResult OC_CALL OCRDStart()
{
OCStackResult result = OCCreateResource(&rdHandle,
OC_RSRVD_RESOURCE_TYPE_RD,
/**
* Stops resource directory server
*/
-OCStackResult OCRDStop()
+OCStackResult OC_CALL OCRDStop()
{
if (!rdHandle)
{
*
* @return OC_STACK_OK if generated successfully; error otherwise.
*/
-OCStackResult OCGenerateRandomSerialNumber(char **serial, size_t *serialLen);
+OCStackResult OC_CALL OCGenerateRandomSerialNumber(char **serial, size_t *serialLen);
/**
* Generate a new NIST P-256 elliptic curve key pair and return the public and private
* this key remains protected and secret!
* @param[OUT] privateKeyLen Variable to receive length of privateKey, which will include terminating NULL.
*/
-OCStackResult OCGenerateKeyPair(char **publicKey, size_t *publicKeyLen,
- char **privateKey, size_t *privateKeyLen);
+OCStackResult OC_CALL OCGenerateKeyPair(char **publicKey, size_t *publicKeyLen,
+ char **privateKey, size_t *privateKeyLen);
/**
* Generate a certificate to act as a Certificate Authority (CA).
*
* @return OC_STACK_OK if successful, error code otherwise
*/
-OCStackResult OCGenerateCACertificate(
+OCStackResult OC_CALL OCGenerateCACertificate(
const char *subject,
const char *subjectPublicKey,
const char *issuerCert,
*
* @return OC_STACK_OK if successful, error code otherwise
*/
-OCStackResult OCGenerateIdentityCertificate(
+OCStackResult OC_CALL OCGenerateIdentityCertificate(
const OicUuid_t *subjectUuid,
const char *subjectPublicKey,
const char *issuerCert,
*
* @return OC_STACK_OK if successful, error code otherwise
*/
-OCStackResult OCGenerateRoleCertificate(
+OCStackResult OC_CALL OCGenerateRoleCertificate(
const OicUuid_t *subjectUuid,
const char *subjectPublicKey,
const char *issuerCert,
*
* @return OC_STACK_OK if successful, error code otherwise
*/
-OCStackResult OCGetUuidFromCSR(const char* csr, OicUuid_t* uuid);
+OCStackResult OC_CALL OCGetUuidFromCSR(const char* csr, OicUuid_t* uuid);
/**
* Extract a public key from a CSR.
*
* @return OC_STACK_OK if successful, error code otherwise
*/
-OCStackResult OCGetPublicKeyFromCSR(const char* csr, char** publicKey);
+OCStackResult OC_CALL OCGetPublicKeyFromCSR(const char* csr, char** publicKey);
/**
* Verify the signature in a CSR is valid.
*
* @remark Requires that ECDSA with SHA-256 be used for the signature.
*/
-OCStackResult OCVerifyCSRSignature(const char* csr);
+OCStackResult OC_CALL OCVerifyCSRSignature(const char* csr);
/**
* Convert a CSR from DER encoding to PEM encoding.
*
* @return OC_STACK_OK if successful, error code otherwise
*/
-OCStackResult OCConvertDerCSRToPem(const char* derCSR, size_t derCSRLen, char** pemCSR);
+OCStackResult OC_CALL OCConvertDerCSRToPem(const char* derCSR, size_t derCSRLen, char** pemCSR);
#ifdef __cplusplus
}
* @note The port field of the devAddr parameter MUST contain the secure port of the peer.
*
*/
-OCStackResult OCAssertRoles(void *ctx, const OCDevAddr *devAddr, OCAssertRolesCB resultCallback);
+OCStackResult OC_CALL OCAssertRoles(void *ctx, const OCDevAddr *devAddr, OCAssertRolesCB resultCallback);
#ifdef __cplusplus
}
/**
* Function pointer to display verification PIN
*/
-typedef OCStackResult (*DisplayNumCallback)(void * ctx, uint8_t verifNum[MUTUAL_VERIF_NUM_LEN]);
+typedef OCStackResult (OC_CALL *DisplayNumCallback)(void * ctx, uint8_t verifNum[MUTUAL_VERIF_NUM_LEN]);
/**
* Function pointer to get user confirmation
*/
-typedef OCStackResult (*UserConfirmCallback)(void * ctx);
+typedef OCStackResult (OC_CALL *UserConfirmCallback)(void * ctx);
/**
* Context for displaying verification PIN
/**
* Set Callback for displaying verification PIN
*/
-void SetDisplayNumCB(void * ptr, DisplayNumCallback displayNumCB);
+void OC_CALL SetDisplayNumCB(void * ptr, DisplayNumCallback displayNumCB);
/**
* Unset Callback for displaying verification PIN
*/
-void* UnsetDisplayNumCB();
+void* OC_CALL UnsetDisplayNumCB();
/**
* Set Callback for getting user confirmation
*/
-void SetUserConfirmCB(void * ptr, UserConfirmCallback userConfirmCB);
+void OC_CALL SetUserConfirmCB(void * ptr, UserConfirmCallback userConfirmCB);
/**
* Unset Callback for getting user confirmation
*/
-void* UnsetUserConfirmCB();
+void* OC_CALL UnsetUserConfirmCB();
/**
* Set verification method option.
* The default is both display PIN and get user confirmation.
*/
-void SetVerifyOption(VerifyOptionBitmask_t verifyOption);
+void OC_CALL SetVerifyOption(VerifyOptionBitmask_t verifyOption);
/**
* Call the Callback for Verifying Ownership Transfer process.
*/
-OCStackResult VerifyOwnershipTransfer(uint8_t mutualVerifNum[MUTUAL_VERIF_NUM_LEN],
+OCStackResult OC_CALL VerifyOwnershipTransfer(uint8_t mutualVerifNum[MUTUAL_VERIF_NUM_LEN],
VerifyOptionBitmask_t verifyOption);
#ifdef __cplusplus
/**
* Function pointer to display pin code.
*/
-typedef void (*GeneratePinCallback)(char* pinData, size_t pinSize);
+typedef void (OC_CALL *GeneratePinCallback)(char* pinData, size_t pinSize);
/**
* Function pointer to display pin code, with context.
*/
-typedef void(*DisplayPinCallbackWithContext)(char* pinData, size_t pinSize, void* context);
+typedef void(OC_CALL *DisplayPinCallbackWithContext)(char* pinData, size_t pinSize, void* context);
/**
* Function pointer to close the displied PIN.
*/
-typedef void (*ClosePinDisplayCallback)(void);
+typedef void (OC_CALL *ClosePinDisplayCallback)(void);
/**
* Function pointer to input pin code.
*/
-typedef void (*InputPinCallback)(char* pinBuf, size_t bufSize);
+typedef void (OC_CALL *InputPinCallback)(char* pinBuf, size_t bufSize);
/**
* Function pointer to input pin code, with context and device information.
*/
-typedef void(*InputPinCallbackWithContext)(OicUuid_t deviceId, char* pinBuffer, size_t pinBufferSize, void* context);
+typedef void(OC_CALL *InputPinCallbackWithContext)(OicUuid_t deviceId, char* pinBuffer, size_t pinBufferSize, void* context);
/**
* Function to set the display PIN callback from the user.
*
* @param pinCB implementation of generate PIN callback.
*/
-void SetGeneratePinCB(GeneratePinCallback pinCB);
+void OC_CALL SetGeneratePinCB(GeneratePinCallback pinCB);
/**
* Function to set the display PIN callback from the user with context.
* OC_STACK_INVALID_PARAM if pinCB is invalid.
* OC_STACK_DUPLICATE_REQUEST if a display pin callback has already been set.
*/
-OCStackResult SetDisplayPinWithContextCB(DisplayPinCallbackWithContext displayPinCB, void* context);
+OCStackResult OC_CALL SetDisplayPinWithContextCB(DisplayPinCallbackWithContext displayPinCB, void* context);
/**
* Function to set the input PIN callback from the user.
*
* @param pinCB implementation of input PIN callback.
*/
-void SetInputPinCB(InputPinCallback pinCB);
+void OC_CALL SetInputPinCB(InputPinCallback pinCB);
/**
* Function to set the input PIN callback from the user with context.
* OC_STACK_INVALID_PARAM if pinCB is invalid.
* OC_STACK_DUPLICATE_REQUEST if an input pin callback has already been set.
*/
-OCStackResult SetInputPinWithContextCB(InputPinCallbackWithContext inputPinCB, void* context);
+OCStackResult OC_CALL SetInputPinWithContextCB(InputPinCallbackWithContext inputPinCB, void* context);
/**
* Function to set the close PIN callback
*
* @param closeCB implementation of close PIN callback.
*/
-void SetClosePinDisplayCB(ClosePinDisplayCallback closeCB);
+void OC_CALL SetClosePinDisplayCB(ClosePinDisplayCallback closeCB);
/**
* Function to unset the input PIN callback.
* @deprecated Use UnsetInputPinWithContextCB instead.
*
*/
-void UnsetInputPinCB();
+void OC_CALL UnsetInputPinCB();
/**
* Function to unset the input PIN callback.
* NOTE : Do not call this function while PIN based ownership transfer is in progress.
*/
-void UnsetInputPinWithContextCB();
+void OC_CALL UnsetInputPinWithContextCB();
/**
* Function to unset the PIN generation callback.
* @deprecated Use UnsetDisplayPinWithContextCB instead.
*
*/
-void UnsetGeneratePinCB();
+void OC_CALL UnsetGeneratePinCB();
/**
* Function to unset the PIN display callback.
* NOTE : Do not call this function while PIN based ownership transfer is in progress.
*/
-void UnsetDisplayPinWithContextCB();
+void OC_CALL UnsetDisplayPinWithContextCB();
/**
* Function to unset the PIN close callback.
* NOTE : Do not call this function while PIN based ownership transfer is in progress.
*/
-void UnsetClosePinCB();
+void OC_CALL UnsetClosePinCB();
/**
* Function to generate a random PIN.
*
* @return ::OC_STACK_OK in case of success or other value in case of error.
*/
-OCStackResult GeneratePin(char* pinBuffer, size_t bufferSize);
+OCStackResult OC_CALL GeneratePin(char* pinBuffer, size_t bufferSize);
/**
* Function to get a pin for a device.
*
* @return ::OC_STACK_SUCCESS in case of success or other value in ccase of error.
*/
-OCStackResult SetPreconfigPin(const char *pinBuffer, size_t pinLength);
+OCStackResult OC_CALL SetPreconfigPin(const char *pinBuffer, size_t pinLength);
#endif
/**
*
* @return ::OC_STACK_OK in case of success or other value in case of error.
*/
-OCStackResult SetRandomPinPolicy(size_t pinSize, OicSecPinType_t pinType);
+OCStackResult OC_CALL SetRandomPinPolicy(size_t pinSize, OicSecPinType_t pinType);
#ifdef __WITH_DTLS__
* @return OC_STACK_OK for success.
*
*/
-OCStackResult ConvertStrToUuid(const char* strUuid, OicUuid_t* uuid);
+OCStackResult OC_CALL ConvertStrToUuid(const char* strUuid, OicUuid_t* uuid);
/**
* Compares two OicUuid_t structs.
*
* @return ::OC_STACK_OK for Success, otherwise some error value.
*/
-OCStackResult SetDeviceIdSeed(const uint8_t* seed, size_t seedSize);
+OCStackResult OC_CALL SetDeviceIdSeed(const uint8_t* seed, size_t seedSize);
#endif
#ifdef __cplusplus
*
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCInitPM(const char* dbPath);
+OCStackResult OC_CALL OCInitPM(const char* dbPath);
/**
* API to cleanup PDM in case of timeout.
*
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCPDMCleanupForTimeout();
+OCStackResult OC_CALL OCPDMCleanupForTimeout();
/**
* The function is responsible for discovery of owned/unowned device is specified endpoint/deviceID.
* @param[out] ppFoundDevice OCProvisionDev_t of found device
* @return OTM_SUCCESS in case of success and other value otherwise.
*/
-OCStackResult OCDiscoverSingleDevice(unsigned short timeout, const OicUuid_t* deviceID,
+OCStackResult OC_CALL OCDiscoverSingleDevice(unsigned short timeout, const OicUuid_t* deviceID,
OCProvisionDev_t **ppFoundDevice);
/**
* @param[out] ppFoundDevice OCProvisionDev_t of found device.
* @return OTM_SUCCESS in case of success and other value otherwise.
*/
-OCStackResult OCDiscoverSingleDeviceInUnicast(unsigned short timeout, const OicUuid_t* deviceID,
+OCStackResult OC_CALL OCDiscoverSingleDeviceInUnicast(unsigned short timeout, const OicUuid_t* deviceID,
const char* hostAddress, OCConnectivityType connType,
OCProvisionDev_t **ppFoundDevice);
* @param[out] ppList List of candidate devices to be provisioned
* @return OTM_SUCCESS in case of success and other value otherwise.
*/
-OCStackResult OCDiscoverUnownedDevices(unsigned short waittime, OCProvisionDev_t **ppList);
+OCStackResult OC_CALL OCDiscoverUnownedDevices(unsigned short waittime, OCProvisionDev_t **ppList);
/**
* Do ownership transfer for un-owned device.
* @param[in] resultCallback Result callback function to be invoked when ownership transfer finished.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCDoOwnershipTransfer(void* ctx,
+OCStackResult OC_CALL OCDoOwnershipTransfer(void* ctx,
OCProvisionDev_t *targetDevices,
OCProvisionResultCB resultCallback);
*
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCSetOxmAllowStatus(const OicSecOxm_t oxm, const bool allowStatus);
+OCStackResult OC_CALL OCSetOxmAllowStatus(const OicSecOxm_t oxm, const bool allowStatus);
#ifdef MULTIPLE_OWNER
/**
* @param[in] resultCallback Result callback function to be invoked when ownership transfer finished.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCDoMultipleOwnershipTransfer(void* ctx,
+OCStackResult OC_CALL OCDoMultipleOwnershipTransfer(void* ctx,
OCProvisionDev_t *targetDevices,
OCProvisionResultCB resultCallback);
#endif //MULTIPLE_OWNER
* @param[in] callbackData of callback functions for owership transfer.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCSetOwnerTransferCallbackData(OicSecOxm_t oxm, OTMCallbackData_t* callbackData);
+OCStackResult OC_CALL OCSetOwnerTransferCallbackData(OicSecOxm_t oxm, OTMCallbackData_t* callbackData);
/**
* The function is responsible for discovery of owned device is current subnet. It will list
* @param[out] ppList List of device owned by provisioning tool.
* @return OTM_SUCCESS in case of success and other value otherwise.
*/
-OCStackResult OCDiscoverOwnedDevices(unsigned short timeout, OCProvisionDev_t **ppList);
+OCStackResult OC_CALL OCDiscoverOwnedDevices(unsigned short timeout, OCProvisionDev_t **ppList);
#ifdef MULTIPLE_OWNER
/**
* OCDeleteDiscoveredDevices to delete the device.
* @return OC_STACK_OK in case of success and other values otherwise.
*/
-OCStackResult OCDiscoverMultipleOwnerEnabledSingleDevice(unsigned short timeoutSeconds,
+OCStackResult OC_CALL OCDiscoverMultipleOwnerEnabledSingleDevice(unsigned short timeoutSeconds,
const OicUuid_t *deviceID,
OCProvisionDev_t **ppFoundDevice);
* @param[out] ppList List of MOT enabled devices.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCDiscoverMultipleOwnerEnabledDevices(unsigned short timeout, OCProvisionDev_t **ppList);
+OCStackResult OC_CALL OCDiscoverMultipleOwnerEnabledDevices(unsigned short timeout, OCProvisionDev_t **ppList);
/**
* The function is responsible for discovery of Multiple Owned device is current subnet.
* @param[out] ppList List of Multiple Owned devices.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCDiscoverMultipleOwnedDevices(unsigned short timeout, OCProvisionDev_t **ppList);
+OCStackResult OC_CALL OCDiscoverMultipleOwnedDevices(unsigned short timeout, OCProvisionDev_t **ppList);
/**
* The function is responsible for determining if the caller is a subowner of the specified device.
* @param[out] isSubowner Bool indicating whether the caller is a subowner of device.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCIsSubownerOfDevice(OCProvisionDev_t *device, bool *isSubowner);
+OCStackResult OC_CALL OCIsSubownerOfDevice(OCProvisionDev_t *device, bool *isSubowner);
#endif //MULTIPLE_OWNER
/**
* provisioning request recieves a response from first resource server.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCProvisionPairwiseDevices(void* ctx, OicSecCredType_t type, size_t keySize,
+OCStackResult OC_CALL OCProvisionPairwiseDevices(void* ctx, OicSecCredType_t type, size_t keySize,
const OCProvisionDev_t *pDev1, OicSecAcl_t *pDev1Acl,
const OCProvisionDev_t *pDev2, OicSecAcl_t *pDev2Acl,
OCProvisionResultCB resultCallback);
request recieves a response from resource server.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCProvisionACL(void *ctx, const OCProvisionDev_t *selectedDeviceInfo, OicSecAcl_t *acl,
+OCStackResult OC_CALL OCProvisionACL(void *ctx, const OCProvisionDev_t *selectedDeviceInfo, OicSecAcl_t *acl,
OCProvisionResultCB resultCallback);
/**
request recieves a response from resource server.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCProvisionACL2(void *ctx, const OCProvisionDev_t *selectedDeviceInfo, OicSecAcl_t *acl,
+OCStackResult OC_CALL OCProvisionACL2(void *ctx, const OCProvisionDev_t *selectedDeviceInfo, OicSecAcl_t *acl,
OCProvisionResultCB resultCallback);
/**
* @param acl ACL to be saved in Acl of SVR.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCSaveACL(const OicSecAcl_t* acl);
+OCStackResult OC_CALL OCSaveACL(const OicSecAcl_t* acl);
/**
* this function requests CRED information to resource.
request recieves a response from resource server.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCGetCredResource(void* ctx, const OCProvisionDev_t *selectedDeviceInfo,
+OCStackResult OC_CALL OCGetCredResource(void* ctx, const OCProvisionDev_t *selectedDeviceInfo,
OCProvisionResultCB resultCallback);
/**
request recieves a response from resource server.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCGetACLResource(void* ctx, const OCProvisionDev_t *selectedDeviceInfo,
+OCStackResult OC_CALL OCGetACLResource(void* ctx, const OCProvisionDev_t *selectedDeviceInfo,
OCProvisionResultCB resultCallback);
/**
request recieves a response from resource server.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCGetACL2Resource(void* ctx, const OCProvisionDev_t *selectedDeviceInfo,
+OCStackResult OC_CALL OCGetACL2Resource(void* ctx, const OCProvisionDev_t *selectedDeviceInfo,
OCProvisionResultCB resultCallback);
/**
request recieves a response from resource server.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCGetCSRResource(void* ctx, const OCProvisionDev_t *selectedDeviceInfo,
+OCStackResult OC_CALL OCGetCSRResource(void* ctx, const OCProvisionDev_t *selectedDeviceInfo,
OCGetCSRResultCB resultCallback);
/**
* request receives a response from the resource server.
* @return OC_STACK_OK in case of success, and error value otherwise.
*/
-OCStackResult OCGetRolesResource(void *ctx, const OCProvisionDev_t *selectedDeviceInfo,
+OCStackResult OC_CALL OCGetRolesResource(void *ctx, const OCProvisionDev_t *selectedDeviceInfo,
OCGetRolesResultCB resultCallback);
/**
*
* @return OC_STACK_OK in case of success, and error value otherwise.
*/
-OCStackResult OCDeleteRoleCertificateByCredId(void *ctx, const OCProvisionDev_t *selectedDeviceInfo,
+OCStackResult OC_CALL OCDeleteRoleCertificateByCredId(void *ctx, const OCProvisionDev_t *selectedDeviceInfo,
OCProvisionResultCB resultCallback, uint32_t credId);
/**
request recieves a response from resource server.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCProvisionDirectPairing(void* ctx, const OCProvisionDev_t *selectedDeviceInfo, OicSecPconf_t *pconf,
+OCStackResult OC_CALL OCProvisionDirectPairing(void* ctx, const OCProvisionDev_t *selectedDeviceInfo, OicSecPconf_t *pconf,
OCProvisionResultCB resultCallback);
/**
* provisioning request recieves a response from first resource server.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCProvisionCredentials(void *ctx, OicSecCredType_t type, size_t keySize,
+OCStackResult OC_CALL OCProvisionCredentials(void *ctx, OicSecCredType_t type, size_t keySize,
const OCProvisionDev_t *pDev1,
const OCProvisionDev_t *pDev2,
OCProvisionResultCB resultCallback);
* provisioning request receives a response from first resource server.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCProvisionSymmetricRoleCredentials(void *ctx, OicSecCredType_t type, size_t keySize,
+OCStackResult OC_CALL OCProvisionSymmetricRoleCredentials(void *ctx, OicSecCredType_t type, size_t keySize,
const OCProvisionDev_t *pDev1,
const OCProvisionDev_t *pDev2,
const OicSecRole_t *role1,
* provisioning request receives a response from first resource server.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCProvisionCertificate(void *ctx,
+OCStackResult OC_CALL OCProvisionCertificate(void *ctx,
const OCProvisionDev_t *pDev,
const char* pemCert,
OCProvisionResultCB resultCallback);
* provisioning request recieves a response from first resource server.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCProvisionPreconfigPin(void *ctx,
+OCStackResult OC_CALL OCProvisionPreconfigPin(void *ctx,
OCProvisionDev_t *targetDeviceInfo,
const char *preconfigPin,
size_t preconfigPinLen,
* @param[in] preconfigPinLen Byte length of preconfigPin
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCAddPreconfigPin(const OCProvisionDev_t *targetDeviceInfo,
+OCStackResult OC_CALL OCAddPreconfigPin(const OCProvisionDev_t *targetDeviceInfo,
const char *preconfigPin,
size_t preconfigPinLen);
* POST 'mom' request recieves a response from resource server.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCChangeMOTMode(void *ctx, const OCProvisionDev_t *targetDeviceInfo,
+OCStackResult OC_CALL OCChangeMOTMode(void *ctx, const OCProvisionDev_t *targetDeviceInfo,
const OicSecMomType_t momType, OCProvisionResultCB resultCallback);
/**
* POST 'oxmsel' request recieves a response from resource server.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCSelectMOTMethod(void *ctx, const OCProvisionDev_t *targetDeviceInfo,
+OCStackResult OC_CALL OCSelectMOTMethod(void *ctx, const OCProvisionDev_t *targetDeviceInfo,
const OicSecOxm_t oxmSelValue, OCProvisionResultCB resultCallback);
#endif //MULTIPLE_OWNER
* device unlink is finished.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCUnlinkDevices(void* ctx,
+OCStackResult OC_CALL OCUnlinkDevices(void* ctx,
const OCProvisionDev_t* pTargetDev1,
const OCProvisionDev_t* pTargetDev2,
OCProvisionResultCB resultCallback);
* if OC_STACK_OK is returned, the caller of this API should wait for callback.
* OC_STACK_CONTINUE means operation is success but no need to wait for callback.
*/
-OCStackResult OCRemoveDevice(void* ctx,
+OCStackResult OC_CALL OCRemoveDevice(void* ctx,
unsigned short waitTimeForOwnedDeviceDiscovery,
const OCProvisionDev_t* pTargetDev,
OCProvisionResultCB resultCallback);
* credential revocation is finished.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCRemoveDeviceWithUuid(void* ctx,
+OCStackResult OC_CALL OCRemoveDeviceWithUuid(void* ctx,
unsigned short waitTimeForOwnedDeviceDiscovery,
const OicUuid_t* pTargetUuid,
OCProvisionResultCB resultCallback);
* credential revocation is finished.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCResetDevice(void* ctx, unsigned short waitTimeForOwnedDeviceDiscovery,
+OCStackResult OC_CALL OCResetDevice(void* ctx, unsigned short waitTimeForOwnedDeviceDiscovery,
const OCProvisionDev_t* pTargetDev,
OCProvisionResultCB resultCallback);
*
*@return OC_STACK_OK in case of successful reset and other value otherwise.
*/
-OCStackResult OCResetSVRDB(void);
+OCStackResult OC_CALL OCResetSVRDB(void);
/**
* This function configures SVR DB as self-ownership.
*
*@return OC_STACK_OK in case of successful configue and other value otherwise.
*/
-OCStackResult OCConfigSelfOwnership(void);
+OCStackResult OC_CALL OCConfigSelfOwnership(void);
/**
* API to get status of all the devices in current subnet. The status include endpoint information
* @param[out] pUnownedDevList list of unowned devices.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCGetDevInfoFromNetwork(unsigned short waittime,
+OCStackResult OC_CALL OCGetDevInfoFromNetwork(unsigned short waittime,
OCProvisionDev_t** pOwnedDevList,
OCProvisionDev_t** pUnownedDevList);
/**
* @param[out] numOfDevices total number of linked devices.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCGetLinkedStatus(const OicUuid_t* uuidOfDevice,
+OCStackResult OC_CALL OCGetLinkedStatus(const OicUuid_t* uuidOfDevice,
OCUuidList_t** uuidList,
size_t* numOfDevices);
* @return OC_STACK_RESOURCE_DELETED if credentials were removed, or
* OC_STACK_ERROR if no credentials were removed.
*/
-OCStackResult OCRemoveCredential(const OicUuid_t* subjectUuid);
+OCStackResult OC_CALL OCRemoveCredential(const OicUuid_t* subjectUuid);
/**
* API to delete memory allocated to linked list created by OCDiscover_XXX_Devices API.
*
* @param[in] pList Pointer to OCProvisionDev_t which should be deleted.
*/
-void OCDeleteDiscoveredDevices(OCProvisionDev_t *pList);
+void OC_CALL OCDeleteDiscoveredDevices(OCProvisionDev_t *pList);
/**
* API to delete memory allocated to OicUuid_t list.
*
* @param[in] pList Pointer to OicUuid_t list which should be deleted.
*/
-void OCDeleteUuidList(OCUuidList_t* pList);
+void OC_CALL OCDeleteUuidList(OCUuidList_t* pList);
/**
* This function deletes ACL data.
*
* @param pAcl Pointer to OicSecAcl_t structure.
*/
-void OCDeleteACLList(OicSecAcl_t* pAcl);
+void OC_CALL OCDeleteACLList(OicSecAcl_t* pAcl);
/**
* This function deletes PDACL data.
*
* @param pPdAcl Pointer to OicSecPdAcl_t structure.
*/
-void OCDeletePdAclList(OicSecPdAcl_t* pPdAcl);
+void OC_CALL OCDeletePdAclList(OicSecPdAcl_t* pPdAcl);
#if defined(__WITH_DTLS__) || defined(__WITH_TLS__)
/**
+ * this function sends CRL information to resource.
+ *
+ * @param[in] ctx Application context returned in the result callback.
+ * @param[in] selectedDeviceInfo Selected target device.
+ * @param[in] crl CRL to provision.
+ * @param[in] resultCallback callback provided by API user, callback will be called when provisioning
+ request recieves a response from resource server.
+ * @return OC_STACK_OK in case of success and other value otherwise.
+ */
+OCStackResult OC_CALL OCProvisionCRL(void* ctx, const OCProvisionDev_t *selectedDeviceInfo, OicSecCrl_t *crl,
+ OCProvisionResultCB resultCallback);
+
+/**
* function to provision Trust certificate chain to devices.
*
* @param[in] ctx Application context returned in the result callback.
* provisioning request recieves a response from first resource server.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCProvisionTrustCertChain(void *ctx, OicSecCredType_t type, uint16_t credId,
+OCStackResult OC_CALL OCProvisionTrustCertChain(void *ctx, OicSecCredType_t type, uint16_t credId,
const OCProvisionDev_t *selectedDeviceInfo,
OCProvisionResultCB resultCallback);
/**
* @param[out] credId CredId of saved trust certificate chain in Cred of SVR.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCSaveTrustCertChain(const uint8_t *trustCertChain, size_t chainSize,
+OCStackResult OC_CALL OCSaveTrustCertChain(const uint8_t *trustCertChain, size_t chainSize,
OicEncodingType_t encodingType, uint16_t *credId);
/**
* @param[out] credId CredId of saved certificate chain in Cred of SVR.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCSaveOwnCertChain(const char* cert, const char* key, uint16_t *credId);
+OCStackResult OC_CALL OCSaveOwnCertChain(const char* cert, const char* key, uint16_t *credId);
/**
* Function to save own role certificate into Cred of SVR.
* @note The certificate public key must be the same as public key in the identity
* certificate (installed by OCSaveOwnCertChain).
*/
-OCStackResult OCSaveOwnRoleCert(const char* cert, uint16_t *credId);
+OCStackResult OC_CALL OCSaveOwnRoleCert(const char* cert, uint16_t *credId);
/**
* function to register callback, for getting notification for TrustCertChain change.
* @param[in] TrustCertChainChangeCB notifier callback function
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCRegisterTrustCertChainNotifier(void *cb, TrustCertChainChangeCB CB);
+OCStackResult OC_CALL OCRegisterTrustCertChainNotifier(void *cb, TrustCertChainChangeCB CB);
/**
* function to de-register TrustCertChain notification callback.
*/
-void OCRemoveTrustCertChainNotifier(void);
+void OC_CALL OCRemoveTrustCertChainNotifier(void);
/**
* Function to read Trust certificate chain from SVR.
* @param[out] chainSize Size of trust certificate chain
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCReadTrustCertChain(uint16_t credId, uint8_t **trustCertChain,
+OCStackResult OC_CALL OCReadTrustCertChain(uint16_t credId, uint8_t **trustCertChain,
size_t *chainSize);
/**
* @param[in] ownerType type of owner device (SUPER_OWNER or SUB_OWNER)
* @return OC_STACK_OK on success
*/
-OCStackResult OCSelectOwnershipTransferMethod(const OicSecOxm_t *supportedMethods,
+OCStackResult OC_CALL OCSelectOwnershipTransferMethod(const OicSecOxm_t *supportedMethods,
size_t numberOfMethods, OicSecOxm_t *selectedMethod, OwnerType_t ownerType);
#endif // __WITH_DTLS__ || __WITH_TLS__
*
* @return true on success
*/
-bool PMGenerateQuery(bool isSecure,
- const char* address, uint16_t port,
- OCConnectivityType connType,
- char* buffer, size_t bufferSize, const char* uri);
+bool OC_CALL PMGenerateQuery(bool isSecure,
+ const char* address, uint16_t port,
+ OCConnectivityType connType,
+ char* buffer, size_t bufferSize, const char* uri);
/**
* Function to print OCProvisionDev_t for debug purpose.
}
#endif //MULTIPLE_OWNER
-static void inputPinCB(OicUuid_t deviceId, char *pin, size_t len, void *context)
+static void OC_CALL inputPinCB(OicUuid_t deviceId, char *pin, size_t len, void *context)
{
OC_UNUSED(deviceId);
OC_UNUSED(context);
return 0;
}
-OCStackResult displayNumCB(void * ctx, uint8_t mutualVerifNum[MUTUAL_VERIF_NUM_LEN])
+OCStackResult OC_CALL displayNumCB(void * ctx, uint8_t mutualVerifNum[MUTUAL_VERIF_NUM_LEN])
{
OC_UNUSED(ctx);
return OC_STACK_OK;
}
-OCStackResult confirmNumCB(void * ctx)
+OCStackResult OC_CALL confirmNumCB(void * ctx)
{
OC_UNUSED(ctx);
return ehResult;
}
-OCStackResult displayNumCB(void *ctx, uint8_t mutualVerifNum[MUTUAL_VERIF_NUM_LEN])
+OCStackResult OC_CALL displayNumCB(void *ctx, uint8_t mutualVerifNum[MUTUAL_VERIF_NUM_LEN])
{
OC_UNUSED(ctx);
return OC_STACK_OK;
}
-OCStackResult confirmNumCB(void *ctx)
+OCStackResult OC_CALL confirmNumCB(void *ctx)
{
OC_UNUSED(ctx);
}
}
-void DisplayPinCB(char *pin, size_t pinSize, void *context)
+void OC_CALL DisplayPinCB(char *pin, size_t pinSize, void *context)
{
OC_UNUSED(context);
OIC_LOG(INFO, TAG, "============================");
}
-void ClosePinDisplayCB(void)
+void OC_CALL ClosePinDisplayCB(void)
{
OIC_LOG(INFO, TAG, "============================");
OIC_LOG(INFO, TAG, " PIN DISPLAY CLOSED.");
return OC_STACK_OK;
}
-static void inputPinCB(char* pin, size_t len)
+static void OC_CALL inputPinCB(char* pin, size_t len)
{
if(!pin || OXM_RANDOM_PIN_MAX_SIZE>=len)
{
*
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCInitPM(const char* dbPath)
+OCStackResult OC_CALL OCInitPM(const char* dbPath)
{
return PDMInit(dbPath);
}
-OCStackResult OCPDMCleanupForTimeout()
+OCStackResult OC_CALL OCPDMCleanupForTimeout()
{
return PDMDeleteDeviceWithState(PDM_DEVICE_INIT);
}
* @param[out] ppFoundDevice OCProvisionDev_t of found device
* @return OTM_SUCCESS in case of success and other value otherwise.
*/
-OCStackResult OCDiscoverSingleDevice(unsigned short timeout, const OicUuid_t* deviceID,
- OCProvisionDev_t **ppFoundDevice)
+OCStackResult OC_CALL OCDiscoverSingleDevice(unsigned short timeout, const OicUuid_t* deviceID,
+ OCProvisionDev_t **ppFoundDevice)
{
if( NULL == ppFoundDevice || NULL != *ppFoundDevice || 0 == timeout || NULL == deviceID)
{
* @param[out] ppFoundDevice OCProvisionDev_t of found device.
* @return OTM_SUCCESS in case of success and other value otherwise.
*/
-OCStackResult OCDiscoverSingleDeviceInUnicast(unsigned short timeout, const OicUuid_t* deviceID,
+OCStackResult OC_CALL OCDiscoverSingleDeviceInUnicast(unsigned short timeout, const OicUuid_t* deviceID,
const char* hostAddress, OCConnectivityType connType,
OCProvisionDev_t **ppFoundDevice)
{
* @param[out] ppList List of candidate devices to be provisioned
* @return OTM_SUCCESS in case of success and other value otherwise.
*/
-OCStackResult OCDiscoverUnownedDevices(unsigned short timeout, OCProvisionDev_t **ppList)
+OCStackResult OC_CALL OCDiscoverUnownedDevices(unsigned short timeout, OCProvisionDev_t **ppList)
{
if( ppList == NULL || *ppList != NULL || 0 == timeout)
{
* @param[out] ppList List of device owned by provisioning tool.
* @return OTM_SUCCESS in case of success and other value otherwise.
*/
-OCStackResult OCDiscoverOwnedDevices(unsigned short timeout, OCProvisionDev_t **ppList)
+OCStackResult OC_CALL OCDiscoverOwnedDevices(unsigned short timeout, OCProvisionDev_t **ppList)
{
if( ppList == NULL || *ppList != NULL || 0 == timeout)
{
* OCDeleteDiscoveredDevices to delete the device.
* @return OC_STACK_OK in case of success and other values otherwise.
*/
-OCStackResult OCDiscoverMultipleOwnerEnabledSingleDevice(unsigned short timeoutSeconds,
- const OicUuid_t* deviceID,
- OCProvisionDev_t **ppFoundDevice)
+OCStackResult OC_CALL OCDiscoverMultipleOwnerEnabledSingleDevice(unsigned short timeoutSeconds,
+ const OicUuid_t* deviceID,
+ OCProvisionDev_t **ppFoundDevice)
{
if ((NULL == ppFoundDevice) || (NULL != *ppFoundDevice) || (0 == timeoutSeconds) || (NULL == deviceID))
{
* @param[out] ppList List of MOT enabled devices.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCDiscoverMultipleOwnerEnabledDevices(unsigned short timeout, OCProvisionDev_t **ppList)
+OCStackResult OC_CALL OCDiscoverMultipleOwnerEnabledDevices(unsigned short timeout, OCProvisionDev_t **ppList)
{
if( ppList == NULL || *ppList != NULL || 0 == timeout)
{
* @param[out] ppList List of Multiple Owned devices.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCDiscoverMultipleOwnedDevices(unsigned short timeout, OCProvisionDev_t **ppList)
+OCStackResult OC_CALL OCDiscoverMultipleOwnedDevices(unsigned short timeout, OCProvisionDev_t **ppList)
{
if( ppList == NULL || *ppList != NULL || 0 == timeout)
{
* @param[in] preconfigPinLen Byte length of preconfigPin
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCAddPreconfigPin(const OCProvisionDev_t *targetDeviceInfo,
- const char *preconfigPin,
- size_t preconfigPinLen)
+OCStackResult OC_CALL OCAddPreconfigPin(const OCProvisionDev_t *targetDeviceInfo,
+ const char *preconfigPin,
+ size_t preconfigPinLen)
{
return MOTAddPreconfigPIN(targetDeviceInfo, preconfigPin, preconfigPinLen);
}
-OCStackResult OCDoMultipleOwnershipTransfer(void* ctx,
- OCProvisionDev_t *targetDevices,
- OCProvisionResultCB resultCallback)
+OCStackResult OC_CALL OCDoMultipleOwnershipTransfer(void* ctx,
+ OCProvisionDev_t *targetDevices,
+ OCProvisionResultCB resultCallback)
{
if( NULL == targetDevices )
{
* @param[out] isSubowner Bool indicating whether the caller is a subowner of device
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCIsSubownerOfDevice(OCProvisionDev_t *device, bool *isSubowner)
+OCStackResult OC_CALL OCIsSubownerOfDevice(OCProvisionDev_t *device, bool *isSubowner)
{
if ((NULL == device) || (NULL == isSubowner))
{
* @param[in] Implementation of callback functions for owership transfer.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCSetOwnerTransferCallbackData(OicSecOxm_t oxm, OTMCallbackData_t* callbackData)
+OCStackResult OC_CALL OCSetOwnerTransferCallbackData(OicSecOxm_t oxm, OTMCallbackData_t* callbackData)
{
if(NULL == callbackData)
{
*
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCSetOxmAllowStatus(const OicSecOxm_t oxm, const bool allowStatus)
+OCStackResult OC_CALL OCSetOxmAllowStatus(const OicSecOxm_t oxm, const bool allowStatus)
{
return OTMSetOxmAllowStatus(oxm, allowStatus);
}
-OCStackResult OCDoOwnershipTransfer(void* ctx,
- OCProvisionDev_t *targetDevices,
- OCProvisionResultCB resultCallback)
+OCStackResult OC_CALL OCDoOwnershipTransfer(void* ctx,
+ OCProvisionDev_t *targetDevices,
+ OCProvisionResultCB resultCallback)
{
if( NULL == targetDevices )
{
*
* @param[in] pList Pointer to OCProvisionDev_t which should be deleted.
*/
-void OCDeleteDiscoveredDevices(OCProvisionDev_t *pList)
+void OC_CALL OCDeleteDiscoveredDevices(OCProvisionDev_t *pList)
{
PMDeleteDeviceList(pList);
}
* request receives a response from resource server.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCProvisionACL(void* ctx, const OCProvisionDev_t *selectedDeviceInfo, OicSecAcl_t *acl,
- OCProvisionResultCB resultCallback)
+OCStackResult OC_CALL OCProvisionACL(void* ctx, const OCProvisionDev_t *selectedDeviceInfo, OicSecAcl_t *acl,
+ OCProvisionResultCB resultCallback)
{
if (NULL == acl)
{
* request recieves a response from resource server.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCProvisionACL2(void* ctx, const OCProvisionDev_t *selectedDeviceInfo, OicSecAcl_t *acl,
- OCProvisionResultCB resultCallback)
+OCStackResult OC_CALL OCProvisionACL2(void* ctx, const OCProvisionDev_t *selectedDeviceInfo, OicSecAcl_t *acl,
+ OCProvisionResultCB resultCallback)
{
return SRPProvisionACL(ctx, selectedDeviceInfo, acl, OIC_SEC_ACL_V2, resultCallback);
}
* @param acl ACL to be saved in Acl of SVR.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCSaveACL(const OicSecAcl_t* acl)
+OCStackResult OC_CALL OCSaveACL(const OicSecAcl_t* acl)
{
return SRPSaveACL(acl);
}
request recieves a response from resource server.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCGetCredResource(void* ctx, const OCProvisionDev_t *selectedDeviceInfo,
- OCProvisionResultCB resultCallback)
+OCStackResult OC_CALL OCGetCredResource(void* ctx, const OCProvisionDev_t *selectedDeviceInfo,
+ OCProvisionResultCB resultCallback)
{
return SRPGetCredResource(ctx, selectedDeviceInfo, resultCallback);
}
request recieves a response from resource server.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCGetACLResource(void* ctx, const OCProvisionDev_t *selectedDeviceInfo,
- OCProvisionResultCB resultCallback)
+OCStackResult OC_CALL OCGetACLResource(void* ctx, const OCProvisionDev_t *selectedDeviceInfo,
+ OCProvisionResultCB resultCallback)
{
return SRPGetACLResource(ctx, selectedDeviceInfo, OIC_SEC_ACL_V1, resultCallback);
}
-OCStackResult OCGetACL2Resource(void* ctx, const OCProvisionDev_t *selectedDeviceInfo,
- OCProvisionResultCB resultCallback)
+OCStackResult OC_CALL OCGetACL2Resource(void* ctx, const OCProvisionDev_t *selectedDeviceInfo,
+ OCProvisionResultCB resultCallback)
{
return SRPGetACLResource(ctx, selectedDeviceInfo, OIC_SEC_ACL_V2, resultCallback);
}
-OCStackResult OCGetCSRResource(void* ctx, const OCProvisionDev_t *selectedDeviceInfo,
- OCGetCSRResultCB resultCallback)
+OCStackResult OC_CALL OCGetCSRResource(void* ctx, const OCProvisionDev_t *selectedDeviceInfo,
+ OCGetCSRResultCB resultCallback)
{
return SRPGetCSRResource(ctx, selectedDeviceInfo, resultCallback);
}
-OCStackResult OCGetRolesResource(void *ctx, const OCProvisionDev_t *selectedDeviceInfo,
- OCGetRolesResultCB resultCallback)
+OCStackResult OC_CALL OCGetRolesResource(void *ctx, const OCProvisionDev_t *selectedDeviceInfo,
+ OCGetRolesResultCB resultCallback)
{
return SRPGetRolesResource(ctx, selectedDeviceInfo, resultCallback);
}
-OCStackResult OCDeleteRoleCertificateByCredId(void *ctx, const OCProvisionDev_t *selectedDeviceInfo,
- OCProvisionResultCB resultCallback, uint32_t credId)
+OCStackResult OC_CALL OCDeleteRoleCertificateByCredId(void *ctx, const OCProvisionDev_t *selectedDeviceInfo,
+ OCProvisionResultCB resultCallback, uint32_t credId)
{
return SRPDeleteRoleCertificateByCredId(ctx, selectedDeviceInfo, resultCallback, credId);
}
-OCStackResult OCReadTrustCertChain(uint16_t credId, uint8_t **trustCertChain,
- size_t *chainSize)
+OCStackResult OC_CALL OCReadTrustCertChain(uint16_t credId, uint8_t **trustCertChain,
+ size_t *chainSize)
{
return SRPReadTrustCertChain(credId, trustCertChain, chainSize);
}
* provisioning request recieves a response from first resource server.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCProvisionCredentials(void *ctx, OicSecCredType_t type, size_t keySize,
- const OCProvisionDev_t *pDev1,
- const OCProvisionDev_t *pDev2,
- OCProvisionResultCB resultCallback)
+OCStackResult OC_CALL OCProvisionCredentials(void *ctx, OicSecCredType_t type, size_t keySize,
+ const OCProvisionDev_t *pDev1,
+ const OCProvisionDev_t *pDev2,
+ OCProvisionResultCB resultCallback)
{
return SRPProvisionCredentialsDos(ctx, type, keySize,
pDev1, pDev2, resultCallback);
* provisioning request receives a response from first resource server.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCProvisionSymmetricRoleCredentials(void *ctx, OicSecCredType_t type, size_t keySize,
- const OCProvisionDev_t *pDev1,
- const OCProvisionDev_t *pDev2,
- const OicSecRole_t *role1,
- const OicSecRole_t *role2,
- OCProvisionResultCB resultCallback)
+OCStackResult OC_CALL OCProvisionSymmetricRoleCredentials(void *ctx, OicSecCredType_t type, size_t keySize,
+ const OCProvisionDev_t *pDev1,
+ const OCProvisionDev_t *pDev2,
+ const OicSecRole_t *role1,
+ const OicSecRole_t *role2,
+ OCProvisionResultCB resultCallback)
{
return SRPProvisionCredentials(ctx, type, keySize, pDev1, pDev2, NULL, role1, role2, resultCallback);
}
* provisioning request receives a response from first resource server.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCProvisionCertificate(void *ctx,
+OCStackResult OC_CALL OCProvisionCertificate(void *ctx,
const OCProvisionDev_t *pDev,
const char* pemCert,
OCProvisionResultCB resultCallback)
request recieves a response from resource server.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCProvisionDirectPairing(void* ctx, const OCProvisionDev_t *selectedDeviceInfo, OicSecPconf_t *pconf,
+OCStackResult OC_CALL OCProvisionDirectPairing(void* ctx, const OCProvisionDev_t *selectedDeviceInfo, OicSecPconf_t *pconf,
OCProvisionResultCB resultCallback)
{
return SRPProvisionDirectPairing(ctx, selectedDeviceInfo, pconf, resultCallback);
}
}
-OCStackResult OCProvisionPreconfigPin(void *ctx,
- OCProvisionDev_t *targetDeviceInfo,
- const char *preconfigPin,
- size_t preconfigPinLen,
- OCProvisionResultCB resultCallback)
+OCStackResult OC_CALL OCProvisionPreconfigPin(void *ctx,
+ OCProvisionDev_t *targetDeviceInfo,
+ const char *preconfigPin,
+ size_t preconfigPinLen,
+ OCProvisionResultCB resultCallback)
{
if( NULL == targetDeviceInfo )
{
* device unlink is finished.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCUnlinkDevices(void* ctx,
- const OCProvisionDev_t* pTargetDev1,
- const OCProvisionDev_t* pTargetDev2,
- OCProvisionResultCB resultCallback)
+OCStackResult OC_CALL OCUnlinkDevices(void* ctx,
+ const OCProvisionDev_t* pTargetDev1,
+ const OCProvisionDev_t* pTargetDev2,
+ OCProvisionResultCB resultCallback)
{
OIC_LOG(INFO, TAG, "IN OCUnlinkDevices");
OCUuidList_t* idList = NULL;
* credential revocation is finished.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCRemoveDevice(void* ctx, unsigned short waitTimeForOwnedDeviceDiscovery,
- const OCProvisionDev_t* pTargetDev,
- OCProvisionResultCB resultCallback)
+OCStackResult OC_CALL OCRemoveDevice(void* ctx, unsigned short waitTimeForOwnedDeviceDiscovery,
+ const OCProvisionDev_t* pTargetDev,
+ OCProvisionResultCB resultCallback)
{
OIC_LOG(INFO, TAG, "IN OCRemoveDevice");
OCStackResult res = OC_STACK_ERROR;
* credential revocation is finished.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCRemoveDeviceWithUuid(void* ctx, unsigned short waitTimeForOwnedDeviceDiscovery,
+OCStackResult OC_CALL OCRemoveDeviceWithUuid(void* ctx, unsigned short waitTimeForOwnedDeviceDiscovery,
const OicUuid_t* pTargetUuid,
OCProvisionResultCB resultCallback)
{
* credential revocation is finished.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCResetDevice(void* ctx, unsigned short waitTimeForOwnedDeviceDiscovery,
- const OCProvisionDev_t* pTargetDev,
- OCProvisionResultCB resultCallback)
+OCStackResult OC_CALL OCResetDevice(void* ctx, unsigned short waitTimeForOwnedDeviceDiscovery,
+ const OCProvisionDev_t* pTargetDev,
+ OCProvisionResultCB resultCallback)
{
OIC_LOG(INFO, TAG, "IN OCResetDevice");
OCStackResult res = OC_STACK_ERROR;
*
* @return OC_STACK_OK in case of successful reset and other value otherwise.
*/
-OCStackResult OCResetSVRDB(void)
+OCStackResult OC_CALL OCResetSVRDB(void)
{
return ResetSecureResourceInPS();
}
*
*@return OC_STACK_OK in case of successful configue and other value otherwise.
*/
-OCStackResult OCConfigSelfOwnership(void)
+OCStackResult OC_CALL OCConfigSelfOwnership(void)
{
return ConfigSelfOwnership();
}
* provisioning request recieves a response from first resource server.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCProvisionPairwiseDevices(void* ctx, OicSecCredType_t type, size_t keySize,
+OCStackResult OC_CALL OCProvisionPairwiseDevices(void* ctx, OicSecCredType_t type, size_t keySize,
const OCProvisionDev_t *pDev1, OicSecAcl_t *pDev1Acl,
const OCProvisionDev_t *pDev2, OicSecAcl_t *pDev2Acl,
OCProvisionResultCB resultCallback)
}
-OCStackResult OCGetDevInfoFromNetwork(unsigned short waittime,
- OCProvisionDev_t** pOwnedDevList,
- OCProvisionDev_t** pUnownedDevList)
+OCStackResult OC_CALL OCGetDevInfoFromNetwork(unsigned short waittime,
+ OCProvisionDev_t** pOwnedDevList,
+ OCProvisionDev_t** pUnownedDevList)
{
//TODO will be replaced by more efficient logic
if (pOwnedDevList == NULL || *pOwnedDevList != NULL || pUnownedDevList == NULL
return OC_STACK_OK;
}
-OCStackResult OCGetLinkedStatus(const OicUuid_t* uuidOfDevice, OCUuidList_t** uuidList,
- size_t* numOfDevices)
+OCStackResult OC_CALL OCGetLinkedStatus(const OicUuid_t* uuidOfDevice, OCUuidList_t** uuidList,
+ size_t* numOfDevices)
{
return PDMGetLinkedDevices(uuidOfDevice, uuidList, numOfDevices);
}
-OCStackResult OCRemoveCredential(const OicUuid_t* subjectUuid)
+OCStackResult OC_CALL OCRemoveCredential(const OicUuid_t* subjectUuid)
{
return RemoveCredential(subjectUuid);
}
-void OCDeleteUuidList(OCUuidList_t* pList)
+void OC_CALL OCDeleteUuidList(OCUuidList_t* pList)
{
PDMDestoryOicUuidLinkList(pList);
}
*
* @param pAcl Pointer to OicSecAcl_t structure.
*/
-void OCDeleteACLList(OicSecAcl_t* pAcl)
+void OC_CALL OCDeleteACLList(OicSecAcl_t* pAcl)
{
DeleteACLList(pAcl);
}
*
* @param pPdAcl Pointer to OicSecPdAcl_t structure.
*/
-void OCDeletePdAclList(OicSecPdAcl_t* pPdAcl)
+void OC_CALL OCDeletePdAclList(OicSecPdAcl_t* pPdAcl)
{
FreePdAclList(pPdAcl);
}
* POST 'mom' request recieves a response from resource server.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCChangeMOTMode(void *ctx, const OCProvisionDev_t *targetDeviceInfo,
- const OicSecMomType_t momType, OCProvisionResultCB resultCallback)
+OCStackResult OC_CALL OCChangeMOTMode(void *ctx, const OCProvisionDev_t *targetDeviceInfo,
+ const OicSecMomType_t momType, OCProvisionResultCB resultCallback)
{
return MOTChangeMode(ctx, targetDeviceInfo, momType, resultCallback);
}
* POST 'oxmsel' request recieves a response from resource server.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCSelectMOTMethod(void *ctx, const OCProvisionDev_t *targetDeviceInfo,
- const OicSecOxm_t oxmSelValue, OCProvisionResultCB resultCallback)
+OCStackResult OC_CALL OCSelectMOTMethod(void *ctx, const OCProvisionDev_t *targetDeviceInfo,
+ const OicSecOxm_t oxmSelValue, OCProvisionResultCB resultCallback)
{
return MOTSelectMOTMethod(ctx, targetDeviceInfo, oxmSelValue, resultCallback);
}
* @param[in] ownerType type of owner device (SUPER_OWNER or SUB_OWNER)
* @return OC_STACK_OK on success
*/
-OCStackResult OCSelectOwnershipTransferMethod(const OicSecOxm_t *supportedMethods,
+OCStackResult OC_CALL OCSelectOwnershipTransferMethod(const OicSecOxm_t *supportedMethods,
size_t numberOfMethods, OicSecOxm_t *selectedMethod, OwnerType_t ownerType)
{
return OTMSelectOwnershipTransferMethod(supportedMethods, numberOfMethods,
* provisioning request recieves a response from first resource server.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCProvisionTrustCertChain(void *ctx, OicSecCredType_t type, uint16_t credId,
- const OCProvisionDev_t *selectedDeviceInfo,
- OCProvisionResultCB resultCallback)
+OCStackResult OC_CALL OCProvisionTrustCertChain(void *ctx, OicSecCredType_t type, uint16_t credId,
+ const OCProvisionDev_t *selectedDeviceInfo,
+ OCProvisionResultCB resultCallback)
{
return SRPProvisionTrustCertChain(ctx, type, credId,
selectedDeviceInfo, resultCallback);
* @param[out] credId CredId of saved trust certificate chain in Cred of SVR.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCSaveTrustCertChain(const uint8_t *trustCertChain, size_t chainSize,
- OicEncodingType_t encodingType, uint16_t *credId)
+OCStackResult OC_CALL OCSaveTrustCertChain(const uint8_t *trustCertChain, size_t chainSize,
+ OicEncodingType_t encodingType, uint16_t *credId)
{
return SRPSaveTrustCertChain(trustCertChain, chainSize, encodingType, credId);
}
* @param[out] credId CredId of saved certificate chain in Cred of SVR.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCSaveOwnCertChain(const char* cert, const char* key, uint16_t *credId)
+OCStackResult OC_CALL OCSaveOwnCertChain(const char* cert, const char* key, uint16_t *credId)
{
OicSecKey_t ownCert = { 0 };
ownCert.data = (uint8_t*) cert;
* @note The certificate public key must be the same as public key in the identity
* certificate (installed by OCSaveOwnCertChain).
*/
-OCStackResult OCSaveOwnRoleCert(const char* cert, uint16_t *credId)
+OCStackResult OC_CALL OCSaveOwnRoleCert(const char* cert, uint16_t *credId)
{
OicSecKey_t ownCert = { 0 };
ownCert.data = (uint8_t*)cert;
* @param[in] TrustCertChainChangeCB notification callback fucntion.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
-OCStackResult OCRegisterTrustCertChainNotifier(void *ctx, TrustCertChainChangeCB Callback)
+OCStackResult OC_CALL OCRegisterTrustCertChainNotifier(void *ctx, TrustCertChainChangeCB Callback)
{
return SRPRegisterTrustCertChainNotifier(ctx, Callback);
}
/**
* function to de-register notifier for Trustcertchain change.
*/
-void OCRemoveTrustCertChainNotifier()
+void OC_CALL OCRemoveTrustCertChainNotifier()
{
SRPRemoveTrustCertChainNotifier();
}
return res;
}
-bool PMGenerateQuery(bool isSecure,
- const char* address, uint16_t port,
- OCConnectivityType connType,
- char* buffer, size_t bufferSize, const char* uri)
+bool OC_CALL PMGenerateQuery(bool isSecure,
+ const char* address, uint16_t port,
+ OCConnectivityType connType,
+ char* buffer, size_t bufferSize, const char* uri)
{
if(!address || !buffer || !uri)
{
return 0;
}
-OCStackResult OCGenerateRandomSerialNumber(char **serial, size_t *serialLen)
+OCStackResult OC_CALL OCGenerateRandomSerialNumber(char **serial, size_t *serialLen)
{
int ret = 0;
OCStackResult res = OC_STACK_ERROR;
return res;
}
-OCStackResult OCGenerateKeyPair(char **publicKey, size_t *publicKeyLen,
- char **privateKey, size_t *privateKeyLen)
+OCStackResult OC_CALL OCGenerateKeyPair(char **publicKey, size_t *publicKeyLen,
+ char **privateKey, size_t *privateKeyLen)
{
int ret = 0;
mbedtls_pk_context keyPair;
return res;
}
-OCStackResult OCGenerateCACertificate(
+OCStackResult OC_CALL OCGenerateCACertificate(
const char *subject,
const char *subjectPublicKey,
const char *issuerCert,
return res;
}
-OCStackResult OCGenerateIdentityCertificate(
+OCStackResult OC_CALL OCGenerateIdentityCertificate(
const OicUuid_t *subjectUuid,
const char *subjectPublicKey,
const char *issuerCert,
return res;
}
-OCStackResult OCGenerateRoleCertificate(
+OCStackResult OC_CALL OCGenerateRoleCertificate(
const OicUuid_t *subjectUuid,
const char *subjectPublicKey,
const char *issuerCert,
return ret;
}
-OCStackResult OCVerifyCSRSignature(const char* csr)
+OCStackResult OC_CALL OCVerifyCSRSignature(const char* csr)
{
mbedtls_x509_csr csrObj;
return OC_STACK_OK;
}
-OCStackResult OCGetUuidFromCSR(const char* csr, OicUuid_t* uuid)
+OCStackResult OC_CALL OCGetUuidFromCSR(const char* csr, OicUuid_t* uuid)
{
mbedtls_x509_csr csrObj;
return OC_STACK_OK;
}
-OCStackResult OCGetPublicKeyFromCSR(const char* csr, char** publicKey)
+OCStackResult OC_CALL OCGetPublicKeyFromCSR(const char* csr, char** publicKey)
{
mbedtls_x509_csr csrObj;
return OC_STACK_OK;
}
-OCStackResult OCConvertDerCSRToPem(const char* derCSR, size_t derCSRLen, char** pemCSR)
+OCStackResult OC_CALL OCConvertDerCSRToPem(const char* derCSR, size_t derCSRLen, char** pemCSR)
{
const char* pemHeader = "-----BEGIN CERTIFICATE REQUEST-----\n";
const char* pemFooter = "-----END CERTIFICATE REQUEST-----\n";
return OC_STACK_DELETE_TRANSACTION;
}
-OCStackResult OCAssertRoles(void *ctx, const OCDevAddr *devAddr, OCAssertRolesCB resultCallback)
+OCStackResult OC_CALL OCAssertRoles(void *ctx, const OCDevAddr *devAddr, OCAssertRolesCB resultCallback)
{
OIC_LOG_V(DEBUG, TAG, "In %s", __func__);
(UPPERCASE_CHAR_PIN & pinType));
}
-OCStackResult SetRandomPinPolicy(size_t pinSize, OicSecPinType_t pinType)
+OCStackResult OC_CALL SetRandomPinPolicy(size_t pinSize, OicSecPinType_t pinType)
{
if(OXM_RANDOM_PIN_MIN_SIZE > pinSize)
{
return OC_STACK_OK;
}
-void SetInputPinCB(InputPinCallback pinCB)
+void OC_CALL SetInputPinCB(InputPinCallback pinCB)
{
if(NULL == pinCB)
{
g_inputPinCallbacks.callback = pinCB;
}
-OCStackResult SetInputPinWithContextCB(InputPinCallbackWithContext inputPinCB, void* context)
+OCStackResult OC_CALL SetInputPinWithContextCB(InputPinCallbackWithContext inputPinCB, void* context)
{
if (NULL == inputPinCB)
{
return OC_STACK_OK;
}
-void SetGeneratePinCB(GeneratePinCallback pinCB)
+void OC_CALL SetGeneratePinCB(GeneratePinCallback pinCB)
{
if(NULL == pinCB)
{
g_displayPinCallbacks.callback = pinCB;
}
-OCStackResult SetDisplayPinWithContextCB(DisplayPinCallbackWithContext displayPinCB, void* context)
+OCStackResult OC_CALL SetDisplayPinWithContextCB(DisplayPinCallbackWithContext displayPinCB, void* context)
{
if (NULL == displayPinCB)
{
return OC_STACK_OK;
}
-void SetClosePinDisplayCB(ClosePinDisplayCallback closeCB)
+void OC_CALL SetClosePinDisplayCB(ClosePinDisplayCallback closeCB)
{
if (NULL == closeCB)
{
g_displayPinCallbacks.closePinDisplayCallback = closeCB;
}
-void UnsetInputPinCB()
+void OC_CALL UnsetInputPinCB()
{
UnsetInputPinWithContextCB();
}
-void UnsetInputPinWithContextCB()
+void OC_CALL UnsetInputPinWithContextCB()
{
g_inputPinCallbacks.callback = NULL;
g_inputPinCallbacks.contextCallback = NULL;
g_inputPinCallbacks.context = NULL;
}
-void UnsetGeneratePinCB()
+void OC_CALL UnsetGeneratePinCB()
{
UnsetDisplayPinWithContextCB();
}
-void UnsetDisplayPinWithContextCB()
+void OC_CALL UnsetDisplayPinWithContextCB()
{
g_displayPinCallbacks.callback = NULL;
g_displayPinCallbacks.contextCallback = NULL;
g_displayPinCallbacks.context = NULL;
}
-void UnsetClosePinDisplayCB()
+void OC_CALL UnsetClosePinDisplayCB()
{
g_displayPinCallbacks.closePinDisplayCallback = NULL;
}
return allowedCharacters[OCGetRandomRange(0, curIndex)];
}
-OCStackResult GeneratePin(char* pinBuffer, size_t bufferSize)
+OCStackResult OC_CALL GeneratePin(char* pinBuffer, size_t bufferSize)
{
if(!pinBuffer)
{
}
#ifdef MULTIPLE_OWNER
-OCStackResult SetPreconfigPin(const char *pinBuffer, size_t pinLength)
+OCStackResult OC_CALL SetPreconfigPin(const char *pinBuffer, size_t pinLength)
{
if(NULL == pinBuffer || OXM_PRECONFIG_PIN_MAX_SIZE < pinLength)
{
static DisplayNumContext_t gDisplayNumContext = { .callback = NULL, .context = NULL };
static UserConfirmContext_t gUserConfirmContext = { .callback = NULL, .context = NULL };
-void SetDisplayNumCB(void * ptr, DisplayNumCallback displayNumCB)
+void OC_CALL SetDisplayNumCB(void * ptr, DisplayNumCallback displayNumCB)
{
OIC_LOG(DEBUG, TAG, "IN SetDisplayNumCB");
if (NULL == displayNumCB)
OIC_LOG(DEBUG, TAG, "OUT SetDisplayNumCB");
}
-void* UnsetDisplayNumCB()
+void* OC_CALL UnsetDisplayNumCB()
{
OIC_LOG(DEBUG, TAG, "IN UnsetDisplayNumCB");
void *prevctx = gDisplayNumContext.context;
return prevctx;
}
-void SetUserConfirmCB(void * ptr, UserConfirmCallback userConfirmCB)
+void OC_CALL SetUserConfirmCB(void * ptr, UserConfirmCallback userConfirmCB)
{
OIC_LOG(DEBUG, TAG, "IN SetUserConfirmCB");
if (NULL == userConfirmCB)
OIC_LOG(DEBUG, TAG, "OUT SetUserConfirmCB");
}
-void* UnsetUserConfirmCB()
+void* OC_CALL UnsetUserConfirmCB()
{
OIC_LOG(DEBUG, TAG, "IN UnsetUserConfirmCB");
void *prevctx = gUserConfirmContext.context;
return prevctx;
}
-void SetVerifyOption(VerifyOptionBitmask_t verifyOption)
+void OC_CALL SetVerifyOption(VerifyOptionBitmask_t verifyOption)
{
OIC_LOG(DEBUG, TAG, "IN SetVerifyOption");
gVerifyOption = verifyOption;
OIC_LOG(DEBUG, TAG, "OUT SetVerifyOption");
}
-OCStackResult VerifyOwnershipTransfer(uint8_t mutualVerifNum [MUTUAL_VERIF_NUM_LEN],
+OCStackResult OC_CALL VerifyOwnershipTransfer(uint8_t mutualVerifNum [MUTUAL_VERIF_NUM_LEN],
VerifyOptionBitmask_t verifyOption)
{
OIC_LOG(DEBUG, TAG, "IN VerifyOwnershipTransfer");
return OC_STACK_NO_MEMORY;
}
-OCStackResult ConvertStrToUuid(const char* strUuid, OicUuid_t* uuid)
+OCStackResult OC_CALL ConvertStrToUuid(const char* strUuid, OicUuid_t* uuid)
{
bool result = true;
size_t strUuidLen = strlen(strUuid);
}
#if defined(__WITH_DTLS__) || defined (__WITH_TLS__)
-OCStackResult SetDeviceIdSeed(const uint8_t* seed, size_t seedSize)
+OCStackResult OC_CALL SetDeviceIdSeed(const uint8_t* seed, size_t seedSize)
{
return SetDoxmDeviceIDSeed(seed, seedSize);
}
*
* @return char pointer on success, NULL on failure.
*/
- char* OCCreateEndpointStringFromCA(const CAEndpoint_t* endpoint);
+ char* OC_CALL OCCreateEndpointStringFromCA(const CAEndpoint_t* endpoint);
/*
* This function parse endpoint string from payload.
* URI.
* @return pointer to found resource
*/
-OCResource *FindResourceByUri(const char* resourceUri);
+OCResource * OC_CALL FindResourceByUri(const char* resourceUri);
/**
* This function checks whether the specified resource URI aligns with a pre-existing
OCResourceProperty resourceProperties, uint8_t enable);
#endif
-const char *convertTriggerEnumToString(OCPresenceTrigger trigger);
+const char *OC_CALL convertTriggerEnumToString(OCPresenceTrigger trigger);
-OCPresenceTrigger convertTriggerStringToEnum(const char * triggerStr);
+OCPresenceTrigger OC_CALL convertTriggerStringToEnum(const char * triggerStr);
void CopyEndpointToDevAddr(const CAEndpoint_t *in, OCDevAddr *out);
#include <stdbool.h>
#include <inttypes.h>
#include "octypes.h"
+#include "platform_features.h"
#if defined(__WITH_TLS__) || defined(__WITH_DTLS__)
#include "securevirtualresourcetypes.h"
typedef struct OCResource OCResource;
-void OCPayloadDestroy(OCPayload* payload);
+void OC_CALL OCPayloadDestroy(OCPayload* payload);
// Representation Payload
-OCRepPayload* OCRepPayloadCreate();
+OCRepPayload* OC_CALL OCRepPayloadCreate();
-size_t calcDimTotal(const size_t dimensions[MAX_REP_ARRAY_DEPTH]);
+size_t OC_CALL calcDimTotal(const size_t dimensions[MAX_REP_ARRAY_DEPTH]);
-OCRepPayload* OCRepPayloadClone(const OCRepPayload* payload);
+OCRepPayload* OC_CALL OCRepPayloadClone(const OCRepPayload* payload);
-OCRepPayload* OCRepPayloadBatchClone(const OCRepPayload* repPayload);
+OCRepPayload* OC_CALL OCRepPayloadBatchClone(const OCRepPayload* repPayload);
-void OCRepPayloadAppend(OCRepPayload* parent, OCRepPayload* child);
+void OC_CALL OCRepPayloadAppend(OCRepPayload* parent, OCRepPayload* child);
-bool OCRepPayloadSetUri(OCRepPayload* payload, const char* uri);
+bool OC_CALL OCRepPayloadSetUri(OCRepPayload* payload, const char* uri);
-bool OCRepPayloadAddResourceType(OCRepPayload* payload, const char* resourceType);
-bool OCRepPayloadAddInterface(OCRepPayload* payload, const char* iface);
+bool OC_CALL OCRepPayloadAddResourceType(OCRepPayload* payload, const char* resourceType);
+bool OC_CALL OCRepPayloadAddInterface(OCRepPayload* payload, const char* iface);
-bool OCRepPayloadAddResourceTypeAsOwner(OCRepPayload* payload, char* resourceType);
-bool OCRepPayloadAddInterfaceAsOwner(OCRepPayload* payload, char* iface);
+bool OC_CALL OCRepPayloadAddResourceTypeAsOwner(OCRepPayload* payload, char* resourceType);
+bool OC_CALL OCRepPayloadAddInterfaceAsOwner(OCRepPayload* payload, char* iface);
-bool OCRepPayloadIsNull(const OCRepPayload* payload, const char* name);
-bool OCRepPayloadSetNull(OCRepPayload* payload, const char* name);
+bool OC_CALL OCRepPayloadIsNull(const OCRepPayload* payload, const char* name);
+bool OC_CALL OCRepPayloadSetNull(OCRepPayload* payload, const char* name);
-bool OCRepPayloadSetPropInt(OCRepPayload* payload, const char* name, int64_t value);
-bool OCRepPayloadGetPropInt(const OCRepPayload* payload, const char* name, int64_t* value);
+bool OC_CALL OCRepPayloadSetPropInt(OCRepPayload* payload, const char* name, int64_t value);
+bool OC_CALL OCRepPayloadGetPropInt(const OCRepPayload* payload, const char* name, int64_t* value);
-bool OCRepPayloadSetPropDouble(OCRepPayload* payload, const char* name, double value);
-bool OCRepPayloadGetPropDouble(const OCRepPayload* payload, const char* name, double* value);
+bool OC_CALL OCRepPayloadSetPropDouble(OCRepPayload* payload, const char* name, double value);
+bool OC_CALL OCRepPayloadGetPropDouble(const OCRepPayload* payload, const char* name, double* value);
/**
* This function allocates memory for the byte string and sets it in the payload.
*
* @return true on success, false upon failure.
*/
-bool OCRepPayloadSetPropByteString(OCRepPayload* payload, const char* name, OCByteString value);
+bool OC_CALL OCRepPayloadSetPropByteString(OCRepPayload* payload, const char* name, OCByteString value);
/**
* This function sets the byte string in the payload.
*
* @return true on success, false upon failure.
*/
-bool OCRepPayloadSetPropByteStringAsOwner(OCRepPayload* payload, const char* name,
+bool OC_CALL OCRepPayloadSetPropByteStringAsOwner(OCRepPayload* payload, const char* name,
OCByteString* value);
/**
*
* @return true on success, false upon failure.
*/
-bool OCRepPayloadGetPropByteString(const OCRepPayload* payload, const char* name,
+bool OC_CALL OCRepPayloadGetPropByteString(const OCRepPayload* payload, const char* name,
OCByteString* value);
-bool OCRepPayloadSetPropString(OCRepPayload* payload, const char* name, const char* value);
-bool OCRepPayloadSetPropStringAsOwner(OCRepPayload* payload, const char* name, char* value);
-bool OCRepPayloadGetPropString(const OCRepPayload* payload, const char* name, char** value);
+bool OC_CALL OCRepPayloadSetPropString(OCRepPayload* payload, const char* name, const char* value);
+bool OC_CALL OCRepPayloadSetPropStringAsOwner(OCRepPayload* payload, const char* name, char* value);
+bool OC_CALL OCRepPayloadGetPropString(const OCRepPayload* payload, const char* name, char** value);
-bool OCRepPayloadSetPropBool(OCRepPayload* payload, const char* name, bool value);
-bool OCRepPayloadGetPropBool(const OCRepPayload* payload, const char* name, bool* value);
+bool OC_CALL OCRepPayloadSetPropBool(OCRepPayload* payload, const char* name, bool value);
+bool OC_CALL OCRepPayloadGetPropBool(const OCRepPayload* payload, const char* name, bool* value);
-bool OCRepPayloadSetPropObject(OCRepPayload* payload, const char* name, const OCRepPayload* value);
-bool OCRepPayloadSetPropObjectAsOwner(OCRepPayload* payload, const char* name, OCRepPayload* value);
-bool OCRepPayloadGetPropObject(const OCRepPayload* payload, const char* name, OCRepPayload** value);
+bool OC_CALL OCRepPayloadSetPropObject(OCRepPayload* payload, const char* name, const OCRepPayload* value);
+bool OC_CALL OCRepPayloadSetPropObjectAsOwner(OCRepPayload* payload, const char* name, OCRepPayload* value);
+bool OC_CALL OCRepPayloadGetPropObject(const OCRepPayload* payload, const char* name, OCRepPayload** value);
#ifdef __WITH_TLS__
-bool OCRepPayloadSetPropPubDataType(OCRepPayload *payload, const char *name, const OicSecKey_t *value);
-bool OCRepPayloadSetPropPubDataTypeAsOwner(OCRepPayload *payload, const char *name, const OicSecKey_t *value);
-bool OCRepPayloadGetPropPubDataType(const OCRepPayload *payload, const char *name, OicSecKey_t *value);
+bool OC_CALL OCRepPayloadSetPropPubDataType(OCRepPayload *payload, const char *name, const OicSecKey_t *value);
+bool OC_CALL OCRepPayloadSetPropPubDataTypeAsOwner(OCRepPayload *payload, const char *name, const OicSecKey_t *value);
+bool OC_CALL OCRepPayloadGetPropPubDataType(const OCRepPayload *payload, const char *name, OicSecKey_t *value);
#endif
/**
*
* @return true on success, false upon failure.
*/
-bool OCRepPayloadSetByteStringArrayAsOwner(OCRepPayload* payload, const char* name,
+bool OC_CALL OCRepPayloadSetByteStringArrayAsOwner(OCRepPayload* payload, const char* name,
OCByteString* array, size_t dimensions[MAX_REP_ARRAY_DEPTH]);
/**
*
* @return true on success, false upon failure.
*/
-bool OCRepPayloadSetByteStringArray(OCRepPayload* payload, const char* name,
+bool OC_CALL OCRepPayloadSetByteStringArray(OCRepPayload* payload, const char* name,
const OCByteString* array, size_t dimensions[MAX_REP_ARRAY_DEPTH]);
/**
*
* @return true on success, false upon failure.
*/
-bool OCRepPayloadGetByteStringArray(const OCRepPayload* payload, const char* name,
+bool OC_CALL OCRepPayloadGetByteStringArray(const OCRepPayload* payload, const char* name,
OCByteString** array, size_t dimensions[MAX_REP_ARRAY_DEPTH]);
-bool OCRepPayloadSetIntArrayAsOwner(OCRepPayload* payload, const char* name,
+bool OC_CALL OCRepPayloadSetIntArrayAsOwner(OCRepPayload* payload, const char* name,
int64_t* array, size_t dimensions[MAX_REP_ARRAY_DEPTH]);
-bool OCRepPayloadSetIntArray(OCRepPayload* payload, const char* name,
+bool OC_CALL OCRepPayloadSetIntArray(OCRepPayload* payload, const char* name,
const int64_t* array, size_t dimensions[MAX_REP_ARRAY_DEPTH]);
-bool OCRepPayloadGetIntArray(const OCRepPayload* payload, const char* name,
+bool OC_CALL OCRepPayloadGetIntArray(const OCRepPayload* payload, const char* name,
int64_t** array, size_t dimensions[MAX_REP_ARRAY_DEPTH]);
-bool OCRepPayloadSetDoubleArrayAsOwner(OCRepPayload* payload, const char* name,
+bool OC_CALL OCRepPayloadSetDoubleArrayAsOwner(OCRepPayload* payload, const char* name,
double* array, size_t dimensions[MAX_REP_ARRAY_DEPTH]);
-bool OCRepPayloadSetDoubleArray(OCRepPayload* payload, const char* name,
+bool OC_CALL OCRepPayloadSetDoubleArray(OCRepPayload* payload, const char* name,
const double* array, size_t dimensions[MAX_REP_ARRAY_DEPTH]);
-bool OCRepPayloadGetDoubleArray(const OCRepPayload* payload, const char* name,
+bool OC_CALL OCRepPayloadGetDoubleArray(const OCRepPayload* payload, const char* name,
double** array, size_t dimensions[MAX_REP_ARRAY_DEPTH]);
-bool OCRepPayloadSetStringArrayAsOwner(OCRepPayload* payload, const char* name,
+bool OC_CALL OCRepPayloadSetStringArrayAsOwner(OCRepPayload* payload, const char* name,
char** array, size_t dimensions[MAX_REP_ARRAY_DEPTH]);
-bool OCRepPayloadSetStringArray(OCRepPayload* payload, const char* name,
+bool OC_CALL OCRepPayloadSetStringArray(OCRepPayload* payload, const char* name,
const char** array, size_t dimensions[MAX_REP_ARRAY_DEPTH]);
-bool OCRepPayloadGetStringArray(const OCRepPayload* payload, const char* name,
+bool OC_CALL OCRepPayloadGetStringArray(const OCRepPayload* payload, const char* name,
char*** array, size_t dimensions[MAX_REP_ARRAY_DEPTH]);
-bool OCRepPayloadSetBoolArrayAsOwner(OCRepPayload* payload, const char* name,
+bool OC_CALL OCRepPayloadSetBoolArrayAsOwner(OCRepPayload* payload, const char* name,
bool* array, size_t dimensions[MAX_REP_ARRAY_DEPTH]);
-bool OCRepPayloadSetBoolArray(OCRepPayload* payload, const char* name,
+bool OC_CALL OCRepPayloadSetBoolArray(OCRepPayload* payload, const char* name,
const bool* array, size_t dimensions[MAX_REP_ARRAY_DEPTH]);
-bool OCRepPayloadGetBoolArray(const OCRepPayload* payload, const char* name,
+bool OC_CALL OCRepPayloadGetBoolArray(const OCRepPayload* payload, const char* name,
bool** array, size_t dimensions[MAX_REP_ARRAY_DEPTH]);
-bool OCRepPayloadSetPropObjectArrayAsOwner(OCRepPayload* payload, const char* name,
+bool OC_CALL OCRepPayloadSetPropObjectArrayAsOwner(OCRepPayload* payload, const char* name,
OCRepPayload** array, size_t dimensions[MAX_REP_ARRAY_DEPTH]);
-bool OCRepPayloadSetPropObjectArray(OCRepPayload* payload, const char* name,
+bool OC_CALL OCRepPayloadSetPropObjectArray(OCRepPayload* payload, const char* name,
const OCRepPayload** array, size_t dimensions[MAX_REP_ARRAY_DEPTH]);
-bool OCRepPayloadGetPropObjectArray(const OCRepPayload* payload, const char* name,
+bool OC_CALL OCRepPayloadGetPropObjectArray(const OCRepPayload* payload, const char* name,
OCRepPayload*** array, size_t dimensions[MAX_REP_ARRAY_DEPTH]);
-void OCRepPayloadDestroy(OCRepPayload* payload);
+void OC_CALL OCRepPayloadDestroy(OCRepPayload* payload);
// Discovery Payload
-OCDiscoveryPayload* OCDiscoveryPayloadCreate();
+OCDiscoveryPayload* OC_CALL OCDiscoveryPayloadCreate();
-OCSecurityPayload* OCSecurityPayloadCreate(const uint8_t* securityData, size_t size);
-void OCSecurityPayloadDestroy(OCSecurityPayload* payload);
+OCSecurityPayload* OC_CALL OCSecurityPayloadCreate(const uint8_t* securityData, size_t size);
+void OC_CALL OCSecurityPayloadDestroy(OCSecurityPayload* payload);
-OCIntrospectionPayload* OCIntrospectionPayloadCreateFromCbor(const uint8_t* cborData,
+OCIntrospectionPayload* OC_CALL OCIntrospectionPayloadCreateFromCbor(const uint8_t* cborData,
size_t size);
-void OCIntrospectionPayloadDestroy(OCIntrospectionPayload* payload);
+void OC_CALL OCIntrospectionPayloadDestroy(OCIntrospectionPayload* payload);
#ifndef TCP_ADAPTER
-void OCDiscoveryPayloadAddResource(OCDiscoveryPayload* payload, const OCResource* res,
+void OC_CALL OCDiscoveryPayloadAddResource(OCDiscoveryPayload* payload, const OCResource* res,
uint16_t securePort);
#else
-void OCDiscoveryPayloadAddResource(OCDiscoveryPayload* payload, const OCResource* res,
+void OC_CALL OCDiscoveryPayloadAddResource(OCDiscoveryPayload* payload, const OCResource* res,
uint16_t securePort, uint16_t tcpPort);
#endif
-void OCDiscoveryPayloadAddNewResource(OCDiscoveryPayload* payload,
+void OC_CALL OCDiscoveryPayloadAddNewResource(OCDiscoveryPayload* payload,
OCResourcePayload* res);
-bool OCResourcePayloadAddStringLL(OCStringLL **payload, const char* type);
+bool OC_CALL OCResourcePayloadAddStringLL(OCStringLL **payload, const char* type);
-size_t OCDiscoveryPayloadGetResourceCount(OCDiscoveryPayload* payload);
-OCResourcePayload* OCDiscoveryPayloadGetResource(OCDiscoveryPayload* payload,
+size_t OC_CALL OCDiscoveryPayloadGetResourceCount(OCDiscoveryPayload* payload);
+OCResourcePayload* OC_CALL OCDiscoveryPayloadGetResource(OCDiscoveryPayload* payload,
size_t index);
-size_t OCEndpointPayloadGetEndpointCount(OCEndpointPayload* payload);
-OCEndpointPayload* OCEndpointPayloadGetEndpoint(OCEndpointPayload* payload,
+size_t OC_CALL OCEndpointPayloadGetEndpointCount(OCEndpointPayload* payload);
+OCEndpointPayload* OC_CALL OCEndpointPayloadGetEndpoint(OCEndpointPayload* payload,
size_t index);
-void OCResourcePayloadAddNewEndpoint(OCResourcePayload* payload,
+void OC_CALL OCResourcePayloadAddNewEndpoint(OCResourcePayload* payload,
OCEndpointPayload* endpoint);
-void OCDiscoveryEndpointDestroy(OCEndpointPayload* payload);
-void OCDiscoveryResourceDestroy(OCResourcePayload* payload);
-void OCDiscoveryPayloadDestroy(OCDiscoveryPayload* payload);
+void OC_CALL OCDiscoveryEndpointDestroy(OCEndpointPayload* payload);
+void OC_CALL OCDiscoveryResourceDestroy(OCResourcePayload* payload);
+void OC_CALL OCDiscoveryPayloadDestroy(OCDiscoveryPayload* payload);
// Presence Payload
-OCPresencePayload* OCPresencePayloadCreate(uint32_t seqNum, uint32_t maxAge,
+OCPresencePayload* OC_CALL OCPresencePayloadCreate(uint32_t seqNum, uint32_t maxAge,
OCPresenceTrigger trigger, const char* resourceType);
-void OCPresencePayloadDestroy(OCPresencePayload* payload);
+void OC_CALL OCPresencePayloadDestroy(OCPresencePayload* payload);
// Diagnostic Payload
-OCDiagnosticPayload* OCDiagnosticPayloadCreate(const char *message);
-void OCDiagnosticPayloadDestroy(OCDiagnosticPayload* payload);
+OCDiagnosticPayload* OC_CALL OCDiagnosticPayloadCreate(const char *message);
+void OC_CALL OCDiagnosticPayloadDestroy(OCDiagnosticPayload* payload);
// Helper API
-OCStringLL* CloneOCStringLL (OCStringLL* ll);
-void OCFreeOCStringLL(OCStringLL* ll);
+OCStringLL* OC_CALL CloneOCStringLL (OCStringLL* ll);
+void OC_CALL OCFreeOCStringLL(OCStringLL* ll);
/**
* This function creates a list from a string (with separated contents if several)
* @return newly allocated linked list
* @note separator is ',' (according to rfc4180, ';' is not valid)
**/
-OCStringLL* OCCreateOCStringLL(const char* text);
+OCStringLL* OC_CALL OCCreateOCStringLL(const char* text);
/**
* This function creates a string from a list (with separated contents if several)
* @return newly allocated string. Caller takes ownership and must later free this memory with OICFree.
* @note separator is ',' (according to rfc4180)
**/
-char* OCCreateString(const OCStringLL* ll);
+char* OC_CALL OCCreateString(const OCStringLL* ll);
/**
* This function copies contents (and allocates if necessary)
* @param source existing bytestring
* @return true of success false on any errors
**/
-bool OCByteStringCopy(OCByteString *dest, const OCByteString *source);
+bool OC_CALL OCByteStringCopy(OCByteString *dest, const OCByteString *source);
/**
* This function creates the payloadValue for links parameter of collection resource.
*
* @return ::OC_STACK_OK if successful or else other value.
*/
-OCStackResult OCLinksPayloadValueCreate(const char *resourceUri,
+OCStackResult OC_CALL OCLinksPayloadValueCreate(const char *resourceUri,
OCRepPayloadValue **linksRepPayloadValue, OCDevAddr *devAddr);
#ifdef __cplusplus
#include <stdint.h>
#include "octypes.h"
+#include "platform_features.h"
+
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
*
* @return ::OC_STACK_OK on success, some other value upon failure.
*/
-OCStackResult OCInit1(OCMode mode, OCTransportFlags serverFlags, OCTransportFlags clientFlags);
+OCStackResult OC_CALL OCInit1(OCMode mode, OCTransportFlags serverFlags, OCTransportFlags clientFlags);
/**
* This function Initializes the OC Stack. Must be called prior to starting the stack.
*
* @return ::OC_STACK_OK on success, some other value upon failure.
*/
-OCStackResult OCInit2(OCMode mode, OCTransportFlags serverFlags, OCTransportFlags clientFlags,
+OCStackResult OC_CALL OCInit2(OCMode mode, OCTransportFlags serverFlags, OCTransportFlags clientFlags,
OCTransportAdapter transportType);
/**
*
* @return ::OC_STACK_OK on success, some other value upon failure.
*/
-OCStackResult OCInit(const char *ipAddr, uint16_t port, OCMode mode);
+OCStackResult OC_CALL OCInit(const char *ipAddr, uint16_t port, OCMode mode);
#ifdef RA_ADAPTER
/**
*
* @return ::OC_STACK_OK on success, some other value upon failure.
*/
-OCStackResult OCSetRAInfo(const OCRAInfo_t *raInfo);
+OCStackResult OC_CALL OCSetRAInfo(const OCRAInfo_t *raInfo);
#endif
/**
*
* @return ::OC_STACK_OK on success, some other value upon failure.
*/
-OCStackResult OCStop();
+OCStackResult OC_CALL OCStop();
/**
* This function starts responding to multicast /oic/res requests. This can be
*
* @return ::OC_STACK_OK on success, some other value upon failure.
*/
-OCStackResult OCStartMulticastServer();
+OCStackResult OC_CALL OCStartMulticastServer();
/**
* This function stops responding to multicast /oic/res requests. This is to be
*
* @return ::OC_STACK_OK on success, some other value upon failure.
*/
-OCStackResult OCStopMulticastServer();
+OCStackResult OC_CALL OCStopMulticastServer();
/**
* This function is Called in main loop of OC client or server.
*
* @return ::OC_STACK_OK on success, some other value upon failure.
*/
-OCStackResult OCProcess();
+OCStackResult OC_CALL OCProcess();
/**
* This function discovers or Perform requests on a specified resource
*
* @return ::OC_STACK_OK on success, some other value upon failure.
*/
-OCStackResult OCDoResource(OCDoHandle *handle,
+OCStackResult OC_CALL OCDoResource(OCDoHandle *handle,
OCMethod method,
const char *requestUri,
const OCDevAddr *destination,
*
* @return ::OC_STACK_OK on success, some other value upon failure.
*/
-OCStackResult OCDoRequest(OCDoHandle *handle,
+OCStackResult OC_CALL OCDoRequest(OCDoHandle *handle,
OCMethod method,
const char *requestUri,
const OCDevAddr *destination,
*
* @return ::OC_STACK_OK on success, some other value upon failure.
*/
-OCStackResult OCCancel(OCDoHandle handle,
+OCStackResult OC_CALL OCCancel(OCDoHandle handle,
OCQualityOfService qos,
OCHeaderOption * options,
uint8_t numOptions);
* OC_STACK_OK No errors; Success.
* OC_STACK_INVALID_PARAM Invalid parameter.
*/
-OCStackResult OCRegisterPersistentStorageHandler(OCPersistentStorage* persistentStorageHandler);
+OCStackResult OC_CALL OCRegisterPersistentStorageHandler(OCPersistentStorage* persistentStorageHandler);
#ifdef WITH_PRESENCE
/**
*
* @return ::OC_STACK_OK on success, some other value upon failure.
*/
-OCStackResult OCStartPresence(const uint32_t ttl);
+OCStackResult OC_CALL OCStartPresence(const uint32_t ttl);
/**
* When operating in OCServer or OCClientServer mode, this API will stop sending
* @return ::OC_STACK_OK on success, some other value upon failure.
*/
-OCStackResult OCStopPresence();
+OCStackResult OC_CALL OCStopPresence();
#endif
*
* @return ::OC_STACK_OK on success, some other value upon failure.
*/
-OCStackResult OCSetDefaultDeviceEntityHandler(OCDeviceEntityHandler entityHandler,
+OCStackResult OC_CALL OCSetDefaultDeviceEntityHandler(OCDeviceEntityHandler entityHandler,
void* callbackParameter);
/**
* ::OC_STACK_INVALID_PARAM invalid parameter.
* ::OC_STACK_ERROR stack process error.
*/
-OCStackResult OCSetDeviceInfo(OCDeviceInfo deviceInfo);
+OCStackResult OC_CALL OCSetDeviceInfo(OCDeviceInfo deviceInfo);
/**
* This function sets platform information.
* ::OC_STACK_INVALID_PARAM invalid parameter.
* ::OC_STACK_ERROR stack process error.
*/
-OCStackResult OCSetPlatformInfo(OCPlatformInfo platformInfo);
+OCStackResult OC_CALL OCSetPlatformInfo(OCPlatformInfo platformInfo);
/**
* This function creates a resource.
*
* @return ::OC_STACK_OK on success, some other value upon failure.
*/
-OCStackResult OCCreateResource(OCResourceHandle *handle,
+OCStackResult OC_CALL OCCreateResource(OCResourceHandle *handle,
const char *resourceTypeName,
const char *resourceInterfaceName,
const char *uri,
*
* @return ::OC_STACK_OK on success, some other value upon failure.
*/
-OCStackResult OCCreateResourceWithEp(OCResourceHandle *handle,
+OCStackResult OC_CALL OCCreateResourceWithEp(OCResourceHandle *handle,
const char *resourceTypeName,
const char *resourceInterfaceName,
const char *uri,
*
* @return Bit combinations of supported OCTpsSchemeFlags.
*/
-OCTpsSchemeFlags OCGetSupportedEndpointTpsFlags();
+OCTpsSchemeFlags OC_CALL OCGetSupportedEndpointTpsFlags();
/**
* This function adds a resource to a collection resource.
*
* @return ::OC_STACK_OK on success, some other value upon failure.
*/
-OCStackResult OCBindResource(OCResourceHandle collectionHandle, OCResourceHandle resourceHandle);
+OCStackResult OC_CALL OCBindResource(OCResourceHandle collectionHandle, OCResourceHandle resourceHandle);
/**
* This function removes a resource from a collection resource.
*
* @return ::OC_STACK_OK on success, some other value upon failure.
*/
-OCStackResult OCUnBindResource(OCResourceHandle collectionHandle, OCResourceHandle resourceHandle);
+OCStackResult OC_CALL OCUnBindResource(OCResourceHandle collectionHandle, OCResourceHandle resourceHandle);
/**
* This function binds a resource type to a resource.
*
* @return ::OC_STACK_OK on success, some other value upon failure.
*/
-OCStackResult OCBindResourceTypeToResource(OCResourceHandle handle,
+OCStackResult OC_CALL OCBindResourceTypeToResource(OCResourceHandle handle,
const char *resourceTypeName);
/**
* This function binds a resource interface to a resource.
*
* @return ::OC_STACK_OK on success, some other value upon failure.
*/
-OCStackResult OCBindResourceInterfaceToResource(OCResourceHandle handle,
+OCStackResult OC_CALL OCBindResourceInterfaceToResource(OCResourceHandle handle,
const char *resourceInterfaceName);
/**
*
* @return ::OC_STACK_OK on success, some other value upon failure.
*/
-OCStackResult OCBindResourceHandler(OCResourceHandle handle,
+OCStackResult OC_CALL OCBindResourceHandler(OCResourceHandle handle,
OCEntityHandler entityHandler,
void *callbackParameter);
*
* @return ::OC_STACK_OK on success, some other value upon failure.
*/
-OCStackResult OCGetNumberOfResources(uint8_t *numResources);
+OCStackResult OC_CALL OCGetNumberOfResources(uint8_t *numResources);
/**
* This function gets a resource handle by index.
*
* @return Found resource handle or NULL if not found.
*/
-OCResourceHandle OCGetResourceHandle(uint8_t index);
+OCResourceHandle OC_CALL OCGetResourceHandle(uint8_t index);
/**
* This function deletes resource specified by handle. Deletes resource and all
*
* @return ::OC_STACK_OK on success, some other value upon failure.
*/
-OCStackResult OCDeleteResource(OCResourceHandle handle);
+OCStackResult OC_CALL OCDeleteResource(OCResourceHandle handle);
/**
* Get a string representation the server instance ID.
*
* @return A string representation the server instance ID.
*/
-const char* OCGetServerInstanceIDString(void);
+const char* OC_CALL OCGetServerInstanceIDString(void);
/**
* This function gets the URI of the resource specified by handle.
*
* @return URI string if resource found or NULL if not found.
*/
-const char *OCGetResourceUri(OCResourceHandle handle);
+const char *OC_CALL OCGetResourceUri(OCResourceHandle handle);
/**
* This function gets the properties of the resource specified by handle.
* @note that after a resource is created, the OC_ACTIVE property is set for the resource by the
* stack.
*/
-OCResourceProperty OCGetResourceProperties(OCResourceHandle handle);
+OCResourceProperty OC_CALL OCGetResourceProperties(OCResourceHandle handle);
/**
* This function sets the properties of the resource specified by handle.
*
* @return ::OC_STACK_OK on success, some other value upon failure.
*/
-OCStackResult OCSetResourceProperties(OCResourceHandle handle, uint8_t resourceProperties);
+OCStackResult OC_CALL OCSetResourceProperties(OCResourceHandle handle, uint8_t resourceProperties);
/**
* This function removes the properties of the resource specified by handle.
*
* @return ::OC_STACK_OK on success, some other value upon failure.
*/
-OCStackResult OCClearResourceProperties(OCResourceHandle handle, uint8_t resourceProperties);
+OCStackResult OC_CALL OCClearResourceProperties(OCResourceHandle handle, uint8_t resourceProperties);
/**
* This function gets the number of resource types of the resource.
*
* @return ::OC_STACK_OK on success, some other value upon failure.
*/
-OCStackResult OCGetNumberOfResourceTypes(OCResourceHandle handle, uint8_t *numResourceTypes);
+OCStackResult OC_CALL OCGetNumberOfResourceTypes(OCResourceHandle handle, uint8_t *numResourceTypes);
/**
* This function gets name of resource type of the resource.
*
* @return Resource type name if resource found or NULL if resource not found.
*/
-const char *OCGetResourceTypeName(OCResourceHandle handle, uint8_t index);
+const char *OC_CALL OCGetResourceTypeName(OCResourceHandle handle, uint8_t index);
/**
* This function gets the number of resource interfaces of the resource.
*
* @return ::OC_STACK_OK on success, some other value upon failure.
*/
-OCStackResult OCGetNumberOfResourceInterfaces(OCResourceHandle handle,
+OCStackResult OC_CALL OCGetNumberOfResourceInterfaces(OCResourceHandle handle,
uint8_t *numResourceInterfaces);
/**
*
* @return Resource interface name if resource found or NULL if resource not found.
*/
-const char *OCGetResourceInterfaceName(OCResourceHandle handle, uint8_t index);
+const char *OC_CALL OCGetResourceInterfaceName(OCResourceHandle handle, uint8_t index);
/**
* This function gets resource handle from the collection resource by index.
*
* @return Handle to contained resource if resource found or NULL if resource not found.
*/
-OCResourceHandle OCGetResourceHandleFromCollection(OCResourceHandle collectionHandle,
+OCResourceHandle OC_CALL OCGetResourceHandleFromCollection(OCResourceHandle collectionHandle,
uint8_t index);
/**
*
* @return Entity handler if resource found or NULL resource not found.
*/
-OCEntityHandler OCGetResourceHandler(OCResourceHandle handle);
+OCEntityHandler OC_CALL OCGetResourceHandler(OCResourceHandle handle);
/**
* This function notify all registered observers that the resource representation has
*
* @return ::OC_STACK_OK on success, some other value upon failure.
*/
-OCStackResult OCNotifyAllObservers(OCResourceHandle handle, OCQualityOfService qos);
+OCStackResult OC_CALL OCNotifyAllObservers(OCResourceHandle handle, OCQualityOfService qos);
/**
* Notify specific observers with updated value of representation.
*
* @return ::OC_STACK_OK on success, some other value upon failure.
*/
-OCStackResult OCNotifyListOfObservers (OCResourceHandle handle,
+OCStackResult OC_CALL OCNotifyListOfObservers (OCResourceHandle handle,
OCObservationId *obsIdList,
uint8_t numberOfIds,
const OCRepPayload *payload,
*
* @return ::OC_STACK_OK on success, some other value upon failure.
*/
-OCStackResult OCDoResponse(OCEntityHandlerResponse *response);
+OCStackResult OC_CALL OCDoResponse(OCEntityHandlerResponse *response);
//#ifdef DIRECT_PAIRING
/**
* client before returning the list of devices.
* @return OCDirectPairingDev_t pointer in case of success and NULL otherwise.
*/
-const OCDPDev_t* OCDiscoverDirectPairingDevices(unsigned short waittime);
+const OCDPDev_t* OC_CALL OCDiscoverDirectPairingDevices(unsigned short waittime);
/**
* The function is responsible for return of paired device list via direct-pairing. It will list
*
* @return OCDirectPairingDev_t pointer in case of success and NULL otherwise.
*/
-const OCDPDev_t* OCGetDirectPairedDevices();
+const OCDPDev_t* OC_CALL OCGetDirectPairedDevices();
/**
* The function is responsible for establishment of direct-pairing. It will proceed mode negotiation
* @param[in] resultCallback Callback fucntion to event status of process.
* @return OTM_SUCCESS in case of success and other value otherwise.
*/
-OCStackResult OCDoDirectPairing(void *ctx, OCDPDev_t* peer, OCPrm_t pmSel, char *pinNumber,
+OCStackResult OC_CALL OCDoDirectPairing(void *ctx, OCDPDev_t* peer, OCPrm_t pmSel, char *pinNumber,
OCDirectPairingCB resultCallback);
//#endif // DIRECT_PAIRING
*
* @param uri NULL terminated resource uri for CoAP-HTTP Proxy.
*/
-OCStackResult OCSetProxyURI(const char *uri);
+OCStackResult OC_CALL OCSetProxyURI(const char *uri);
#if defined(RD_CLIENT) || defined(RD_SERVER)
/**
*
* @return ::OC_STACK_OK on success, some other value upon failure.
*/
-OCStackResult OCBindResourceInsToResource(OCResourceHandle handle, int64_t ins);
+OCStackResult OC_CALL OCBindResourceInsToResource(OCResourceHandle handle, int64_t ins);
/**
* This function gets the resource unique id for a resource.
*
* @return Ins if resource found or 0 resource not found.
*/
-OCStackResult OCGetResourceIns(OCResourceHandle handle, int64_t *ins);
+OCStackResult OC_CALL OCGetResourceIns(OCResourceHandle handle, int64_t *ins);
#ifdef RD_SERVER
/**
*
* @return ::OC_STACK_OK on success, some other value upon failure.
*/
-OCStackResult OCRDDatabaseSetStorageFilename(const char *filename);
+OCStackResult OC_CALL OCRDDatabaseSetStorageFilename(const char *filename);
/**
* Returns the filename to be used for database persistent storage.
*
* @return the filename
*/
-const char *OCRDDatabaseGetStorageFilename();
+const char *OC_CALL OCRDDatabaseGetStorageFilename();
/**
* Search the RD database for queries.
*
* @return ::OC_STACK_OK in case of success or else other value.
*/
-OCStackResult OCRDDatabaseDiscoveryPayloadCreate(const char *interfaceType,
+OCStackResult OC_CALL OCRDDatabaseDiscoveryPayloadCreate(const char *interfaceType,
const char *resourceType,
OCDiscoveryPayload **discPayload);
#endif // RD_SERVER
*
* @return Found resource handle or NULL if not found.
*/
-OCResourceHandle OCGetResourceHandleAtUri(const char *uri);
+OCResourceHandle OC_CALL 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,
+OCStackResult OC_CALL OCSetHeaderOption(OCHeaderOption* ocHdrOpt,
size_t* numOptions,
uint16_t optionID,
void* optionData,
*
* @return ::OC_STACK_OK on success and other value otherwise.
*/
-OCStackResult OCGetHeaderOption(OCHeaderOption* ocHdrOpt,
+OCStackResult OC_CALL OCGetHeaderOption(OCHeaderOption* ocHdrOpt,
size_t numOptions,
uint16_t optionID,
void* optionData,
* @param deviceId pointer.
* @return Returns ::OC_STACK_OK if success.
*/
-OCStackResult OCGetDeviceId(OCUUIdentity *deviceId);
+OCStackResult OC_CALL OCGetDeviceId(OCUUIdentity *deviceId);
/**
* sets the deviceId of the client
* @param deviceId pointer.
* @return Returns ::OC_STACK_OK if success.
*/
-OCStackResult OCSetDeviceId(const OCUUIdentity *deviceId);
+OCStackResult OC_CALL OCSetDeviceId(const OCUUIdentity *deviceId);
/**
* Gets the bool state of "isOwned" property on the doxm resource.
* @param isOwned a pointer to be assigned to isOwned property
* @return Returns ::OC_STACK_OK if success.
*/
-OCStackResult OCGetDeviceOwnedState(bool *isOwned);
+OCStackResult OC_CALL OCGetDeviceOwnedState(bool *isOwned);
/**
* Encode an address string to match RFC 6874.
*
* @return ::OC_STACK_OK on success and other value otherwise.
*/
-OCStackResult OCEncodeAddressForRFC6874(char* outputAddress,
+OCStackResult OC_CALL OCEncodeAddressForRFC6874(char* outputAddress,
size_t outputSize,
const char* inputAddress);
*
* @return ::OC_STACK_OK on success and other value otherwise.
*/
-OCStackResult OCDecodeAddressForRFC6874(char* outputAddress,
+OCStackResult OC_CALL OCDecodeAddressForRFC6874(char* outputAddress,
size_t outputSize,
const char* inputAddress,
const char* end);
*
* @return ::OC_STACK_OK on success and other value otherwise.
*/
-OCStackResult OCSetPropertyValue(OCPayloadType type, const char *propName, const void *value);
+OCStackResult OC_CALL OCSetPropertyValue(OCPayloadType type, const char *propName, const void *value);
/**
* Get the value of /oic/d and /oic/p properties. This function is a generic function that gets the
*
* @return ::OC_STACK_OK on success and other value otherwise.
*/
-OCStackResult OCGetPropertyValue(OCPayloadType type, const char *propName, void **value);
+OCStackResult OC_CALL OCGetPropertyValue(OCPayloadType type, const char *propName, void **value);
/**
* Get the registered persistent storage handler. All modules must use this to obtain access to
*
* @return pointer to OCPersistentStorage structure on success and NULL otherwise.
*/
-OCPersistentStorage *OCGetPersistentStorageHandler();
+OCPersistentStorage *OC_CALL OCGetPersistentStorageHandler();
/**
* This function return link local zone id related from ifindex.
* zoneId using OICFree() when it returned CA_STATUS_OK.
* @return ::OC_STACK_OK if successful.
*/
-OCStackResult OCGetLinkLocalZoneId(uint32_t ifindex, char **zoneId);
+OCStackResult OC_CALL OCGetLinkLocalZoneId(uint32_t ifindex, char **zoneId);
/**
* Select the cipher suite for dtls handshake.
*
* @return ::OC_STACK_OK if successful.
*/
-OCStackResult OCSelectCipherSuite(uint16_t cipher, OCTransportAdapter adapterType);
+OCStackResult OC_CALL OCSelectCipherSuite(uint16_t cipher, OCTransportAdapter adapterType);
/**
* Return the scope level of a given IP address.
*
* @return ::OC_STACK_OK if successful.
*/
-OCStackResult OCGetIpv6AddrScope(const char *addr, OCTransportFlags *scope);
+OCStackResult OC_CALL OCGetIpv6AddrScope(const char *addr, OCTransportFlags *scope);
#ifdef __cplusplus
}
#define OIC_LOG_PAYLOAD(level, payload) OCPayloadLog((level),(payload))
#define UUID_SIZE (16)
-const char *convertTriggerEnumToString(OCPresenceTrigger trigger);
-OCPresenceTrigger convertTriggerStringToEnum(const char * triggerStr);
+const char *OC_CALL convertTriggerEnumToString(OCPresenceTrigger trigger);
+OCPresenceTrigger OC_CALL convertTriggerStringToEnum(const char * triggerStr);
INLINE_API void OCPayloadLogRep(LogLevel level, OCRepPayload* payload);
return NULL;
}
-char* OCCreateEndpointStringFromCA(const CAEndpoint_t* endpoint)
+char* OC_CALL OCCreateEndpointStringFromCA(const CAEndpoint_t* endpoint)
{
if (!endpoint || 0 == strlen(endpoint->addr))
{
static void OCFreeRepPayloadValueContents(OCRepPayloadValue* val);
-void OCPayloadDestroy(OCPayload* payload)
+void OC_CALL OCPayloadDestroy(OCPayload* payload)
{
if (!payload)
{
}
}
-OCRepPayload* OCRepPayloadCreate()
+OCRepPayload* OC_CALL OCRepPayloadCreate()
{
OCRepPayload* payload = (OCRepPayload*)OICCalloc(1, sizeof(OCRepPayload));
return payload;
}
-void OCRepPayloadAppend(OCRepPayload* parent, OCRepPayload* child)
+void OC_CALL OCRepPayloadAppend(OCRepPayload* parent, OCRepPayload* child)
{
if (!parent)
{
child->next = NULL;
}
-static OCRepPayloadValue* OCRepPayloadFindValue(const OCRepPayload* payload, const char* name)
+static OCRepPayloadValue* OC_CALL OCRepPayloadFindValue(const OCRepPayload* payload, const char* name)
{
if (!payload || !name)
{
return NULL;
}
-static void OCCopyPropertyValueArray(OCRepPayloadValue* dest, OCRepPayloadValue* source)
+static void OC_CALL OCCopyPropertyValueArray(OCRepPayloadValue* dest, OCRepPayloadValue* source)
{
if (!dest || !source)
{
return;
}
-static void OCCopyPropertyValue (OCRepPayloadValue *dest, OCRepPayloadValue *source)
+static void OC_CALL OCCopyPropertyValue (OCRepPayloadValue *dest, OCRepPayloadValue *source)
{
if (!source || !dest)
{
}
}
-static void OCFreeRepPayloadValue(OCRepPayloadValue* val)
+static void OC_CALL OCFreeRepPayloadValue(OCRepPayloadValue* val)
{
if (!val)
{
OCFreeRepPayloadValue(val->next);
OICFree(val);
}
-static OCRepPayloadValue* OCRepPayloadValueClone (OCRepPayloadValue* source)
+static OCRepPayloadValue* OC_CALL OCRepPayloadValueClone (OCRepPayloadValue* source)
{
if (!source)
{
return headOfClone;
}
-static OCRepPayloadValue* OCRepPayloadFindAndSetValue(OCRepPayload* payload, const char* name,
+static OCRepPayloadValue* OC_CALL OCRepPayloadFindAndSetValue(OCRepPayload* payload, const char* name,
OCRepPayloadPropType type)
{
if (!payload || !name)
return NULL;
}
-bool OCRepPayloadAddResourceType(OCRepPayload* payload, const char* resourceType)
+bool OC_CALL OCRepPayloadAddResourceType(OCRepPayload* payload, const char* resourceType)
{
return OCRepPayloadAddResourceTypeAsOwner(payload, OICStrdup(resourceType));
}
-bool OCRepPayloadAddResourceTypeAsOwner(OCRepPayload* payload, char* resourceType)
+bool OC_CALL OCRepPayloadAddResourceTypeAsOwner(OCRepPayload* payload, char* resourceType)
{
if (!payload || !resourceType)
{
}
}
-bool OCRepPayloadAddInterface(OCRepPayload* payload, const char* iface)
+bool OC_CALL OCRepPayloadAddInterface(OCRepPayload* payload, const char* iface)
{
return OCRepPayloadAddInterfaceAsOwner(payload, OICStrdup(iface));
}
-bool OCRepPayloadAddInterfaceAsOwner(OCRepPayload* payload, char* iface)
+bool OC_CALL OCRepPayloadAddInterfaceAsOwner(OCRepPayload* payload, char* iface)
{
if (!payload || !iface)
{
}
}
-bool OCRepPayloadSetUri(OCRepPayload* payload, const char* uri)
+bool OC_CALL OCRepPayloadSetUri(OCRepPayload* payload, const char* uri)
{
if (!payload)
{
return payload->uri != NULL;
}
-bool OCRepPayloadIsNull(const OCRepPayload* payload, const char* name)
+bool OC_CALL OCRepPayloadIsNull(const OCRepPayload* payload, const char* name)
{
OCRepPayloadValue* val = OCRepPayloadFindValue(payload, name);
return val->type == OCREP_PROP_NULL;
}
-static bool OCRepPayloadSetProp(OCRepPayload* payload, const char* name,
+static bool OC_CALL OCRepPayloadSetProp(OCRepPayload* payload, const char* name,
void* value, OCRepPayloadPropType type)
{
OCRepPayloadValue* val = OCRepPayloadFindAndSetValue(payload, name, type);
return true;
}
-bool OCRepPayloadSetNull(OCRepPayload* payload, const char* name)
+bool OC_CALL OCRepPayloadSetNull(OCRepPayload* payload, const char* name)
{
return OCRepPayloadSetProp(payload, name, NULL, OCREP_PROP_NULL);
}
-bool OCRepPayloadSetPropInt(OCRepPayload* payload,
+bool OC_CALL OCRepPayloadSetPropInt(OCRepPayload* payload,
const char* name, int64_t value)
{
return OCRepPayloadSetProp(payload, name, &value, OCREP_PROP_INT);
}
-bool OCRepPayloadGetPropInt(const OCRepPayload* payload, const char* name, int64_t* value)
+bool OC_CALL OCRepPayloadGetPropInt(const OCRepPayload* payload, const char* name, int64_t* value)
{
OCRepPayloadValue* val = OCRepPayloadFindValue(payload, name);
return true;
}
-bool OCRepPayloadSetPropDouble(OCRepPayload* payload,
+bool OC_CALL OCRepPayloadSetPropDouble(OCRepPayload* payload,
const char* name, double value)
{
return OCRepPayloadSetProp(payload, name, &value, OCREP_PROP_DOUBLE);
}
-bool OCRepPayloadGetPropDouble(const OCRepPayload* payload, const char* name, double* value)
+bool OC_CALL OCRepPayloadGetPropDouble(const OCRepPayload* payload, const char* name, double* value)
{
OCRepPayloadValue* val = OCRepPayloadFindValue(payload, name);
return false;
}
-bool OCRepPayloadSetPropString(OCRepPayload* payload, const char* name, const char* value)
+bool OC_CALL OCRepPayloadSetPropString(OCRepPayload* payload, const char* name, const char* value)
{
char* temp = OICStrdup(value);
bool b = OCRepPayloadSetPropStringAsOwner(payload, name, temp);
return b;
}
-bool OCRepPayloadSetPropStringAsOwner(OCRepPayload* payload, const char* name, char* value)
+bool OC_CALL OCRepPayloadSetPropStringAsOwner(OCRepPayload* payload, const char* name, char* value)
{
return OCRepPayloadSetProp(payload, name, value, OCREP_PROP_STRING);
}
-bool OCRepPayloadGetPropString(const OCRepPayload* payload, const char* name, char** value)
+bool OC_CALL OCRepPayloadGetPropString(const OCRepPayload* payload, const char* name, char** value)
{
OCRepPayloadValue* val = OCRepPayloadFindValue(payload, name);
return *value != NULL;
}
-bool OCRepPayloadSetPropByteString(OCRepPayload* payload, const char* name, OCByteString value)
+bool OC_CALL OCRepPayloadSetPropByteString(OCRepPayload* payload, const char* name, OCByteString value)
{
if (!value.bytes || !value.len)
{
return b;
}
-bool OCRepPayloadSetPropByteStringAsOwner(OCRepPayload* payload, const char* name, OCByteString* value)
+bool OC_CALL OCRepPayloadSetPropByteStringAsOwner(OCRepPayload* payload, const char* name, OCByteString* value)
{
return OCRepPayloadSetProp(payload, name, value, OCREP_PROP_BYTE_STRING);
}
-bool OCRepPayloadGetPropByteString(const OCRepPayload* payload, const char* name, OCByteString* value)
+bool OC_CALL OCRepPayloadGetPropByteString(const OCRepPayload* payload, const char* name, OCByteString* value)
{
OCRepPayloadValue* val = OCRepPayloadFindValue(payload, name);
return true;
}
-bool OCRepPayloadSetPropBool(OCRepPayload* payload,
+bool OC_CALL OCRepPayloadSetPropBool(OCRepPayload* payload,
const char* name, bool value)
{
return OCRepPayloadSetProp(payload, name, &value, OCREP_PROP_BOOL);
}
-bool OCRepPayloadGetPropBool(const OCRepPayload* payload, const char* name, bool* value)
+bool OC_CALL OCRepPayloadGetPropBool(const OCRepPayload* payload, const char* name, bool* value)
{
OCRepPayloadValue* val = OCRepPayloadFindValue(payload, name);
return OICStrdup(encoding);
}
-bool OCRepPayloadSetPropPubDataTypeAsOwner(OCRepPayload *payload, const char *name,
- const OicSecKey_t *value)
+bool OC_CALL OCRepPayloadSetPropPubDataTypeAsOwner(OCRepPayload *payload, const char *name,
+ const OicSecKey_t *value)
{
if (!payload || !name || !value)
{
return true;
}
-bool OCRepPayloadSetPropPubDataType(OCRepPayload *payload, const char *name,
- const OicSecKey_t *value)
+bool OC_CALL OCRepPayloadSetPropPubDataType(OCRepPayload *payload, const char *name,
+ const OicSecKey_t *value)
{
return OCRepPayloadSetPropPubDataTypeAsOwner(payload, name, value);
}
return type;
}
-bool OCRepPayloadGetPropPubDataType(const OCRepPayload *payload, const char *name, OicSecKey_t *value)
+bool OC_CALL OCRepPayloadGetPropPubDataType(const OCRepPayload *payload, const char *name, OicSecKey_t *value)
{
OCRepPayload *heplerPayload = NULL;
char *encoding = NULL;
}
#endif
-bool OCRepPayloadSetPropObject(OCRepPayload* payload, const char* name, const OCRepPayload* value)
+bool OC_CALL OCRepPayloadSetPropObject(OCRepPayload* payload, const char* name, const OCRepPayload* value)
{
OCRepPayload* temp = OCRepPayloadClone(value);
bool b = OCRepPayloadSetPropObjectAsOwner(payload, name, temp);
return b;
}
-bool OCRepPayloadSetPropObjectAsOwner(OCRepPayload* payload, const char* name, OCRepPayload* value)
+bool OC_CALL OCRepPayloadSetPropObjectAsOwner(OCRepPayload* payload, const char* name, OCRepPayload* value)
{
return OCRepPayloadSetProp(payload, name, value, OCREP_PROP_OBJECT);
}
-bool OCRepPayloadGetPropObject(const OCRepPayload* payload, const char* name, OCRepPayload** value)
+bool OC_CALL OCRepPayloadGetPropObject(const OCRepPayload* payload, const char* name, OCRepPayload** value)
{
OCRepPayloadValue* val = OCRepPayloadFindValue(payload, name);
return *value != NULL;
}
-size_t calcDimTotal(const size_t dimensions[MAX_REP_ARRAY_DEPTH])
+size_t OC_CALL calcDimTotal(const size_t dimensions[MAX_REP_ARRAY_DEPTH])
{
if (dimensions[0] == 0)
{
}
-bool OCRepPayloadSetByteStringArrayAsOwner(OCRepPayload* payload, const char* name,
+bool OC_CALL OCRepPayloadSetByteStringArrayAsOwner(OCRepPayload* payload, const char* name,
OCByteString* array, size_t dimensions[MAX_REP_ARRAY_DEPTH])
{
OCRepPayloadValue* val = OCRepPayloadFindAndSetValue(payload, name, OCREP_PROP_ARRAY);
return true;
}
-bool OCRepPayloadSetByteStringArray(OCRepPayload* payload, const char* name,
+bool OC_CALL OCRepPayloadSetByteStringArray(OCRepPayload* payload, const char* name,
const OCByteString* array, size_t dimensions[MAX_REP_ARRAY_DEPTH])
{
if (!array)
return b;
}
-bool OCRepPayloadGetByteStringArray(const OCRepPayload* payload, const char* name,
+bool OC_CALL OCRepPayloadGetByteStringArray(const OCRepPayload* payload, const char* name,
OCByteString** array, size_t dimensions[MAX_REP_ARRAY_DEPTH])
{
OCRepPayloadValue* val = OCRepPayloadFindValue(payload, name);
}
-bool OCRepPayloadSetIntArrayAsOwner(OCRepPayload* payload, const char* name,
+bool OC_CALL OCRepPayloadSetIntArrayAsOwner(OCRepPayload* payload, const char* name,
int64_t* array, size_t dimensions[MAX_REP_ARRAY_DEPTH])
{
OCRepPayloadValue* val = OCRepPayloadFindAndSetValue(payload, name, OCREP_PROP_ARRAY);
return true;
}
-bool OCRepPayloadSetIntArray(OCRepPayload* payload, const char* name,
+bool OC_CALL OCRepPayloadSetIntArray(OCRepPayload* payload, const char* name,
const int64_t* array, size_t dimensions[MAX_REP_ARRAY_DEPTH])
{
size_t dimTotal = calcDimTotal(dimensions);
return b;
}
-bool OCRepPayloadGetIntArray(const OCRepPayload* payload, const char* name,
+bool OC_CALL OCRepPayloadGetIntArray(const OCRepPayload* payload, const char* name,
int64_t** array, size_t dimensions[MAX_REP_ARRAY_DEPTH])
{
OCRepPayloadValue* val = OCRepPayloadFindValue(payload, name);
return true;
}
-bool OCRepPayloadSetDoubleArrayAsOwner(OCRepPayload* payload, const char* name,
+bool OC_CALL OCRepPayloadSetDoubleArrayAsOwner(OCRepPayload* payload, const char* name,
double* array, size_t dimensions[MAX_REP_ARRAY_DEPTH])
{
OCRepPayloadValue* val = OCRepPayloadFindAndSetValue(payload, name, OCREP_PROP_ARRAY);
return true;
}
-bool OCRepPayloadSetDoubleArray(OCRepPayload* payload, const char* name,
+bool OC_CALL OCRepPayloadSetDoubleArray(OCRepPayload* payload, const char* name,
const double* array, size_t dimensions[MAX_REP_ARRAY_DEPTH])
{
size_t dimTotal = calcDimTotal(dimensions);
return b;
}
-bool OCRepPayloadGetDoubleArray(const OCRepPayload* payload, const char* name,
+bool OC_CALL OCRepPayloadGetDoubleArray(const OCRepPayload* payload, const char* name,
double** array, size_t dimensions[MAX_REP_ARRAY_DEPTH])
{
OCRepPayloadValue* val = OCRepPayloadFindValue(payload, name);
return true;
}
-bool OCRepPayloadSetStringArrayAsOwner(OCRepPayload* payload, const char* name,
+bool OC_CALL OCRepPayloadSetStringArrayAsOwner(OCRepPayload* payload, const char* name,
char** array, size_t dimensions[MAX_REP_ARRAY_DEPTH])
{
OCRepPayloadValue* val = OCRepPayloadFindAndSetValue(payload, name, OCREP_PROP_ARRAY);
return true;
}
-bool OCRepPayloadSetStringArray(OCRepPayload* payload, const char* name,
+bool OC_CALL OCRepPayloadSetStringArray(OCRepPayload* payload, const char* name,
const char** array, size_t dimensions[MAX_REP_ARRAY_DEPTH])
{
size_t dimTotal = calcDimTotal(dimensions);
return b;
}
-bool OCRepPayloadGetStringArray(const OCRepPayload* payload, const char* name,
+bool OC_CALL OCRepPayloadGetStringArray(const OCRepPayload* payload, const char* name,
char*** array, size_t dimensions[MAX_REP_ARRAY_DEPTH])
{
OCRepPayloadValue* val = OCRepPayloadFindValue(payload, name);
}
-bool OCRepPayloadSetBoolArrayAsOwner(OCRepPayload* payload, const char* name,
+bool OC_CALL OCRepPayloadSetBoolArrayAsOwner(OCRepPayload* payload, const char* name,
bool* array, size_t dimensions[MAX_REP_ARRAY_DEPTH])
{
return true;
}
-bool OCRepPayloadSetBoolArray(OCRepPayload* payload, const char* name,
+bool OC_CALL OCRepPayloadSetBoolArray(OCRepPayload* payload, const char* name,
const bool* array, size_t dimensions[MAX_REP_ARRAY_DEPTH])
{
size_t dimTotal = calcDimTotal(dimensions);
return b;
}
-bool OCRepPayloadGetBoolArray(const OCRepPayload* payload, const char* name,
+bool OC_CALL OCRepPayloadGetBoolArray(const OCRepPayload* payload, const char* name,
bool** array, size_t dimensions[MAX_REP_ARRAY_DEPTH])
{
OCRepPayloadValue* val = OCRepPayloadFindValue(payload, name);
return true;
}
-bool OCRepPayloadSetPropObjectArrayAsOwner(OCRepPayload* payload, const char* name,
+bool OC_CALL OCRepPayloadSetPropObjectArrayAsOwner(OCRepPayload* payload, const char* name,
OCRepPayload** array, size_t dimensions[MAX_REP_ARRAY_DEPTH])
{
OCRepPayloadValue* val = OCRepPayloadFindAndSetValue(payload, name, OCREP_PROP_ARRAY);
return true;
}
-bool OCRepPayloadSetPropObjectArray(OCRepPayload* payload, const char* name,
+bool OC_CALL OCRepPayloadSetPropObjectArray(OCRepPayload* payload, const char* name,
const OCRepPayload** array, size_t dimensions[MAX_REP_ARRAY_DEPTH])
{
size_t dimTotal = calcDimTotal(dimensions);
return b;
}
-bool OCRepPayloadGetPropObjectArray(const OCRepPayload* payload, const char* name,
+bool OC_CALL OCRepPayloadGetPropObjectArray(const OCRepPayload* payload, const char* name,
OCRepPayload*** array, size_t dimensions[MAX_REP_ARRAY_DEPTH])
{
OCRepPayloadValue* val = OCRepPayloadFindValue(payload, name);
return true;
}
-void OCFreeOCStringLL(OCStringLL* ll)
+void OC_CALL OCFreeOCStringLL(OCStringLL* ll)
{
if (!ll)
{
OICFree(ll);
}
-OCStringLL* CloneOCStringLL (OCStringLL* ll)
+OCStringLL* OC_CALL CloneOCStringLL (OCStringLL* ll)
{
if (!ll)
{
return headOfClone;
}
-OCStringLL* OCCreateOCStringLL(const char* text)
+OCStringLL* OC_CALL OCCreateOCStringLL(const char* text)
{
char *token = NULL;
char *head = NULL;
return NULL;
}
-char* OCCreateString(const OCStringLL* ll)
+char* OC_CALL OCCreateString(const OCStringLL* ll)
{
if (!ll)
{
return str;
}
-bool OCByteStringCopy(OCByteString* dest, const OCByteString* source)
+bool OC_CALL OCByteStringCopy(OCByteString* dest, const OCByteString* source)
{
VERIFY_PARAM_NON_NULL(TAG, source, "Bad input");
return false;
}
-OCRepPayload* OCRepPayloadClone (const OCRepPayload* payload)
+OCRepPayload* OC_CALL OCRepPayloadClone (const OCRepPayload* payload)
{
if (!payload)
{
return clone;
}
-OCRepPayload* OCRepPayloadBatchClone(const OCRepPayload* repPayload)
+OCRepPayload* OC_CALL OCRepPayloadBatchClone(const OCRepPayload* repPayload)
{
OCRepPayload *newPayload = OCRepPayloadCreate();
if (!newPayload)
return newPayload;
}
-void OCRepPayloadDestroy(OCRepPayload* payload)
+void OC_CALL OCRepPayloadDestroy(OCRepPayload* payload)
{
if (!payload)
{
OICFree(payload);
}
-OCDiscoveryPayload* OCDiscoveryPayloadCreate()
+OCDiscoveryPayload* OC_CALL OCDiscoveryPayloadCreate()
{
OCDiscoveryPayload* payload = (OCDiscoveryPayload*)OICCalloc(1, sizeof(OCDiscoveryPayload));
return payload;
}
-OCSecurityPayload* OCSecurityPayloadCreate(const uint8_t* securityData, size_t size)
+OCSecurityPayload* OC_CALL OCSecurityPayloadCreate(const uint8_t* securityData, size_t size)
{
OCSecurityPayload* payload = (OCSecurityPayload*)OICCalloc(1, sizeof(OCSecurityPayload));
return payload;
}
-void OCSecurityPayloadDestroy(OCSecurityPayload* payload)
+void OC_CALL OCSecurityPayloadDestroy(OCSecurityPayload* payload)
{
if (!payload)
{
OICFree(payload);
}
-OCIntrospectionPayload* OCIntrospectionPayloadCreateFromCbor(const uint8_t* cborData,
+OCIntrospectionPayload* OC_CALL OCIntrospectionPayloadCreateFromCbor(const uint8_t* cborData,
size_t size)
{
OCIntrospectionPayload* payload = NULL;
return payload;
}
-void OCIntrospectionPayloadDestroy(OCIntrospectionPayload* payload)
+void OC_CALL OCIntrospectionPayloadDestroy(OCIntrospectionPayload* payload)
{
if (!payload)
{
OICFree(payload);
}
-size_t OCDiscoveryPayloadGetResourceCount(OCDiscoveryPayload* payload)
+size_t OC_CALL OCDiscoveryPayloadGetResourceCount(OCDiscoveryPayload* payload)
{
size_t i = 0;
OCResourcePayload* p = payload->resources;
return i;
}
-OCResourcePayload* OCDiscoveryPayloadGetResource(OCDiscoveryPayload* payload, size_t index)
+OCResourcePayload* OC_CALL OCDiscoveryPayloadGetResource(OCDiscoveryPayload* payload, size_t index)
{
size_t i = 0;
OCResourcePayload* p = payload->resources;
return NULL;
}
-size_t OCEndpointPayloadGetEndpointCount(OCEndpointPayload* payload)
+size_t OC_CALL OCEndpointPayloadGetEndpointCount(OCEndpointPayload* payload)
{
size_t i = 0;
OCEndpointPayload* ep = payload;
return i;
}
-OCEndpointPayload* OCEndpointPayloadGetEndpoint(OCEndpointPayload* payload, size_t index)
+OCEndpointPayload* OC_CALL OCEndpointPayloadGetEndpoint(OCEndpointPayload* payload, size_t index)
{
size_t i = 0;
OCEndpointPayload* ep = payload;
return NULL;
}
-void OCResourcePayloadAddNewEndpoint(OCResourcePayload* payload, OCEndpointPayload* endpoint)
+void OC_CALL OCResourcePayloadAddNewEndpoint(OCResourcePayload* payload, OCEndpointPayload* endpoint)
{
if (!payload)
{
}
#ifndef TCP_ADAPTER
-void OCDiscoveryPayloadAddResource(OCDiscoveryPayload* payload, const OCResource* res,
- uint16_t securePort)
+void OC_CALL OCDiscoveryPayloadAddResource(OCDiscoveryPayload* payload, const OCResource* res,
+ uint16_t securePort)
{
OCDiscoveryPayloadAddNewResource(payload, OCCopyResource(res, securePort, NULL, 0, NULL));
}
#else
-void OCDiscoveryPayloadAddResource(OCDiscoveryPayload* payload, const OCResource* res,
- uint16_t securePort, uint16_t tcpPort)
+void OC_CALL OCDiscoveryPayloadAddResource(OCDiscoveryPayload* payload, const OCResource* res,
+ uint16_t securePort, uint16_t tcpPort)
{
OCDiscoveryPayloadAddNewResource(payload, OCCopyResource(res, securePort, NULL, 0, NULL,
tcpPort));
#ifndef TCP_ADAPTER
void OCDiscoveryPayloadAddResourceWithEps(OCDiscoveryPayload* payload, const OCResource* res,
- uint16_t securePort, void *networkInfo, size_t infoSize,
- const OCDevAddr *devAddr)
+ uint16_t securePort, void *networkInfo, size_t infoSize,
+ const OCDevAddr *devAddr)
{
OCDiscoveryPayloadAddNewResource(payload,
OCCopyResource(res, securePort, (CAEndpoint_t *)networkInfo,
}
#else
void OCDiscoveryPayloadAddResourceWithEps(OCDiscoveryPayload* payload, const OCResource* res,
- uint16_t securePort, void *networkInfo, size_t infoSize,
- const OCDevAddr *devAddr, uint16_t tcpPort)
+ uint16_t securePort, void *networkInfo, size_t infoSize,
+ const OCDevAddr *devAddr, uint16_t tcpPort)
{
OCDiscoveryPayloadAddNewResource(payload,
OCCopyResource(res, securePort, (CAEndpoint_t *)networkInfo,
}
#endif
-bool OCResourcePayloadAddStringLL(OCStringLL **stringLL, const char *value)
+bool OC_CALL OCResourcePayloadAddStringLL(OCStringLL **stringLL, const char *value)
{
char *dup = NULL;
VERIFY_PARAM_NON_NULL(TAG, value, "Invalid Parameters");
return false;
}
-void OCDiscoveryPayloadAddNewResource(OCDiscoveryPayload* payload, OCResourcePayload* res)
+void OC_CALL OCDiscoveryPayloadAddNewResource(OCDiscoveryPayload* payload, OCResourcePayload* res)
{
if (!payload)
{
}
}
-void OCDiscoveryEndpointDestroy(OCEndpointPayload* payload)
+void OC_CALL OCDiscoveryEndpointDestroy(OCEndpointPayload* payload)
{
if (!payload)
{
OICFree(payload);
}
-void OCDiscoveryResourceDestroy(OCResourcePayload* payload)
+void OC_CALL OCDiscoveryResourceDestroy(OCResourcePayload* payload)
{
if (!payload)
{
OICFree(payload);
}
-void OCDiscoveryPayloadDestroy(OCDiscoveryPayload* payload)
+void OC_CALL OCDiscoveryPayloadDestroy(OCDiscoveryPayload* payload)
{
if (!payload)
{
OICFree(payload);
}
-OCPresencePayload* OCPresencePayloadCreate(uint32_t seqNum, uint32_t maxAge,
+OCPresencePayload* OC_CALL OCPresencePayloadCreate(uint32_t seqNum, uint32_t maxAge,
OCPresenceTrigger trigger, const char* resourceType)
{
OCPresencePayload* payload = (OCPresencePayload*)OICCalloc(1, sizeof(OCPresencePayload));
return payload;
}
-void OCPresencePayloadDestroy(OCPresencePayload* payload)
+void OC_CALL OCPresencePayloadDestroy(OCPresencePayload* payload)
{
if (!payload)
{
OICFree(payload);
}
-OCDiagnosticPayload* OCDiagnosticPayloadCreate(const char* message)
+OCDiagnosticPayload* OC_CALL OCDiagnosticPayloadCreate(const char* message)
{
if (!message)
{
return payload;
}
-void OCDiagnosticPayloadDestroy(OCDiagnosticPayload* payload)
+void OC_CALL OCDiagnosticPayloadDestroy(OCDiagnosticPayload* payload)
{
if (!payload)
{
OICFree(payload);
}
-OCStackResult OCLinksPayloadValueCreate(const char* resourceUri, OCRepPayloadValue** linksRepPayloadValue,
+OCStackResult OC_CALL OCLinksPayloadValueCreate(const char* resourceUri, OCRepPayloadValue** linksRepPayloadValue,
OCDevAddr* devAddr)
{
OIC_LOG(DEBUG, TAG, "OCLinksPayloadValueCreate");
return OC_STACK_OK;
}
-OCResource *FindResourceByUri(const char* resourceUri)
+OCResource *OC_CALL FindResourceByUri(const char* resourceUri)
{
if(!resourceUri)
{
return ret;
}
-OCStackResult OCSetPlatformInfo(OCPlatformInfo info)
+OCStackResult OC_CALL OCSetPlatformInfo(OCPlatformInfo info)
{
OCResource *resource = NULL;
if (!info.platformID || !info.manufacturerName)
return OC_STACK_INVALID_PARAM;
}
-OCStackResult OCSetDeviceInfo(OCDeviceInfo info)
+OCStackResult OC_CALL OCSetDeviceInfo(OCDeviceInfo info)
{
OCResource *resource = FindResourceByUri(OC_RSRVD_DEVICE_URI);
if (!resource)
return OC_STACK_ERROR;
}
-OCStackResult OCGetAttribute(const OCResource *resource, const char *attribute, void **value)
+OCStackResult OC_CALL OCGetAttribute(const OCResource *resource, const char *attribute, void **value)
{
if (!resource || !attribute)
{
return OC_STACK_NO_RESOURCE;
}
-OCStackResult OCGetPropertyValue(OCPayloadType type, const char *prop, void **value)
+OCStackResult OC_CALL OCGetPropertyValue(OCPayloadType type, const char *prop, void **value)
{
if (!prop)
{
return result;
}
-OCStackResult OCSetAttribute(OCResource *resource, const char *attribute, const void *value)
+OCStackResult OC_CALL OCSetAttribute(OCResource *resource, const char *attribute, const void *value)
{
bool updateDatabase = false;
return SetAttributeInternal(resource, attribute, value, updateDatabase);
}
-OCStackResult OCSetPropertyValue(OCPayloadType type, const char *prop, const void *value)
+OCStackResult OC_CALL OCSetPropertyValue(OCPayloadType type, const char *prop, const void *value)
{
if (!prop || !value)
{
return OC_STACK_OK;
}
-const char *convertTriggerEnumToString(OCPresenceTrigger trigger)
+const char *OC_CALL convertTriggerEnumToString(OCPresenceTrigger trigger)
{
if (trigger == OC_PRESENCE_TRIGGER_CREATE)
{
}
}
-OCPresenceTrigger convertTriggerStringToEnum(const char * triggerStr)
+OCPresenceTrigger OC_CALL convertTriggerStringToEnum(const char * triggerStr)
{
if(!triggerStr)
{
}
}
-OCStackResult OCEncodeAddressForRFC6874(char *outputAddress,
- size_t outputSize,
- const char *inputAddress)
+OCStackResult OC_CALL OCEncodeAddressForRFC6874(char *outputAddress,
+ size_t outputSize,
+ const char *inputAddress)
{
VERIFY_NON_NULL(inputAddress, FATAL, OC_STACK_INVALID_PARAM);
VERIFY_NON_NULL(outputAddress, FATAL, OC_STACK_INVALID_PARAM);
return OC_STACK_OK;
}
-OCStackResult OCDecodeAddressForRFC6874(char *outputAddress,
- size_t outputSize,
- const char *inputAddress,
- const char *end)
+OCStackResult OC_CALL OCDecodeAddressForRFC6874(char *outputAddress,
+ size_t outputSize,
+ const char *inputAddress,
+ const char *end)
{
VERIFY_NON_NULL(inputAddress, FATAL, OC_STACK_INVALID_PARAM);
VERIFY_NON_NULL(outputAddress, FATAL, OC_STACK_INVALID_PARAM);
}
#endif
-void OCHandleResponse(const CAEndpoint_t* endPoint, const CAResponseInfo_t* responseInfo)
+void OC_CALL OCHandleResponse(const CAEndpoint_t* endPoint, const CAResponseInfo_t* responseInfo)
{
OIC_LOG(DEBUG, TAG, "Enter OCHandleResponse");
OIC_TRACE_MARK(%s:OCHandleResponse:%s, TAG, responseInfo->info.resourceUri);
// Public APIs
//-----------------------------------------------------------------------------
#ifdef RA_ADAPTER
-OCStackResult OCSetRAInfo(const OCRAInfo_t *raInfo)
+OCStackResult OC_CALL OCSetRAInfo(const OCRAInfo_t *raInfo)
{
if (!raInfo ||
!raInfo->username ||
}
#endif
-OCStackResult OCInit(const char *ipAddr, uint16_t port, OCMode mode)
+OCStackResult OC_CALL OCInit(const char *ipAddr, uint16_t port, OCMode mode)
{
(void) ipAddr;
(void) port;
return OCInit1(mode, OC_DEFAULT_FLAGS, OC_DEFAULT_FLAGS);
}
-OCStackResult OCInit1(OCMode mode, OCTransportFlags serverFlags, OCTransportFlags clientFlags)
+OCStackResult OC_CALL OCInit1(OCMode mode, OCTransportFlags serverFlags, OCTransportFlags clientFlags)
{
OIC_LOG(DEBUG, TAG, "call OCInit1");
return OCInit2(mode, serverFlags, clientFlags, OC_DEFAULT_ADAPTER);
}
-OCStackResult OCInit2(OCMode mode, OCTransportFlags serverFlags, OCTransportFlags clientFlags,
- OCTransportAdapter transportType)
+OCStackResult OC_CALL OCInit2(OCMode mode, OCTransportFlags serverFlags, OCTransportFlags clientFlags,
+ OCTransportAdapter transportType)
{
OIC_LOG(INFO, TAG, "Entering OCInit2");
return result;
}
-OCStackResult OCStop()
+OCStackResult OC_CALL OCStop()
{
OIC_LOG(INFO, TAG, "Entering OCStop");
return OC_STACK_OK;
}
-OCStackResult OCStartMulticastServer()
+OCStackResult OC_CALL OCStartMulticastServer()
{
if(stackState != OC_STACK_INITIALIZED)
{
return OC_STACK_OK;
}
-OCStackResult OCStopMulticastServer()
+OCStackResult OC_CALL OCStopMulticastServer()
{
g_multicastServerStopped = true;
return OC_STACK_OK;
* Discover or Perform requests on a specified resource
* Deprecated: use OCDoRequest instead
*/
-OCStackResult OCDoResource(OCDoHandle *handle,
- OCMethod method,
- const char *requestUri,
- const OCDevAddr *destination,
- OCPayload* payload,
- OCConnectivityType connectivityType,
- OCQualityOfService qos,
- OCCallbackData *cbData,
- OCHeaderOption *options,
- uint8_t numOptions)
+OCStackResult OC_CALL OCDoResource(OCDoHandle *handle,
+ OCMethod method,
+ const char *requestUri,
+ const OCDevAddr *destination,
+ OCPayload* payload,
+ OCConnectivityType connectivityType,
+ OCQualityOfService qos,
+ OCCallbackData *cbData,
+ OCHeaderOption *options,
+ uint8_t numOptions)
{
OIC_TRACE_BEGIN(%s:OCDoRequest, TAG);
OCStackResult ret = OCDoRequest(handle, method, requestUri,destination, payload,
/**
* Discover or Perform requests on a specified resource
*/
-OCStackResult OCDoRequest(OCDoHandle *handle,
- OCMethod method,
- const char *requestUri,
- const OCDevAddr *destination,
- OCPayload* payload,
- OCConnectivityType connectivityType,
- OCQualityOfService qos,
- OCCallbackData *cbData,
- OCHeaderOption *options,
- uint8_t numOptions)
+OCStackResult OC_CALL OCDoRequest(OCDoHandle *handle,
+ OCMethod method,
+ const char *requestUri,
+ const OCDevAddr *destination,
+ OCPayload* payload,
+ OCConnectivityType connectivityType,
+ OCQualityOfService qos,
+ OCCallbackData *cbData,
+ OCHeaderOption *options,
+ uint8_t numOptions)
{
OIC_LOG(INFO, TAG, "Entering OCDoResource");
return result;
}
-OCStackResult OCCancel(OCDoHandle handle, OCQualityOfService qos, OCHeaderOption * options,
+OCStackResult OC_CALL OCCancel(OCDoHandle handle, OCQualityOfService qos, OCHeaderOption * options,
uint8_t numOptions)
{
/*
* OC_STACK_OK - No errors; Success
* OC_STACK_INVALID_PARAM - Invalid parameter
*/
-OCStackResult OCRegisterPersistentStorageHandler(OCPersistentStorage* persistentStorageHandler)
+OCStackResult OC_CALL OCRegisterPersistentStorageHandler(OCPersistentStorage* persistentStorageHandler)
{
OIC_LOG(INFO, TAG, "RegisterPersistentStorageHandler !!");
if(persistentStorageHandler)
return OC_STACK_OK;
}
-OCPersistentStorage *OCGetPersistentStorageHandler()
+OCPersistentStorage *OC_CALL OCGetPersistentStorageHandler()
{
return g_PersistentStorageHandler;
}
}
#endif // WITH_PRESENCE
-OCStackResult OCProcess()
+OCStackResult OC_CALL OCProcess()
{
if (stackState == OC_STACK_UNINITIALIZED)
{
}
#ifdef WITH_PRESENCE
-OCStackResult OCStartPresence(const uint32_t ttl)
+OCStackResult OC_CALL OCStartPresence(const uint32_t ttl)
{
OIC_LOG(INFO, TAG, "Entering OCStartPresence");
uint8_t tokenLength = CA_MAX_TOKEN_LEN;
OC_PRESENCE_TRIGGER_CREATE);
}
-OCStackResult OCStopPresence()
+OCStackResult OC_CALL OCStopPresence()
{
OIC_LOG(INFO, TAG, "Entering OCStopPresence");
OCStackResult result = OC_STACK_ERROR;
}
#endif
-OCStackResult OCSetDefaultDeviceEntityHandler(OCDeviceEntityHandler entityHandler,
- void* callbackParameter)
+OCStackResult OC_CALL OCSetDefaultDeviceEntityHandler(OCDeviceEntityHandler entityHandler,
+ void* callbackParameter)
{
defaultDeviceHandler = entityHandler;
defaultDeviceHandlerCallbackParameter = callbackParameter;
return OC_STACK_OK;
}
-OCTpsSchemeFlags OCGetSupportedEndpointTpsFlags()
+OCTpsSchemeFlags OC_CALL OCGetSupportedEndpointTpsFlags()
{
return OCGetSupportedTpsFlags();
}
-OCStackResult OCCreateResource(OCResourceHandle *handle,
+OCStackResult OC_CALL OCCreateResource(OCResourceHandle *handle,
const char *resourceTypeName,
const char *resourceInterfaceName,
const char *uri, OCEntityHandler entityHandler,
OC_ALL);
}
-OCStackResult OCCreateResourceWithEp(OCResourceHandle *handle,
+OCStackResult OC_CALL OCCreateResourceWithEp(OCResourceHandle *handle,
const char *resourceTypeName,
const char *resourceInterfaceName,
const char *uri, OCEntityHandler entityHandler,
return result;
}
-OCStackResult OCBindResource(
+OCStackResult OC_CALL OCBindResource(
OCResourceHandle collectionHandle, OCResourceHandle resourceHandle)
{
OCResource *resource = NULL;
return OC_STACK_OK;
}
-OCStackResult OCUnBindResource(
+OCStackResult OC_CALL OCUnBindResource(
OCResourceHandle collectionHandle, OCResourceHandle resourceHandle)
{
OCResource *resource = NULL;
return result;
}
-OCStackResult OCBindResourceTypeToResource(OCResourceHandle handle,
+OCStackResult OC_CALL OCBindResourceTypeToResource(OCResourceHandle handle,
const char *resourceTypeName)
{
return result;
}
-OCStackResult OCBindResourceInterfaceToResource(OCResourceHandle handle,
+OCStackResult OC_CALL OCBindResourceInterfaceToResource(OCResourceHandle handle,
const char *resourceInterfaceName)
{
return result;
}
-OCStackResult OCGetNumberOfResources(uint8_t *numResources)
+OCStackResult OC_CALL OCGetNumberOfResources(uint8_t *numResources)
{
OCResource *pointer = headResource;
return OC_STACK_OK;
}
-OCResourceHandle OCGetResourceHandle(uint8_t index)
+OCResourceHandle OC_CALL OCGetResourceHandle(uint8_t index)
{
OCResource *pointer = headResource;
return (OCResourceHandle) pointer;
}
-OCStackResult OCDeleteResource(OCResourceHandle handle)
+OCStackResult OC_CALL OCDeleteResource(OCResourceHandle handle)
{
if (!handle)
{
return OC_STACK_OK;
}
-const char *OCGetResourceUri(OCResourceHandle handle)
+const char *OC_CALL OCGetResourceUri(OCResourceHandle handle)
{
OCResource *resource = NULL;
return (const char *) NULL;
}
-OCResourceProperty OCGetResourceProperties(OCResourceHandle handle)
+OCResourceProperty OC_CALL OCGetResourceProperties(OCResourceHandle handle)
{
OCResource *resource = NULL;
return (OCResourceProperty)-1;
}
-OCStackResult OCSetResourceProperties(OCResourceHandle handle, uint8_t resourceProperties)
+OCStackResult OC_CALL OCSetResourceProperties(OCResourceHandle handle, uint8_t resourceProperties)
{
OCResource *resource = NULL;
return OC_STACK_OK;
}
-OCStackResult OCClearResourceProperties(OCResourceHandle handle, uint8_t resourceProperties)
+OCStackResult OC_CALL OCClearResourceProperties(OCResourceHandle handle, uint8_t resourceProperties)
{
OCResource *resource = NULL;
return OC_STACK_OK;
}
-OCStackResult OCGetNumberOfResourceTypes(OCResourceHandle handle,
+OCStackResult OC_CALL OCGetNumberOfResourceTypes(OCResourceHandle handle,
uint8_t *numResourceTypes)
{
OCResource *resource = NULL;
return OC_STACK_OK;
}
-const char *OCGetResourceTypeName(OCResourceHandle handle, uint8_t index)
+const char *OC_CALL OCGetResourceTypeName(OCResourceHandle handle, uint8_t index)
{
OCResourceType *resourceType = NULL;
return (const char *) NULL;
}
-OCStackResult OCGetNumberOfResourceInterfaces(OCResourceHandle handle,
+OCStackResult OC_CALL OCGetNumberOfResourceInterfaces(OCResourceHandle handle,
uint8_t *numResourceInterfaces)
{
OCResourceInterface *pointer = NULL;
return OC_STACK_OK;
}
-const char *OCGetResourceInterfaceName(OCResourceHandle handle, uint8_t index)
+const char *OC_CALL OCGetResourceInterfaceName(OCResourceHandle handle, uint8_t index)
{
OCResourceInterface *resourceInterface = NULL;
return (const char *) NULL;
}
-OCResourceHandle OCGetResourceHandleFromCollection(OCResourceHandle collectionHandle,
+OCResourceHandle OC_CALL OCGetResourceHandleFromCollection(OCResourceHandle collectionHandle,
uint8_t index)
{
OCResource *resource = NULL;
return NULL;
}
-OCStackResult OCBindResourceHandler(OCResourceHandle handle,
+OCStackResult OC_CALL OCBindResourceHandler(OCResourceHandle handle,
OCEntityHandler entityHandler,
void* callbackParam)
{
return OC_STACK_OK;
}
-OCEntityHandler OCGetResourceHandler(OCResourceHandle handle)
+OCEntityHandler OC_CALL OCGetResourceHandler(OCResourceHandle handle)
{
OCResource *resource = NULL;
}
#endif // WITH_PRESENCE
-OCStackResult OCNotifyAllObservers(OCResourceHandle handle, OCQualityOfService qos)
+OCStackResult OC_CALL OCNotifyAllObservers(OCResourceHandle handle, OCQualityOfService qos)
{
OCResource *resPtr = NULL;
OCStackResult result = OC_STACK_ERROR;
}
OCStackResult
-OCNotifyListOfObservers (OCResourceHandle handle,
- OCObservationId *obsIdList,
- uint8_t numberOfIds,
- const OCRepPayload *payload,
- OCQualityOfService qos)
+OC_CALL OCNotifyListOfObservers (OCResourceHandle handle,
+ OCObservationId *obsIdList,
+ uint8_t numberOfIds,
+ const OCRepPayload *payload,
+ OCQualityOfService qos)
{
OIC_LOG(INFO, TAG, "Entering OCNotifyListOfObservers");
payload, maxAge, qos));
}
-OCStackResult OCDoResponse(OCEntityHandlerResponse *ehResponse)
+OCStackResult OC_CALL OCDoResponse(OCEntityHandlerResponse *ehResponse)
{
OIC_TRACE_BEGIN(%s:OCDoResponse, TAG);
OCStackResult result = OC_STACK_ERROR;
}
//#ifdef DIRECT_PAIRING
-const OCDPDev_t* OCDiscoverDirectPairingDevices(unsigned short waittime)
+const OCDPDev_t* OC_CALL OCDiscoverDirectPairingDevices(unsigned short waittime)
{
OIC_LOG(INFO, TAG, "Start OCDiscoverDirectPairingDevices");
if(OC_STACK_OK != DPDeviceDiscovery(waittime))
return (const OCDPDev_t*)DPGetDiscoveredDevices();
}
-const OCDPDev_t* OCGetDirectPairedDevices()
+const OCDPDev_t* OC_CALL OCGetDirectPairedDevices()
{
return (const OCDPDev_t*)DPGetPairedDevices();
}
-OCStackResult OCDoDirectPairing(void *ctx, OCDPDev_t* peer, OCPrm_t pmSel, char *pinNumber,
- OCDirectPairingCB resultCallback)
+OCStackResult OC_CALL OCDoDirectPairing(void *ctx, OCDPDev_t* peer, OCPrm_t pmSel, char *pinNumber,
+ OCDirectPairingCB resultCallback)
{
OIC_LOG(INFO, TAG, "Start OCDoDirectPairing");
if(NULL == peer || NULL == pinNumber)
return OC_STACK_NO_MEMORY;
}
-static const OicUuid_t* OCGetServerInstanceID(void)
+static const OicUuid_t* OC_CALL OCGetServerInstanceID(void)
{
static bool generated = false;
static OicUuid_t sid;
return &sid;
}
-const char* OCGetServerInstanceIDString(void)
+const char* OC_CALL OCGetServerInstanceIDString(void)
{
static bool generated = false;
static char sidStr[UUID_STRING_SIZE];
}
}
-OCStackResult OCSetProxyURI(const char *uri)
+OCStackResult OC_CALL OCSetProxyURI(const char *uri)
{
return CAResultToOCResult(CASetProxyUri(uri));
}
#if defined(RD_CLIENT) || defined(RD_SERVER)
-OCStackResult OCBindResourceInsToResource(OCResourceHandle handle, int64_t ins)
+OCStackResult OC_CALL OCBindResourceInsToResource(OCResourceHandle handle, int64_t ins)
{
VERIFY_NON_NULL(handle, ERROR, OC_STACK_INVALID_PARAM);
}
OCStackResult OCUpdateResourceInsWithResponse(const char *requestUri,
- const OCClientResponse *response)
+ const OCClientResponse *response)
{
// Validate input parameters
VERIFY_NON_NULL(requestUri, ERROR, OC_STACK_INVALID_PARAM);
return OC_STACK_OK;
}
-OCStackResult OCGetResourceIns(OCResourceHandle handle, int64_t* ins)
+OCStackResult OC_CALL OCGetResourceIns(OCResourceHandle handle, int64_t* ins)
{
OCResource *resource = NULL;
}
#endif // RD_CLIENT || RD_SERVER
-OCResourceHandle OCGetResourceHandleAtUri(const char *uri)
+OCResourceHandle OC_CALL OCGetResourceHandleAtUri(const char *uri)
{
if (!uri)
{
return OC_STACK_OK;
}
-OCStackResult OCSetHeaderOption(OCHeaderOption* ocHdrOpt, size_t* numOptions, uint16_t optionID,
- void* optionData, size_t optionDataLength)
+OCStackResult OC_CALL OCSetHeaderOption(OCHeaderOption* ocHdrOpt, size_t* numOptions, uint16_t optionID,
+ void* optionData, size_t optionDataLength)
{
if (!ocHdrOpt)
{
return OC_STACK_OK;
}
-OCStackResult OCGetHeaderOption(OCHeaderOption* ocHdrOpt, size_t numOptions,
- uint16_t optionID, void* optionData, size_t optionDataLength,
- uint16_t* receivedDataLength)
+OCStackResult OC_CALL OCGetHeaderOption(OCHeaderOption* ocHdrOpt, size_t numOptions,
+ uint16_t optionID, void* optionData, size_t optionDataLength,
+ uint16_t* receivedDataLength)
{
if (!ocHdrOpt || !numOptions)
{
}
}
-OCStackResult OCGetDeviceId(OCUUIdentity *deviceId)
+OCStackResult OC_CALL OCGetDeviceId(OCUUIdentity *deviceId)
{
OicUuid_t oicUuid;
OCStackResult ret = OC_STACK_ERROR;
return ret;
}
-OCStackResult OCSetDeviceId(const OCUUIdentity *deviceId)
+OCStackResult OC_CALL OCSetDeviceId(const OCUUIdentity *deviceId)
{
OicUuid_t oicUuid;
OCStackResult ret = OC_STACK_ERROR;
return ret;
}
-OCStackResult OCGetDeviceOwnedState(bool *isOwned)
+OCStackResult OC_CALL OCGetDeviceOwnedState(bool *isOwned)
{
bool isDeviceOwned = true;
OCStackResult ret = OC_STACK_ERROR;
}
#ifdef IP_ADAPTER
-OCStackResult OCGetLinkLocalZoneId(uint32_t ifindex, char **zoneId)
+OCStackResult OC_CALL OCGetLinkLocalZoneId(uint32_t ifindex, char **zoneId)
{
return CAResultToOCResult(CAGetLinkLocalZoneId(ifindex, zoneId));
}
#endif
-OCStackResult OCSelectCipherSuite(uint16_t cipher, OCTransportAdapter adapterType)
+OCStackResult OC_CALL OCSelectCipherSuite(uint16_t cipher, OCTransportAdapter adapterType)
{
// OCTransportAdapter and CATransportAdapter_t are using the same bits for each transport.
OC_STATIC_ASSERT((unsigned int)OC_ADAPTER_IP == (unsigned int)CA_ADAPTER_IP,
return CAResultToOCResult(CASelectCipherSuite(cipher, (CATransportAdapter_t)adapterType));
}
-OCStackResult OCGetIpv6AddrScope(const char *addr, OCTransportFlags *scope)
+OCStackResult OC_CALL OCGetIpv6AddrScope(const char *addr, OCTransportFlags *scope)
{
// OCTransportFlags and CATransportFlags_t are using the same bits for each scope.
OC_STATIC_ASSERT((unsigned int)OC_SCOPE_INTERFACE == (unsigned int)CA_SCOPE_INTERFACE,
goto exit; \
}
-OCStackResult OCRDDatabaseSetStorageFilename(const char *filename)
+OCStackResult OC_CALL OCRDDatabaseSetStorageFilename(const char *filename)
{
if (!filename)
{
return OC_STACK_OK;
}
-const char *OCRDDatabaseGetStorageFilename()
+const char *OC_CALL OCRDDatabaseGetStorageFilename()
{
return gRDPath;
}
return result;
}
-OCStackResult OCRDDatabaseDiscoveryPayloadCreate(const char *interfaceType,
+OCStackResult OC_CALL OCRDDatabaseDiscoveryPayloadCreate(const char *interfaceType,
const char *resourceType,
OCDiscoveryPayload **payload)
{
*
* @return OC_STACK_OK in case of success and other value otherwise.
*/
- static OCStackResult displayNumCallbackWrapper(void* ctx,
+ static OCStackResult OC_CALL displayNumCallbackWrapper(void* ctx,
uint8_t verifNum[MUTUAL_VERIF_NUM_LEN]);
/**
*
* @return OC_STACK_OK in case of success and other value otherwise.
*/
- static OCStackResult confirmUserCallbackWrapper(void* ctx);
+ static OCStackResult OC_CALL confirmUserCallbackWrapper(void* ctx);
/**
* Notifier wrapper for trustCertChain change.
FILE *out;
} oc_console_logger_ctx;
-oc_log_ctx_t *oc_make_console_logger()
+oc_log_ctx_t *OC_CALL oc_make_console_logger()
{
return oc_log_make_ctx(
NULL,
#include <string.h>
#include <stdlib.h>
-oc_log_ctx_t *oc_log_make_ctx(
+oc_log_ctx_t *OC_CALL oc_log_make_ctx(
void* world,
const oc_log_level level,
oc_log_init_t init,
return log_ctx;
}
-void oc_log_destroy(oc_log_ctx_t *ctx)
+void OC_CALL oc_log_destroy(oc_log_ctx_t *ctx)
{
if(!ctx)
{
return ctx->init(ctx, world);
}
-void oc_log_flush(oc_log_ctx_t *ctx)
+void OC_CALL oc_log_flush(oc_log_ctx_t *ctx)
{
if(!ctx)
{
ctx->flush(ctx);
}
-void oc_log_set_level(oc_log_ctx_t *ctx, const oc_log_level loglevel)
+void OC_CALL oc_log_set_level(oc_log_ctx_t *ctx, const oc_log_level loglevel)
{
if(!ctx)
{
ctx->set_level(ctx, loglevel);
}
-size_t oc_log_write(oc_log_ctx_t *ctx, const char *msg)
+size_t OC_CALL oc_log_write(oc_log_ctx_t *ctx, const char *msg)
{
if(!ctx)
{
return oc_log_write_level(ctx, ctx->log_level, msg);
}
-size_t oc_log_write_level(oc_log_ctx_t *ctx, const oc_log_level loglevel, const char *msg)
+size_t OC_CALL oc_log_write_level(oc_log_ctx_t *ctx, const oc_log_level loglevel, const char *msg)
{
if(!ctx)
{
return ctx->write_level(ctx, loglevel, msg);
}
-int oc_log_set_module(oc_log_ctx_t *ctx, const char *module_name)
+int OC_CALL oc_log_set_module(oc_log_ctx_t *ctx, const char *module_name)
{
char *mn = NULL;
} // namespace
/* Courtesy-function: */
-oc_log_ctx_t *oc_make_ostream_logger()
+oc_log_ctx_t *OC_CALL oc_make_ostream_logger()
{
return oc_log_make_ctx(
nullptr,
extern "C" {
#endif
-oc_log_ctx_t *oc_make_console_logger();
+oc_log_ctx_t *OC_CALL oc_make_console_logger();
int oc_console_logger_init(oc_log_ctx_t *ctx, void *world);
void oc_console_logger_destroy(oc_log_ctx_t *ctx);
#define OC_LOGGER_H_
#include "oc_logger_types.h"
+#include "platform_features.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Basic interface: */
-oc_log_ctx_t *oc_log_make_ctx(
+oc_log_ctx_t * OC_CALL oc_log_make_ctx(
void* world,
const oc_log_level level,
oc_log_init_t init,
oc_log_set_module_t set_module
);
-void oc_log_destroy(oc_log_ctx_t *ctx);
+void OC_CALL oc_log_destroy(oc_log_ctx_t *ctx);
-void oc_log_flush(oc_log_ctx_t *ctx);
-void oc_log_set_level(oc_log_ctx_t *ctx, const oc_log_level ll);
-size_t oc_log_write(oc_log_ctx_t *ctx, const char *msg);
-size_t oc_log_write_level(oc_log_ctx_t *ctx, const oc_log_level ll, const char *msg);
-int oc_log_set_module(oc_log_ctx_t *ctx, const char *module_name);
+void OC_CALL oc_log_flush(oc_log_ctx_t *ctx);
+void OC_CALL oc_log_set_level(oc_log_ctx_t *ctx, const oc_log_level ll);
+size_t OC_CALL oc_log_write(oc_log_ctx_t *ctx, const char *msg);
+size_t OC_CALL oc_log_write_level(oc_log_ctx_t *ctx, const oc_log_level ll, const char *msg);
+int OC_CALL oc_log_set_module(oc_log_ctx_t *ctx, const char *module_name);
#ifdef __cplusplus
} // extern "C"
extern "C" {
#endif
-oc_log_ctx_t *oc_make_console_logger();
+oc_log_ctx_t *OC_CALL oc_make_console_logger();
int oc_console_logger_init(oc_log_ctx_t *ctx, void *world);
void oc_console_logger_destroy(oc_log_ctx_t *ctx);
extern "C" {
#endif
-oc_log_ctx_t *oc_make_ostream_logger();
+oc_log_ctx_t *OC_CALL oc_make_ostream_logger();
int oc_ostream_log_init(oc_log_ctx_t *ctx, void *world);
void oc_ostream_log_destroy(oc_log_ctx_t *ctx);
return result;
}
- static void inputPinCallbackWrapper(OicUuid_t deviceId, char* pinBuffer, size_t pinBufferSize, void* context)
+ static void OC_CALL inputPinCallbackWrapper(OicUuid_t deviceId, char* pinBuffer, size_t pinBufferSize, void* context)
{
(static_cast<InputPinContext*>(context))->callback(deviceId, pinBuffer, pinBufferSize);
}
return result;
}
- static void displayPinCallbackWrapper(char* pinData, size_t pinDataSize, void* context)
+ static void OC_CALL displayPinCallbackWrapper(char* pinData, size_t pinDataSize, void* context)
{
(static_cast<DisplayPinContext*>(context))->callback(pinData, pinDataSize);
}
return result;
}
- OCStackResult OCSecure::displayNumCallbackWrapper(void* ctx,
+ OCStackResult OC_CALL OCSecure::displayNumCallbackWrapper(void* ctx,
uint8_t verifNum[MUTUAL_VERIF_NUM_LEN])
{
uint8_t *number = NULL;
return result;
}
- OCStackResult OCSecure::confirmUserCallbackWrapper(void* ctx)
+ OCStackResult OC_CALL OCSecure::confirmUserCallbackWrapper(void* ctx)
{
UserConfirmNumContext* context = static_cast<UserConfirmNumContext*>(ctx);
if (!context)