${CMAKE_CURRENT_SOURCE_DIR}/nativeui/producttest/src/testbt.cpp
${CMAKE_CURRENT_SOURCE_DIR}/nativeui/producttest/src/testSEChipTest.cpp
${CMAKE_CURRENT_SOURCE_DIR}/nativeui/producttest/src/testModel.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/producttest/src/testPing.cpp
#每日目标
${CMAKE_CURRENT_SOURCE_DIR}/nativeui/goal/src/goalmodel.cpp
--- /dev/null
+/*
+ * @Author: penglei 1624952103@qq.com
+ * @Date: 2024-09-18 17:17:23
+ * @LastEditors: penglei 1624952103@qq.com
+ * @LastEditTime: 2024-09-19 18:37:54
+ * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testPing.h
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+ */
+#ifndef TEST_PING_VIEW_H
+#define TEST_PING_VIEW_H
+
+#include "BaseView.h"
+#include "View.h"
+#include "components/ui_scroll_view.h"
+#include "components/ui_label.h"
+#include "components/ui_label_ext.h"
+#include "components/ui_button.h"
+#include "components/ui_image_view.h"
+#include "components/ui_label_button_ext.h"
+
+//#include "cmsis_os.h"
+#include <iostream>
+namespace OHOS
+{
+
+ class testPingView
+ {
+
+ public:
+ struct ButtonConfig_ext_t
+ {
+ int x;
+ int y;
+ int w;
+ int h;
+ const char *str;
+ const char *ViewId;
+ const char *ImageSrc;
+
+ //label
+ int label_x;
+ int label_y;
+ uint8_t ALIGN;
+ int Fontsize;
+
+ };
+
+ struct LabelConfig
+ {
+ int16_t left;
+ int16_t top;
+ int16_t width;
+ int16_t height;
+ int16_t fontSize; // 字体大小
+ int16_t lineHeigh; // 行高
+ char *text; // 文本
+ uint8_t lineBreakMode; // 断行模式。
+ };
+
+
+ testPingView();
+ virtual ~testPingView();
+ static testPingView *GetInstance(void);
+
+
+ UIScrollView *testPingInitIView(uint8_t);
+ void ClearAll(void);
+ void sethostname(char *data);
+ void setresult(char *data);
+ private:
+ UILabelButtonExt *SetTheButton_ext(ButtonConfig_ext_t &buttonconfig);//, UIView::OnTouchListener *clickListener);
+ UILabel *InitLabel(LabelConfig &labelConfig);
+ bool testPingScrollViewcrollViewinit(uint8_t);
+ UIScrollView *testPingScrollView{nullptr};
+ UILabel *label_hostname{nullptr};
+
+ UILabelButtonExt* labelButton_next = nullptr;
+ UILabel *label_result{nullptr};
+
+ bool initViewStatus{false};
+ UILabel *Title{nullptr}; // 标题
+
+ };
+}
+#endif
\ No newline at end of file
+/*\r
+ * @Author: penglei 1624952103@qq.com\r
+ * @Date: 2024-08-23 10:50:37\r
+ * @LastEditors: penglei 1624952103@qq.com\r
+ * @LastEditTime: 2024-09-18 18:29:11\r
+ * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testPresenter.h\r
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE\r
+ */\r
\r
#ifndef TEST_PRESENTER_H\r
#define TEST_PRESENTER_H\r
GSENSON,\r
BTTEST,\r
SEChipTest,\r
+ PingTest,\r
OLDTEST,\r
DEEPSLEEP,\r
\r
#include "producttest/include/testold.h"\r
#include "producttest/include/testbt.h"\r
#include "producttest/include/testSEChipTest.h"\r
+#include "producttest/include/testPing.h"\r
#ifdef SUPPORT_A5133_SERVICE\r
#include "producttest/include/testA5133.h"\r
#endif\r
bool ChangeoldTESTView(int16_t thisView);\r
bool ChangeBTTESTView(int16_t thisView);\r
bool ChangeSEChipTESTView(int16_t thisView);\r
+ bool ChangePingTESTView(int16_t thisView);\r
#ifdef SUPPORT_A5133_SERVICE\r
bool ChangeA5133TESTView(int16_t thisView);\r
#endif\r
testBTView *test_BT_view{nullptr};\r
\r
testSEChipView *test_SEChip_view{nullptr};\r
+ testPingView *test_Ping_view{nullptr};\r
+ \r
#ifdef SUPPORT_A5133_SERVICE\r
testA5133View *test_A5133_view{nullptr};\r
#endif\r
--- /dev/null
+#include "wearable_log.h"
+#include "custom_utils.h"
+#include "producttest/include/testPresenter.h"
+#include "producttest/include/testPing.h"
+#include "AlarmClockModel.h"
+#include "cmsis_os2.h"
+#include "cat1_server.h"
+#include "cat1_ctl.h"
+#include "cat1_server_hal.h"
+#include "custom_runtime.h"
+#include "producttest/include/testView.h"
+
+#ifdef SUPPORT_TCPIP
+#include "lwip/api_shell.h"
+#endif
+
+namespace OHOS
+{
+
+ static testPingView *g_pSystemAboutTheWatchView{nullptr};
+ static osTimerId_t g_ping_timer=NULL;
+
+ testPingView::testPingView()
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::SystemAboutTheWatchView");
+ g_pSystemAboutTheWatchView = this;
+ }
+
+ testPingView::~testPingView()
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "testPingView::~testPingView");
+ ClearAll();
+ //g_pSystemAboutTheWatchView = nullptr;
+ }
+
+ testPingView *testPingView::GetInstance()
+ {
+
+ return g_pSystemAboutTheWatchView;
+ }
+
+ void testPingView::ClearAll()
+ {
+ if(testPingScrollView)
+ {
+ testPingScrollView->RemoveAll();
+
+ if (g_ping_timer != NULL)
+ {
+ osTimerStop(g_ping_timer);
+ osTimerDelete(g_ping_timer);
+ g_ping_timer = NULL;
+ }
+
+ // if(button)
+ // {
+ // delete button;
+ // button=nullptr;
+ // }
+ if(labelButton_next)
+ {
+ delete labelButton_next;
+ labelButton_next=nullptr;
+ }
+ if(label_hostname)
+ {
+ delete label_hostname;
+ label_hostname=nullptr;
+ }
+
+ if(label_result)
+ {
+ delete label_result;
+ label_result=nullptr;
+ }
+ if(Title)
+ {
+ delete Title;
+ Title=nullptr;
+ }
+
+
+
+ delete testPingScrollView;
+ testPingScrollView=nullptr;
+ }
+ }
+
+ UILabelButtonExt *testPingView::SetTheButton_ext(ButtonConfig_ext_t &buttonconfig)
+ {
+ UILabelButtonExt *button = new UILabelButtonExt();
+ if (button == nullptr)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, " SystemView::SetTheButton: button new fail!");
+ return nullptr;
+ }
+ button->SetPosition(buttonconfig.x, buttonconfig.y, buttonconfig.w, buttonconfig.h);
+ button->SetViewId(buttonconfig.ViewId);
+ button->SetStyle(STYLE_BACKGROUND_COLOR, Color::Blue().full);
+ //button->SetStyle(STYLE_BORDER_RADIUS,0);
+ button->SetStyleForState(STYLE_BACKGROUND_COLOR, Color::Black().full, UIButton::PRESSED);
+ //button->SetStyleForState(STYLE_BORDER_RADIUS,0, UIButton::PRESSED);
+ button->SetTouchable(true);
+ button->SetStyle(STYLE_BACKGROUND_OPA, 0x80);
+ button->SetText(buttonconfig.str);
+ button->SetAlign(TEXT_ALIGNMENT_LEFT);
+ button->SetLabelPosition(buttonconfig.label_x,buttonconfig.label_y );
+ button->SetFont(DEFAULT_VECTOR_FONT_FILENAME, buttonconfig.Fontsize);
+ UIView:: OnClickListener *touchListener = static_cast<UIView::OnClickListener *>(testPresenter::GetInstance());
+ button->SetOnClickListener(touchListener);
+
+ // UIView::OnDragListener *drgListener = static_cast<UIView::OnDragListener *>(testPresenter::GetInstance());
+ // button->SetOnDragListener(drgListener);
+
+ // button->SetDraggable(false);
+ return button;
+ }
+
+ UILabel *testPingView::InitLabel(LabelConfig &labelConfig)
+ {
+ UILabel *label = new UILabel();
+ if (label == nullptr)
+ {
+ return nullptr;
+ }
+ label->SetPosition(labelConfig.left, labelConfig.top, labelConfig.width, labelConfig.height); // 位置大小
+ label->SetStyle(STYLE_TEXT_FONT, labelConfig.fontSize); // 字体大小
+ label->SetStyle(STYLE_LINE_HEIGHT, labelConfig.lineHeigh); // 字体行高
+ label->SetText(labelConfig.text); // 内容
+ label->SetLineBreakMode(labelConfig.lineBreakMode); // 断行模式。
+ label->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_TOP);
+ label->SetFont(DEFAULT_VECTOR_FONT_FILENAME, labelConfig.fontSize);
+ // label->SetAlign(TEXT_ALIGNMENT_LEFT);
+ return label;
+ }
+
+ void testPingView::sethostname(char *data)
+ {
+ if(label_hostname != NULL)
+ label_hostname->SetText(data);
+ }
+ void testPingView::setresult(char *data)
+ {
+ if(label_result != NULL)
+ label_result->SetText(data);
+ }
+
+ static void msgupdateTimerCallBack(int data)
+ {
+ char hostname[20] = {0};
+ char result[256] = {0};
+ get_ping_hostname(hostname,sizeof(hostname));
+ get_ping_result(result,sizeof(result));
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "result : %s ",result);
+ OHOS::testPingView *pview = OHOS::testPingView::GetInstance();
+ pview->sethostname(hostname);
+ pview->setresult(result);
+ }
+
+ bool testPingView::testPingScrollViewcrollViewinit(uint8_t id)
+ {
+
+ testPingScrollView = new UIScrollView();
+ if (testPingScrollView == nullptr)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::testPingScrollView new fail!");
+ return false;
+ }
+ testPingScrollView->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight());
+ testPingScrollView->SetStyle(STYLE_BACKGROUND_OPA, 0xff);
+ testPingScrollView->SetStyle(STYLE_BORDER_RADIUS, 0);
+ testPingScrollView->SetStyle(STYLE_BACKGROUND_COLOR, Color::Black().full);
+ testPingScrollView->SetStyle(STYLE_BORDER_COLOR, Color::Yellow().blue);
+
+ LabelConfig Config = {
+ .left = 0,
+ .top = 100,
+ .width = 466,
+ .height = 40,
+ .fontSize = 30,
+ .lineHeigh = 35,
+ .text = "www.****.com",
+ .lineBreakMode = UILabel::LINE_BREAK_MARQUEE,
+ };
+ label_hostname= InitLabel(Config);
+ if (label_hostname == nullptr)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::SystemAboutTheWatchTitle new fail!");
+ return false;
+ }
+ testPingScrollView->Add(label_hostname);
+
+ Config = {
+ .left = 70,
+ .top = 200,
+ .width = 350,
+ .height = 35,
+ .fontSize = 40,
+ .lineHeigh = 35,
+ .text = "connecting ...",
+ .lineBreakMode = UILabel::LINE_BREAK_WRAP,
+ };
+ label_result= InitLabel(Config);
+ if (label_result == nullptr)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::SystemAboutTheWatchTitle new fail!");
+ return false;
+ }
+ testPingScrollView->Add(label_result);
+
+
+ labelButton_next= testAboutView::GetInstance()->init_button_next(267,278,Test_ViewMapper_t[id].viewid_str_next);
+ testPingScrollView->Add(labelButton_next);
+
+ Title= testAboutView::GetInstance()->init_title(165,45,"Ping_TEST");
+ testPingScrollView->Add(Title);
+
+ testPingScrollView->SetTouchable(true);
+ testPingScrollView->SetDraggable(true);
+
+ g_ping_timer = osTimerNew((osTimerFunc_t)msgupdateTimerCallBack, osTimerPeriodic, NULL, NULL);
+
+ osStatus_t ret = osTimerStart(g_ping_timer, 1000);
+ if (ret != osOK && g_ping_timer != NULL) {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"StartCallTimer osTimerStart failed, ret = %lx!!", ret);
+ osTimerDelete(g_ping_timer);
+ g_ping_timer = NULL;
+ return false;
+ }
+
+ return true;
+ }
+
+ UIScrollView *testPingView::testPingInitIView(uint8_t id)
+ {
+ if (!testPingScrollViewcrollViewinit(id))
+ {
+ return nullptr;
+ }
+ return testPingScrollView;
+ }
+
+
+}
\ No newline at end of file
{GSENSON,"gsensonbutton","gsensor","gsensonbutton_next" ,&testView::ChangeGTESTView,true},\r
{BTTEST,"BTbutton","BT" ,"BTbutton_next",&testView::ChangeBTTESTView,true},\r
{SEChipTest,"SEChipTestbutton","SEChipTest","SEChipTestbutton_next" ,&testView::ChangeSEChipTESTView,true},\r
+ {PingTest,"PingTestbutton","PingTest","PingTestbutton_next" ,&testView::ChangePingTESTView,true},\r
{OLDTEST,"oldtestbutton","aging" ,"oldtestexit",&testView::ChangeoldTESTView,true},\r
{DEEPSLEEP,"deepsleep","DeepSleepCurrent","xxxxxxxxx" ,&testView::ChangeoldTESTView,true},\r
{shutdown,"shutdown","shutdown", "xxxxxxxxx",&testView::ChangeoldTESTView,true},\r
}\r
return true;\r
}\r
+\r
+ bool testView::ChangePingTESTView(int16_t thisView)\r
+ {\r
+ if (SystemScrollView[thisView] == nullptr)\r
+ {\r
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::ChangeSEChipTESTView");\r
+ test_Ping_view = new testPingView();\r
+ if (test_Ping_view == nullptr)\r
+ {\r
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView:: new scrollView[%d] fail", thisView);\r
+ return false;\r
+ }\r
+ SystemScrollView[thisView] = test_Ping_view->testPingInitIView(thisView);\r
+ RootView::GetInstance()->Add(SystemScrollView[thisView]);\r
+ }\r
+ return true;\r
+ }\r
+\r
#ifdef SUPPORT_A5133_SERVICE\r
bool testView::ChangeA5133TESTView(int16_t thisView)\r
{\r
test_SEChip_view = nullptr;\r
SystemScrollView[hideView]=nullptr;\r
break;\r
+ case PingTest:\r
+ RootView::GetInstance()->Remove(SystemScrollView[hideView]);\r
+ delete test_Ping_view; \r
+ test_Ping_view = nullptr;\r
+ SystemScrollView[hideView]=nullptr;\r
+ break; \r
#ifdef SUPPORT_A5133_SERVICE\r
case RF5133:\r
RootView::GetInstance()->Remove(SystemScrollView[hideView]);\r
osTimerStop(Gsenson_TEST_timer);
osTimerDelete(Gsenson_TEST_timer);
Gsenson_TEST_timer = NULL;
- return ;
+ //return ;
}
// if(button)
// {
* @Author: penglei 1624952103@qq.com\r
* @Date: 2024-06-17 14:31:08\r
* @LastEditors: penglei 1624952103@qq.com\r
- * @LastEditTime: 2024-09-12 20:31:12\r
+ * @LastEditTime: 2024-09-18 20:10:26\r
* @FilePath: /FD230/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c\r
* @Description: \r
* \r
sprintf(hostname,"www.%s.com",str);\r
PRINT("hostname : %s\n",hostname);\r
send_data = OsShellPing(1,hostname);\r
+ free(hostname);\r
free(str);\r
#endif\r
factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST,\r
u32_t lwip_ifconfig(int argc, const char **argv);
u32_t OsShellPing(int argc, const char *argv);
+void get_ping_hostname(char *databuf,uint8_t len);
+void get_ping_result(char *databuf,uint16_t len);
+
#ifndef LWIP_TESTBED
static
#endif
unsigned int print_len;
};
+static char result_data[256] = {0};
+static char hostname[20] = {0};
+
+void get_ping_hostname(char *databuf,uint8_t len)
+{
+ memcpy_s(databuf,len,hostname,strlen(hostname));
+}
+
+void get_ping_result(char *databuf,uint16_t len)
+{
+ if (databuf == NULL || len <= 0)
+ {
+ PRINTK("Invalid input for get_ping_result. len : %d\n",len);
+ return;
+ }
+ size_t resultLen = strlen(result_data);
+ if (resultLen >= len)
+ {
+ PRINTK("Insufficient buffer size for databuf.\n");
+ len = resultLen + 1;
+ }
+ memcpy(databuf, result_data, resultLen);
+ databuf[resultLen] = '\0';
+ // PRINTK("result_data : %s\n", result_data);
+ // PRINTK("databuf : %s\n", databuf);
+ // memset(result_data,0,sizeof(result_data));
+}
+
+static void get_log(char* str, int arrSize)
+{
+ if (str == NULL || arrSize <= 0) {
+ PRINTK("Invalid input for get_log.\n");
+ return;
+ }
+ if (arrSize >= sizeof(result_data)) {
+ PRINTK("Input size too large for result_data.\n");
+ arrSize = sizeof(result_data) - 1;
+ }
+ memcpy(result_data, str, arrSize);
+ result_data[arrSize] = '\0';
+ // PRINTK("result_data : %s\n", result_data);
+}
+
#ifndef LWIP_TESTBED
LWIP_STATIC
#endif
u32_t cnt = parg[1];
u32_t interval = parg[2];
u32_t data_len = parg[3];
-
+ char str[128] = {0};
iecho_len = sizeof(struct icmp_echo_hdr) + data_len;
sfd = lwip_socket(PF_INET, SOCK_RAW, IPPROTO_ICMP);
if (sfd < 0) {
PRINTK("Ping socket\n");
+ get_log("Ping socket",strlen("Ping socket\n"));
return -1;
}
pbuf_resp = pbuf_alloc(PBUF_RAW, IP_HLEN + sizeof(struct icmp_echo_hdr), PBUF_RAM);
if (pbuf_resp == NULL) {
PRINTK("Ping: pbuf_resp malloc failed\n");
+ get_log("Ping: pbuf_resp malloc failed\n",strlen("Ping: pbuf_resp malloc failed\n"));
ret = -1;
goto FAILURE;
}
iecho = (struct icmp_echo_hdr *)mem_malloc(iecho_len);
if (iecho == NULL) {
PRINTK("Ping: echo request malloc failed\n");
+ get_log("Ping: echo request malloc failed\n",strlen("Ping: echo request malloc failed\n"));
ret = -1;
goto FAILURE;
}
ret = sendto(sfd, iecho, iecho_len, 0, (struct sockaddr *)&to, (socklen_t)sizeof(to));
if (ret < 0) {
perror("Ping: sending ICMP echo request failed\n");
+ get_log("Ping: sending ICMP echo request failed\n",strlen("Ping: sending ICMP echo request failed\n"));
goto FAILURE;
}
ret = recv(sfd, pbuf_resp->payload, pbuf_resp->len, MSG_DONTWAIT);
if (ret < 0) {
perror("Ping: recv echo reply failed\n");
+ get_log("Ping: recv echo reply failed\n",strlen("Ping: recv echo reply failed\n"));
goto FAILURE;
}
if (pbuf_header(pbuf_resp, -ip_hlen)) {
/* this failure will never happen, but failure handle is written just to be in safe side */
PRINTK("Ping : memory management failure\n");
+ get_log("Ping : memory management failure",strlen("Ping : memory management failure"));
goto FAILURE;
}
iecho_resp = (struct icmp_echo_hdr *)pbuf_resp->payload;
if (pbuf_header(pbuf_resp, ip_hlen)) {
/* this failure will never happen, but failure handle is written just to be in safe side */
PRINTK("ping : memory management failure\n");
+ get_log("ping : memory management failure",strlen("ping : memory management failure"));
goto FAILURE;
}
failed_cnt++;
i++;
PRINTK("\nPing: destination unreachable ...");
+ get_log("Ping: destination unreachable ...",strlen("Ping: destination unreachable ..."));
continue;
}
/* capture the end time to calculate round trip time */
PRINTK("\n[%u]Reply from %s: ", i, inet_ntop(AF_INET, &to.sin_addr, buf, sizeof(buf)));
if (rtt > 0) {
PRINTK("time=%ims ", rtt);
+ memset(str,0,sizeof(str));
+ sprintf(str,"[%u]Reply from %s: time=%ims ",i, inet_ntop(AF_INET, &to.sin_addr, buf, sizeof(buf)),rtt);
+ get_log(str,strlen(str));
} else {
PRINTK("time<1ms ");
+ sprintf(str,"[%u]Reply from %s: time<1ms ",i, inet_ntop(AF_INET, &to.sin_addr, buf, sizeof(buf)));
+ get_log(str,strlen(str));
}
PRINTK("TTL=%u", iphdr_resp->_ttl);
break;
case ICMP_DUR:
PRINTK("\nPing: destination host unreachable ...");
+ get_log("Ping: destination host unreachable ...",strlen("Ping: destination host unreachable ..."));
break;
case ICMP_SQ:
PRINTK("\nPing: source quench ...");
+ get_log("Ping: source quench ...",strlen("Ping: source quench ..."));
break;
case ICMP_RD:
PRINTK("\nPing: redirect ...");
+ get_log("Ping: redirect ...",strlen("Ping: redirect ..."));
break;
case ICMP_TE:
PRINTK("\nPing: time exceeded ...");
+ get_log("Ping: time exceeded ...",strlen("Ping: time exceeded ..."));
break;
case ICMP_PP:
PRINTK("\nPing: parameter problem ...");
+ get_log("Ping: parameter problem ...",strlen("Ping: parameter problem ..."));
break;
default:
PRINTK("\nPing: unknown error ...");
+ get_log("Ping: unknown error ...",strlen("Ping: unknown error ..."));
break;
}
i++;
}
}
-
+
PRINTK("\n--- %s ping statistics ---\n", inet_ntop(AF_INET, &to.sin_addr, buf, sizeof(buf)));
+ memset(str,0,sizeof(str));
+ sprintf(str,"%s ping statistics ---\n",inet_ntop(AF_INET, &to.sin_addr, buf, sizeof(buf)));
+ get_log(str,strlen(str));
PRINTK("%u packets transmitted, %u received, %u loss\n", i, succ_cnt, failed_cnt);
-
+ memset(str,0,sizeof(str));
+ sprintf(str,"%u packets transmitted, %u received, %u loss\n", i, succ_cnt, failed_cnt);
+ get_log(str,strlen(str));
FAILURE:
ping_kill = 0;
(void)lwip_close(sfd);
}
// printf("%s %d\n",__func__,__LINE__);
printf("%s %d name %s\n",__func__,__LINE__,argv);
-
+ memset(hostname,0,sizeof(hostname));
+ memcpy_s(hostname,20,argv,strlen(argv));
#if LWIP_DNS
dst_ipaddr.addr = get_hostip(argv);
printf("%s %d dst_ip 0x%X\n",__func__,__LINE__,dst_ipaddr.addr);
if (dst_ipaddr.addr == IPADDR_NONE || dst_ipaddr.addr == IPADDR_ANY) {
PRINTK("Invalid dest ipaddr: NONE or ANY\n");
+ get_log("Invalid dest ipaddr: NONE or ANY",strlen("Invalid dest ipaddr: NONE or ANY"));
return LOS_NOK;
}