1 /* 2 * Copyright (c) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #include "device_auth.h" 17 #include "dm_constants.h" 18 19 int32_t (*deleteGroup)(int64_t requestId, const char *appId, const char *disbandParams) 20 { 21 if (disbandParams == 0) { 22 return ERR_DM_FAILED; 23 } 24 25 return DM_OK; 26 } 27 28 int32_t (*getRelatedGroups)(const char *appId, const char *peerDeviceId, char **returnGroupVec, uint32_t *groupNum) 29 { 30 (void)appId; 31 (void)peerDeviceId; 32 (void)returnGroupVec; 33 (void)groupNum; 34 return 0; 35 } 36 37 int32_t (*createGroup)(int64_t requestId, const char *appId, const char *createParams) 38 { 39 if (requestId == 0) { 40 return ERR_DM_FAILED; 41 } 42 (void)appId; 43 (void)createParams; 44 return 0; 45 } 46 47 int32_t (*getRelatedGroups)(const char *appId, const char *peerDeviceId, char **returnGroupVec, uint32_t *groupNum) 48 { 49 if (peerDeviceId == "123") { 50 returnGroupVec = nullptr; 51 } 52 53 if (peerDeviceId == "12345") { 54 groupNum = 0; 55 } 56 57 if (peerDeviceId == "34567") { 58 groupNum = 1; 59 returnGroupVec = "123"; 60 } 61 } 62