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
18ecd39ae2
commit
aa97be161b
@ -87,7 +87,7 @@ static NetBuilder g_netBuilder;
|
||||
|
||||
static void NetBuilderConfigInit(void)
|
||||
{
|
||||
if (SoftbusGetConfig(SOFTBUS_INT_MAX_LNN_CONNECTION_CNT,
|
||||
if (SoftbusGetConfig(SOFTBUS_INT_MAX_LNN_CONNECTION_CNT,
|
||||
(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;
|
||||
|
@ -40,7 +40,7 @@ uint32_t LnnGetNetCapabilty(void)
|
||||
uint32_t capability = 0;
|
||||
uint32_t configValue;
|
||||
|
||||
if (SoftbusGetConfig(SOFTBUS_INT_LNN_SUPPORT_CAPBILITY,
|
||||
if (SoftbusGetConfig(SOFTBUS_INT_LNN_SUPPORT_CAPBILITY,
|
||||
(unsigned char*)&configValue,sizeof(configValue)) != SOFTBUS_OK) {
|
||||
LOG_ERR("get lnn capbility fail, use default value");
|
||||
configValue = DEFAUTL_LNN_CAPBILITY;
|
||||
|
@ -1590,17 +1590,17 @@ static int32_t InitProperty()
|
||||
{
|
||||
g_brBuffSize = INVALID_LENGTH;
|
||||
g_brSendPeerLen = INVALID_LENGTH;
|
||||
if (SoftbusGetConfig(SOFTBUS_INT_CONN_BR_MAX_DATA_LENGTH,
|
||||
if (SoftbusGetConfig(SOFTBUS_INT_CONN_BR_MAX_DATA_LENGTH,
|
||||
(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,
|
||||
if (SoftbusGetConfig(SOFTBUS_INT_CONN_RFCOM_SEND_MAX_LEN,
|
||||
(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,
|
||||
if (SoftbusGetConfig(SOFTBUS_INT_CONN_BR_RECEIVE_MAX_LEN,
|
||||
(unsigned char*)&g_brSendQueueMaxLen,sizeof(g_brSendQueueMaxLen)) != SOFTBUS_OK) {
|
||||
LOG_ERR("get br SendQueueMaxLen fail");
|
||||
}
|
||||
|
@ -465,17 +465,17 @@ static int32_t InitProperty()
|
||||
g_tcpMaxConnNum = INVALID_DATA;
|
||||
g_tcpTimeOut = INVALID_DATA;
|
||||
g_tcpMaxLen = INVALID_DATA;
|
||||
if (SoftbusGetConfig(SOFTBUS_INT_CONN_TCP_MAX_CONN_NUM,
|
||||
if (SoftbusGetConfig(SOFTBUS_INT_CONN_TCP_MAX_CONN_NUM,
|
||||
(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,
|
||||
if (SoftbusGetConfig(SOFTBUS_INT_CONN_TCP_MAX_LENGTH,
|
||||
(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,
|
||||
if (SoftbusGetConfig(SOFTBUS_INT_CONN_TCP_TIME_OUT,
|
||||
(unsigned char*)&g_tcpTimeOut,sizeof(g_tcpTimeOut)) != SOFTBUS_OK) {
|
||||
LOG_ERR("get tcp TimeOut fail");
|
||||
}
|
||||
|
@ -217,7 +217,7 @@ int BusCenterClientInit(void)
|
||||
int32_t rc = SOFTBUS_ERR;
|
||||
|
||||
pthread_mutex_init(&g_busCenterClient.lock, NULL);
|
||||
if (SoftbusGetConfig(SOFTBUS_INT_MAX_NODE_STATE_CB_CNT,
|
||||
if (SoftbusGetConfig(SOFTBUS_INT_MAX_NODE_STATE_CB_CNT,
|
||||
(unsigned char*)&g_maxNodeStateCbCount,sizeof(g_maxNodeStateCbCount)) != SOFTBUS_OK) {
|
||||
LOG_ERR("Cannot get NodeStateCbCount from config file");
|
||||
g_maxNodeStateCbCount = DEFAULT_NODE_STATE_CB_CNT;
|
||||
|
@ -349,7 +349,7 @@ HWTEST_F(SoftbusTcpManagerTest, testTcpManager008, TestSize.Level1)
|
||||
|
||||
int32_t maxConnNum;
|
||||
int32_t i = 0;
|
||||
if (SoftbusGetConfig(SOFTBUS_INT_CONN_TCP_MAX_CONN_NUM,
|
||||
if (SoftbusGetConfig(SOFTBUS_INT_CONN_TCP_MAX_CONN_NUM,
|
||||
(unsigned char*)&maxConnNum,sizeof(maxConnNum)) != SOFTBUS_OK) {
|
||||
LOG_ERR("get maxConnNum fail");
|
||||
}
|
||||
@ -389,7 +389,7 @@ HWTEST_F(SoftbusTcpManagerTest, testTcpManager009, TestSize.Level1)
|
||||
(void)strcpy_s(option.info.ipOption.ip, IP_LEN, Ip);
|
||||
|
||||
int maxDataLen;
|
||||
if (SoftbusGetConfig(SOFTBUS_INT_CONN_TCP_MAX_LENGTH,
|
||||
if (SoftbusGetConfig(SOFTBUS_INT_CONN_TCP_MAX_LENGTH,
|
||||
(unsigned char*)&maxDataLen,sizeof(maxDataLen)) != SOFTBUS_OK) {
|
||||
LOG_ERR("get maxDataLen fail");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user