mirror of
https://gitee.com/openharmony/communication_dsoftbus
synced 2024-11-24 09:20:04 +00:00
modify config_get interface,and other minor modifications
Signed-off-by: zhufenghao <2581725389@qq.com>
This commit is contained in:
parent
aa97be161b
commit
af8da45b4e
@ -61,7 +61,7 @@ AuthSideFlag AuthGetSideByRemoteSeq(int64_t seq)
|
||||
void AuthGetAbility(void)
|
||||
{
|
||||
if (SoftbusGetConfig(SOFTBUS_INT_AUTH_ABILITY_COLLECTION,
|
||||
(unsigned char*)&g_authAbility,sizeof(g_authAbility)) != SOFTBUS_OK) {
|
||||
(unsigned char*)&g_authAbility, sizeof(g_authAbility)) != SOFTBUS_OK) {
|
||||
LOG_ERR("Cannot get auth ability from config file");
|
||||
g_authAbility = DEFAULT_AUTH_ABILITY_COLLECTION;
|
||||
}
|
||||
|
@ -15,8 +15,8 @@
|
||||
|
||||
#include "lnn_net_builder.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <securec.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "auth_interface.h"
|
||||
#include "bus_center_event.h"
|
||||
@ -88,7 +88,7 @@ static NetBuilder g_netBuilder;
|
||||
static void NetBuilderConfigInit(void)
|
||||
{
|
||||
if (SoftbusGetConfig(SOFTBUS_INT_MAX_LNN_CONNECTION_CNT,
|
||||
(unsigned char*)&g_netBuilder.maxConnCount,sizeof(g_netBuilder.maxConnCount)) != SOFTBUS_OK) {
|
||||
(unsigned char*)&g_netBuilder.maxConnCount, sizeof(g_netBuilder.maxConnCount)) != SOFTBUS_OK) {
|
||||
LOG_ERR("get lnn max connection count fail, use default value");
|
||||
g_netBuilder.maxConnCount = DEFAULT_MAX_LNN_CONNECTION_COUNT;
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ uint32_t LnnGetNetCapabilty(void)
|
||||
uint32_t configValue;
|
||||
|
||||
if (SoftbusGetConfig(SOFTBUS_INT_LNN_SUPPORT_CAPBILITY,
|
||||
(unsigned char*)&configValue,sizeof(configValue)) != SOFTBUS_OK) {
|
||||
(unsigned char*)&configValue, sizeof(configValue)) != SOFTBUS_OK) {
|
||||
LOG_ERR("get lnn capbility fail, use default value");
|
||||
configValue = DEFAUTL_LNN_CAPBILITY;
|
||||
}
|
||||
|
@ -1591,17 +1591,17 @@ static int32_t InitProperty()
|
||||
g_brBuffSize = INVALID_LENGTH;
|
||||
g_brSendPeerLen = INVALID_LENGTH;
|
||||
if (SoftbusGetConfig(SOFTBUS_INT_CONN_BR_MAX_DATA_LENGTH,
|
||||
(unsigned char*)&g_brBuffSize,sizeof(g_brBuffSize)) != SOFTBUS_OK) {
|
||||
(unsigned char*)&g_brBuffSize, sizeof(g_brBuffSize)) != SOFTBUS_OK) {
|
||||
LOG_ERR("get br BuffSize fail");
|
||||
}
|
||||
LOG_INFO("br BuffSize is %u", g_brBuffSize);
|
||||
if (SoftbusGetConfig(SOFTBUS_INT_CONN_RFCOM_SEND_MAX_LEN,
|
||||
(unsigned char*)&g_brSendPeerLen,sizeof(g_brSendPeerLen)) != SOFTBUS_OK) {
|
||||
(unsigned char*)&g_brSendPeerLen, sizeof(g_brSendPeerLen)) != SOFTBUS_OK) {
|
||||
LOG_ERR("get br SendPeerLen fail");
|
||||
}
|
||||
LOG_INFO("br SendPeerLen is %u", g_brSendPeerLen);
|
||||
if (SoftbusGetConfig(SOFTBUS_INT_CONN_BR_RECEIVE_MAX_LEN,
|
||||
(unsigned char*)&g_brSendQueueMaxLen,sizeof(g_brSendQueueMaxLen)) != SOFTBUS_OK) {
|
||||
(unsigned char*)&g_brSendQueueMaxLen, sizeof(g_brSendQueueMaxLen)) != SOFTBUS_OK) {
|
||||
LOG_ERR("get br SendQueueMaxLen fail");
|
||||
}
|
||||
LOG_INFO("br SendQueueMaxLen is %u", g_brSendQueueMaxLen);
|
||||
|
@ -466,17 +466,17 @@ static int32_t InitProperty()
|
||||
g_tcpTimeOut = INVALID_DATA;
|
||||
g_tcpMaxLen = INVALID_DATA;
|
||||
if (SoftbusGetConfig(SOFTBUS_INT_CONN_TCP_MAX_CONN_NUM,
|
||||
(unsigned char*)&g_tcpMaxConnNum,sizeof(g_tcpMaxConnNum)) != SOFTBUS_OK) {
|
||||
(unsigned char*)&g_tcpMaxConnNum, sizeof(g_tcpMaxConnNum)) != SOFTBUS_OK) {
|
||||
LOG_ERR("get tcp MaxConnNum fail");
|
||||
}
|
||||
LOG_INFO("tcp MaxConnNum is %u", g_tcpMaxConnNum);
|
||||
if (SoftbusGetConfig(SOFTBUS_INT_CONN_TCP_MAX_LENGTH,
|
||||
(unsigned char*)&g_tcpMaxLen,sizeof(g_tcpMaxLen)) != SOFTBUS_OK) {
|
||||
(unsigned char*)&g_tcpMaxLen, sizeof(g_tcpMaxLen)) != SOFTBUS_OK) {
|
||||
LOG_ERR("get tcp MaxLen fail");
|
||||
}
|
||||
LOG_INFO("tcp MaxLen is %u", g_tcpMaxLen);
|
||||
if (SoftbusGetConfig(SOFTBUS_INT_CONN_TCP_TIME_OUT,
|
||||
(unsigned char*)&g_tcpTimeOut,sizeof(g_tcpTimeOut)) != SOFTBUS_OK) {
|
||||
(unsigned char*)&g_tcpTimeOut, sizeof(g_tcpTimeOut)) != SOFTBUS_OK) {
|
||||
LOG_ERR("get tcp TimeOut fail");
|
||||
}
|
||||
LOG_INFO("tcp TimeOut is %u", g_tcpTimeOut);
|
||||
|
@ -218,7 +218,7 @@ int BusCenterClientInit(void)
|
||||
|
||||
pthread_mutex_init(&g_busCenterClient.lock, NULL);
|
||||
if (SoftbusGetConfig(SOFTBUS_INT_MAX_NODE_STATE_CB_CNT,
|
||||
(unsigned char*)&g_maxNodeStateCbCount,sizeof(g_maxNodeStateCbCount)) != SOFTBUS_OK) {
|
||||
(unsigned char*)&g_maxNodeStateCbCount, sizeof(g_maxNodeStateCbCount)) != SOFTBUS_OK) {
|
||||
LOG_ERR("Cannot get NodeStateCbCount from config file");
|
||||
g_maxNodeStateCbCount = DEFAULT_NODE_STATE_CB_CNT;
|
||||
}
|
||||
|
@ -350,7 +350,7 @@ HWTEST_F(SoftbusTcpManagerTest, testTcpManager008, TestSize.Level1)
|
||||
int32_t maxConnNum;
|
||||
int32_t i = 0;
|
||||
if (SoftbusGetConfig(SOFTBUS_INT_CONN_TCP_MAX_CONN_NUM,
|
||||
(unsigned char*)&maxConnNum,sizeof(maxConnNum)) != SOFTBUS_OK) {
|
||||
(unsigned char*)&maxConnNum, sizeof(maxConnNum)) != SOFTBUS_OK) {
|
||||
LOG_ERR("get maxConnNum fail");
|
||||
}
|
||||
printf("maxConnNum: %d\n", maxConnNum);
|
||||
@ -390,7 +390,7 @@ HWTEST_F(SoftbusTcpManagerTest, testTcpManager009, TestSize.Level1)
|
||||
|
||||
int maxDataLen;
|
||||
if (SoftbusGetConfig(SOFTBUS_INT_CONN_TCP_MAX_LENGTH,
|
||||
(unsigned char*)&maxDataLen,sizeof(maxDataLen)) != SOFTBUS_OK) {
|
||||
(unsigned char*)&maxDataLen, sizeof(maxDataLen)) != SOFTBUS_OK) {
|
||||
LOG_ERR("get maxDataLen fail");
|
||||
}
|
||||
printf("maxDataLen: %d\n", maxDataLen);
|
||||
|
Loading…
Reference in New Issue
Block a user