• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021-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 #ifndef GROUP_MANAGER_H
17 #define GROUP_MANAGER_H
18 
19 #include "device_auth.h"
20 #include "json_utils.h"
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 int32_t InitGroupManager(void);
27 void DestroyGroupManager(void);
28 
29 int32_t CreateGroupImpl(int32_t osAccountId, int64_t requestId, const char *appId, const char *createParams);
30 int32_t DeleteGroupImpl(int32_t osAccountId, int64_t requestId, const char *appId, const char *disbandParams);
31 int32_t AddMemberToGroupImpl(int32_t osAccountId, int64_t requestId, const char *appId, const char *addParams);
32 int32_t DeleteMemberFromGroupImpl(int32_t osAccountId, int64_t requestId, const char *appId, const char *deleteParams);
33 int32_t AddMultiMembersToGroupImpl(int32_t osAccountId, const char *appId, const char *addParams);
34 int32_t DelMultiMembersFromGroupImpl(int32_t osAccountId, const char *appId, const char *deleteParams);
35 int32_t ProcessBindDataImpl(int64_t requestId, const uint8_t *data, uint32_t dataLen);
36 
37 int32_t RegListenerImpl(const char *appId, const DataChangeListener *listener);
38 int32_t UnRegListenerImpl(const char *appId);
39 
40 int32_t CheckAccessToGroupImpl(int32_t osAccountId, const char *appId, const char *groupId);
41 int32_t GetGroupInfoByIdImpl(int32_t osAccountId, const char *appId, const char *groupId, char **returnGroupInfo);
42 int32_t GetGroupInfoImpl(int32_t osAccountId, const char *appId, const char *queryParams,
43     char **returnGroupVec, uint32_t *groupNum);
44 int32_t GetJoinedGroupsImpl(int32_t osAccountId, const char *appId, int groupType,
45     char **returnGroupVec, uint32_t *groupNum);
46 int32_t GetRelatedGroupsImpl(int32_t osAccountId, const char *appId, const char *peerDeviceId,
47     char **returnGroupVec, uint32_t *groupNum);
48 int32_t GetDeviceInfoByIdImpl(int32_t osAccountId, const char *appId, const char *deviceId, const char *groupId,
49     char **returnDeviceInfo);
50 int32_t GetTrustedDevicesImpl(int32_t osAccountId, const char *appId, const char *groupId,
51     char **returnDevInfoVec, uint32_t *deviceNum);
52 bool IsDeviceInGroupImpl(int32_t osAccountId, const char *appId, const char *groupId, const char *deviceId);
53 int32_t GetPkInfoListImpl(int32_t osAccountId, const char *appId, const char *queryParams,
54     char **returnInfoList, uint32_t *returnInfoNum);
55 void CancelRequestImpl(int64_t requestId, const char *appId);
56 void DestroyInfoImpl(char **returnInfo);
57 
58 #ifdef __cplusplus
59 }
60 #endif
61 #endif
62