!5722 feat:修改发现模块日志

Merge pull request !5722 from quyihao/master
This commit is contained in:
openharmony_ci 2024-04-17 03:39:28 +00:00 committed by Gitee
commit 35967a6112
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 12 additions and 7 deletions

View File

@ -239,6 +239,7 @@ static char *GetSrvType(BaseServiceType srvType)
static void BcStartBroadcastingCallback(int32_t adapterBcId, int32_t status) static void BcStartBroadcastingCallback(int32_t adapterBcId, int32_t status)
{ {
static uint32_t callCount = 0;
DISC_LOGI(DISC_BLE, "enter. adapterBcId=%{public}d", adapterBcId); DISC_LOGI(DISC_BLE, "enter. adapterBcId=%{public}d", adapterBcId);
for (uint32_t managerId = 0; managerId < BC_NUM_MAX; managerId++) { for (uint32_t managerId = 0; managerId < BC_NUM_MAX; managerId++) {
int32_t ret = SoftBusMutexLock(&g_bcLock); int32_t ret = SoftBusMutexLock(&g_bcLock);
@ -250,8 +251,8 @@ static void BcStartBroadcastingCallback(int32_t adapterBcId, int32_t status)
SoftBusMutexUnlock(&g_bcLock); SoftBusMutexUnlock(&g_bcLock);
continue; continue;
} }
DISC_LOGI(DISC_BLE, "srvType=%{public}s, managerId=%{public}u, adapterBcId=%{public}d, status=%{public}d", DISC_LOGI(DISC_BLE, "srvType=%{public}s, managerId=%{public}u, adapterBcId=%{public}d, status=%{public}d,"
GetSrvType(bcManager->srvType), managerId, adapterBcId, status); "callCount=%{public}u", GetSrvType(bcManager->srvType), managerId, adapterBcId, status, callCount++);
if (status == SOFTBUS_BC_STATUS_SUCCESS) { if (status == SOFTBUS_BC_STATUS_SUCCESS) {
bcManager->isAdvertising = true; bcManager->isAdvertising = true;
SoftBusCondSignal(&bcManager->cond); SoftBusCondSignal(&bcManager->cond);
@ -1300,8 +1301,9 @@ int32_t StartBroadcasting(int32_t bcId, const BroadcastParam *param, const Broad
} }
SoftbusBroadcastParam adapterParam; SoftbusBroadcastParam adapterParam;
ConvertBcParams(param, &adapterParam); ConvertBcParams(param, &adapterParam);
DISC_LOGI(DISC_BLE, "start service srvType=%{public}s, bcId=%{public}d, adapterId=%{public}d", DISC_LOGI(DISC_BLE, "start service srvType=%{public}s, bcId=%{public}d, adapterId=%{public}d,"
GetSrvType(g_bcManager[bcId].srvType), bcId, g_bcManager[bcId].adapterBcId); "callCount=%{public}u", GetSrvType(g_bcManager[bcId].srvType), bcId,
g_bcManager[bcId].adapterBcId, callCount++);
SoftBusMutexUnlock(&g_bcLock); SoftBusMutexUnlock(&g_bcLock);
ret = g_interface[g_interfaceId]->StartBroadcasting(g_bcManager[bcId].adapterBcId, &adapterParam, &softbusBcData); ret = g_interface[g_interfaceId]->StartBroadcasting(g_bcManager[bcId].adapterBcId, &adapterParam, &softbusBcData);
g_bcManager[bcId].time = MgrGetSysTime(); g_bcManager[bcId].time = MgrGetSysTime();
@ -1468,6 +1470,7 @@ static bool NeedUpdateScan(int32_t listenerId)
static int32_t StartScanSub(int32_t listenerId) static int32_t StartScanSub(int32_t listenerId)
{ {
static uint32_t callCount = 0;
SoftBusBcScanParams adapterParam; SoftBusBcScanParams adapterParam;
BuildSoftBusBcScanParams(&g_scanManager[listenerId].param, &adapterParam); BuildSoftBusBcScanParams(&g_scanManager[listenerId].param, &adapterParam);
@ -1485,8 +1488,9 @@ static int32_t StartScanSub(int32_t listenerId)
DISC_CHECK_AND_RETURN_RET_LOGE(filterSize > 0, SOFTBUS_BC_MGR_START_SCAN_NO_FILTER, DISC_BLE, "fitersize is 0!"); DISC_CHECK_AND_RETURN_RET_LOGE(filterSize > 0, SOFTBUS_BC_MGR_START_SCAN_NO_FILTER, DISC_BLE, "fitersize is 0!");
DumpBcScanFilter(adapterFilter, filterSize); DumpBcScanFilter(adapterFilter, filterSize);
DISC_LOGI(DISC_BLE, "start service srvType=%{public}s, listenerId=%{public}d, adapterId=%{public}d", DISC_LOGI(DISC_BLE, "start service srvType=%{public}s, listenerId=%{public}d, adapterId=%{public}d,"
GetSrvType(g_scanManager[listenerId].srvType), listenerId, g_scanManager[listenerId].adapterScanId); "callCount=%{public}u", GetSrvType(g_scanManager[listenerId].srvType), listenerId,
g_scanManager[listenerId].adapterScanId, callCount++);
int32_t ret = g_interface[g_interfaceId]->StartScan(g_scanManager[listenerId].adapterScanId, &adapterParam, int32_t ret = g_interface[g_interfaceId]->StartScan(g_scanManager[listenerId].adapterScanId, &adapterParam,
adapterFilter, filterSize); adapterFilter, filterSize);
SoftBusFree(adapterFilter); SoftBusFree(adapterFilter);

View File

@ -346,6 +346,7 @@ static int32_t ScanFilter(const BroadcastReportInfo *reportInfo)
static void ProcessDisConPacket(const BroadcastReportInfo *reportInfo, DeviceInfo *foundInfo) static void ProcessDisConPacket(const BroadcastReportInfo *reportInfo, DeviceInfo *foundInfo)
{ {
static uint32_t callCount = 0;
DeviceWrapper device = { DeviceWrapper device = {
.info = foundInfo, .info = foundInfo,
.power = SOFTBUS_ILLEGAL_BLE_POWER .power = SOFTBUS_ILLEGAL_BLE_POWER
@ -359,7 +360,7 @@ static void ProcessDisConPacket(const BroadcastReportInfo *reportInfo, DeviceInf
return; return;
} }
if ((foundInfo->capabilityBitmap[0] & g_bleInfoManager[BLE_PUBLISH | BLE_PASSIVE].capBitMap[0]) == 0x0) { if ((foundInfo->capabilityBitmap[0] & g_bleInfoManager[BLE_PUBLISH | BLE_PASSIVE].capBitMap[0]) == 0x0) {
DISC_LOGI(DISC_BLE, "don't match passive publish capBitMap"); DISC_LOGI(DISC_BLE, "don't match passive publish capBitMap, callCount=%{public}u", callCount++);
(void)SoftBusMutexUnlock(&g_bleInfoLock); (void)SoftBusMutexUnlock(&g_bleInfoLock);
return; return;
} }