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
fed8b9f25b
commit
18ecd39ae2
@ -12,7 +12,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include <securec.h>
|
||||
|
||||
#include "softbus_config_type.h"
|
||||
|
||||
#define MAX_BYTES_LENGTH 4194304
|
||||
|
@ -17,6 +17,7 @@
|
||||
#define SOFTBUS_CONFIG_TYPE_H
|
||||
|
||||
#include <securec.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
|
@ -19,8 +19,9 @@
|
||||
#include <sys/time.h>
|
||||
|
||||
#include "softbus_errcode.h"
|
||||
#include "softbus_log.h"
|
||||
#include "softbus_feature_config.h"
|
||||
#include "softbus_log.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -60,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;
|
||||
}
|
||||
|
@ -16,7 +16,6 @@
|
||||
#include "lnn_net_builder.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <securec.h>
|
||||
|
||||
#include "auth_interface.h"
|
||||
@ -30,9 +29,10 @@
|
||||
#include "lnn_exchange_device_info.h"
|
||||
#include "lnn_network_id.h"
|
||||
#include "softbus_errcode.h"
|
||||
#include "softbus_feature_config.h"
|
||||
#include "softbus_log.h"
|
||||
#include "softbus_mem_interface.h"
|
||||
#include "softbus_feature_config.h"
|
||||
|
||||
|
||||
#define DEFAULT_MAX_LNN_CONNECTION_COUNT 10
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
@ -18,8 +18,9 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include "softbus_errcode.h"
|
||||
#include "softbus_log.h"
|
||||
#include "softbus_feature_config.h"
|
||||
#include "softbus_log.h"
|
||||
|
||||
|
||||
/* support bit1:br, bit2:wifi, bit4:wifi 2.4G */
|
||||
#define DEFAUTL_LNN_CAPBILITY 0x16
|
||||
@ -40,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;
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ if (defined(ohos_lite)) {
|
||||
"$libsec_deps_path",
|
||||
"//build/lite/config/component/cJSON:cjson_shared",
|
||||
"$dsoftbus_root_path/adapter:softbus_adapter",
|
||||
"//utils/native/base:utils",
|
||||
# "//utils/native/base:utils",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@ -16,7 +16,11 @@
|
||||
#ifndef SOFTBUS_FEATURE_CONFIG_H
|
||||
#define SOFTBUS_FEATURE_CONFIG_H
|
||||
|
||||
#include <securec.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "softbus_config_type.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
|
@ -30,7 +30,7 @@
|
||||
|
||||
void SoftbusConfigAdaptInit(const ConfigSetProc *sets)
|
||||
{
|
||||
int val;
|
||||
int32_t val;
|
||||
val = MAX_BYTES_LENGTH;
|
||||
sets->SetConfig(SOFTBUS_INT_MAX_BYTES_LENGTH, (unsigned char*)&val, sizeof(val));
|
||||
val = MAX_MESSAGE_LENGTH;
|
||||
|
@ -14,6 +14,7 @@
|
||||
*/
|
||||
|
||||
#include <securec.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "softbus_errcode.h"
|
||||
#include "softbus_config_adapter.h"
|
||||
|
@ -24,9 +24,9 @@
|
||||
#include "softbus_conn_manager.h"
|
||||
#include "softbus_def.h"
|
||||
#include "softbus_errcode.h"
|
||||
#include "softbus_feature_config.h"
|
||||
#include "softbus_log.h"
|
||||
#include "softbus_mem_interface.h"
|
||||
#include "softbus_feature_config.h"
|
||||
#include "softbus_type_def.h"
|
||||
#include "stdbool.h"
|
||||
#include "string.h"
|
||||
@ -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);
|
||||
|
@ -25,9 +25,9 @@
|
||||
#include "softbus_conn_manager.h"
|
||||
#include "softbus_def.h"
|
||||
#include "softbus_errcode.h"
|
||||
#include "softbus_feature_config.h"
|
||||
#include "softbus_log.h"
|
||||
#include "softbus_mem_interface.h"
|
||||
#include "softbus_feature_config.h"
|
||||
#include "softbus_tcp_socket.h"
|
||||
#include "softbus_type_def.h"
|
||||
#include "softbus_utils.h"
|
||||
@ -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);
|
||||
|
@ -20,9 +20,9 @@
|
||||
|
||||
#include "bus_center_server_proxy.h"
|
||||
#include "softbus_errcode.h"
|
||||
#include "softbus_feature_config.h"
|
||||
#include "softbus_log.h"
|
||||
#include "softbus_mem_interface.h"
|
||||
#include "softbus_feature_config.h"
|
||||
#include "softbus_utils.h"
|
||||
|
||||
#define DEFAULT_NODE_STATE_CB_CNT 10
|
||||
@ -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;
|
||||
}
|
||||
|
@ -31,9 +31,9 @@
|
||||
#include "softbus_conn_manager.h"
|
||||
#include "softbus_def.h"
|
||||
#include "softbus_errcode.h"
|
||||
#include "softbus_feature_config.h"
|
||||
#include "softbus_log.h"
|
||||
#include "softbus_mem_interface.h"
|
||||
#include "softbus_feature_config.h"
|
||||
#include "softbus_tcp_connect_manager.h"
|
||||
#include "softbus_tcp_socket.h"
|
||||
#include "softbus_thread_pool.h"
|
||||
@ -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