From 137481b37047c5a9b0b45771b3fbe1e57d3e2eeb Mon Sep 17 00:00:00 2001 From: hmilylmk Date: Wed, 17 Aug 2022 11:49:40 +0800 Subject: [PATCH] dsoftbus: add new define in device_auth module dsoftbus use new interface in high version, so modify the defines. * add new deines in device_auth.h * change GroupAuthManager.authDevice define. Signed-off-by: hmilylmk --- dsoftbus/depend/device_auth/device_auth.c | 2 +- .../depend/device_auth/include/device_auth.h | 21 ++++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/dsoftbus/depend/device_auth/device_auth.c b/dsoftbus/depend/device_auth/device_auth.c index 395449c3..db5c6a38 100644 --- a/dsoftbus/depend/device_auth/device_auth.c +++ b/dsoftbus/depend/device_auth/device_auth.c @@ -18,7 +18,7 @@ static int32_t ProcessData(int64_t authReqId, const uint8_t *data, uint32_t data } -static int32_t AuthDevice(int64_t authReqId, const char *authParams, +static int32_t AuthDevice(int32_t OsAccountId, int64_t authReqId, const char *authParams, const DeviceAuthCallback *callback) { callback->onTransmit(authReqId, (const uint8_t *)AUTH_START, strlen(AUTH_START)); diff --git a/dsoftbus/depend/device_auth/include/device_auth.h b/dsoftbus/depend/device_auth/include/device_auth.h index 200705ea..2c7a0769 100644 --- a/dsoftbus/depend/device_auth/include/device_auth.h +++ b/dsoftbus/depend/device_auth/include/device_auth.h @@ -4,6 +4,23 @@ #include #include +typedef enum { + DEFAULT_OS_ACCOUNT = 0, + INVALID_OS_ACCOUNT = -1, + ANY_OS_ACCOUNT = -2, +} OsAccountEnum; + +typedef enum { + GROUP_TYPE_INVALID = -1, + ALL_GROUP = 0, + IDENTICAL_ACCOUNT_GROUP = 1, + PEER_TO_PEER_GROUP = 256, + COMPATIBLE_GROUP = 512, + ACROSS_ACCOUNT_AUTHORIZE_GROUP = 1282 +} GroupType; + +#define FIELD_GROUP_ID "groupId" +#define FIELD_GROUP_TYPE "groupType" #define FIELD_PEER_CONN_DEVICE_ID "peerConnDeviceId" #define FIELD_SERVICE_PKG_NAME "servicePkgName" #define FIELD_IS_CLIENT "isClient" @@ -22,11 +39,13 @@ typedef struct { typedef struct { int32_t (*processData)(int64_t authReqId, const uint8_t *data, uint32_t dataLen, const DeviceAuthCallback *gaCallback); - int32_t (*authDevice)(int64_t authReqId, const char *authParams, const DeviceAuthCallback *gaCallback); + int32_t (*authDevice)(int32_t osAccountId, int64_t authReqId, const char *authParams, const DeviceAuthCallback *gaCallback); } GroupAuthManager; typedef struct { void (*onDeviceNotTrusted)(const char *peerUdid); + void (*onGroupCreated)(const char *groupInfo); + void (*onGroupDeleted)(const char *groupInfo); } DataChangeListener; typedef struct { -- Gitee