1 /******************************************************************
3 * Copyright 2016 Samsung Electronics All Rights Reserved.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * LICENSE-2.0" target="_blank">http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
20 ******************************************************************/
21 #ifndef PMCsdkAppMotHelper_H_
22 #define PMCsdkAppMotHelper_H_
25 #include "PMCsdkAppUtilityHelper.h"
27 #define ctxProvisionPreconfPin "ProvisionPreconfPin Context"
28 #define ctxChangeMOTMode "OCChangeMOTMode Context"
29 #define ctxSelectMOTMethod "OCSelectMOTMethod Context"
31 FILE* fopenMotClient(const char*, const char*);
33 OicSecAcl_t* createAclForLEDAccess(const OicUuid_t* subject);
36 bool discoverMultipleOwnerEnabledDevices(int nTime, OCProvisionDev_t** motdev_list,
37 OCStackResult expectedResult);
38 bool discoverMultipleOwnedDevices(int nTime, OCProvisionDev_t** motOnwedDev_list,
39 OCStackResult expectedResult);
40 bool addPreconfigPIN(const OCProvisionDev_t *targetDeviceInfo, const char* preconfPIN,
41 size_t preconfPINLen, OCStackResult expectedResult);
42 bool doMultipleOwnershipTransfer(void* ctx, OCProvisionDev_t *targetDevices,
43 OCProvisionResultCB resultCallback, OCStackResult expectedResult);
44 bool getLedResources(OCProvisionDev_t *selDev,OCStackResult expectedResult);
45 bool putLedResources(OCProvisionDev_t *selDev,OCStackResult expectedResult);
47 bool provisionPreconfPin(void* ctx, OCProvisionDev_t *targetDeviceInfo, const char * preconfPin, size_t preconfPinLen, OCProvisionResultCB resultCallback, OCStackResult expectedResult);
48 bool changeMOTMode(void *ctx, const OCProvisionDev_t *targetDeviceInfo, const OicSecMomType_t momType, OCProvisionResultCB resultCallback, OCStackResult expectedResult);
49 bool selectMOTMethod(void *ctx, const OCProvisionDev_t *targetDeviceInfo, const OicSecOxm_t oxmSelValue, OCProvisionResultCB resultCallback, OCStackResult expectedResult);
54 void multipleOwnershipTransferCB(void* ctx, size_t nOfRes, OCProvisionResult_t* arr,bool hasError);
55 void provisionPreconfPinCB(void* ctx, size_t nOfRes, OCProvisionResult_t* arr, bool hasError);
56 void changeMOTModeCB(void* ctx, size_t nOfRes, OCProvisionResult_t* arr, bool hasError);
57 void selectMOTMethodCB(void* ctx, size_t nOfRes, OCProvisionResult_t* arr, bool hasError);
58 OCStackResult LedCB(void *ctx, OCDoHandle UNUSED, OCClientResponse *clientResponse);
61 * All Utility Methods for Provision Manager
63 std::string getFailureMessage();
64 int waitCallbackRetMot(void);