1 /*
2  * Copyright (c) 2024 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef SOCKET_COMMON_H
17 #define SOCKET_COMMON_H
18 
19 #include "socket.h"
20 #include "softbus_common.h"
21 #include "softbus_error_code.h"
22 
23 namespace OHOS {
24 #define LOG(fmt, args...)                     \
25     do {                                      \
26         fprintf(stdout, "" fmt "\n", ##args); \
27     } while (false)
28 
29 #define LOGI(fmt, args...)                                                     \
30     do {                                                                       \
31         fprintf(stdout, "[INFO][%s:%d]" fmt "\n", __func__, __LINE__, ##args); \
32     } while (false)
33 
34 #define LOGE(fmt, args...)                                                    \
35     do {                                                                      \
36         fprintf(stdout, "[ERR][%s:%d]" fmt "\n", __func__, __LINE__, ##args); \
37     } while (false)
38 
39 inline const char *PKG_NAME = "com.communication.demo";
40 inline const char *TEST_NOTIFY_NAME = "com.communication.demo.notify.client";
41 inline const char *TEST_NOTIFY_SRV_NAME = "com.communication.demo.notify.server";
42 inline const char *TEST_SESSION_NAME = "com.communication.demo.client";
43 inline const char *TEST_SESSION_NAME_SRV = "com.communication.demo.server";
44 
45 inline const char *TEST_STREAM_DATA = "EncryptStreamOrUnencryptStreamTest";
46 
47 int32_t TestInit();
48 int32_t TestDeInit();
49 
50 char *WaitOnLineAndGetNetWorkId();
51 } // namespace OHOS
52 #endif // SOCKET_COMMON_H