1 /*
2  * Copyright (C) 2015-2021 Alibaba Group Holding Limited
3  */
4 
5 #include "netmgr.h"
6 #if AOS_COMP_CLI
7 #include "aos/cli.h"
8 #endif
9 #include <uservice/uservice.h>
10 #include <uservice/eventid.h>
11 
wifi_event_cb(uint32_t event_id,const void * param,void * context)12 static void wifi_event_cb(uint32_t event_id, const void *param, void *context)
13 {
14     printf("wifi event cb\r\n");
15 
16     printf("Got IP\r\n");
17 }
18 
netmgr_comp_example(int argc,char ** argv)19 static void netmgr_comp_example(int argc, char **argv)
20 {
21     printf("netmgr test \r\n");
22 
23     event_service_init(NULL);
24 
25     netmgr_service_init(NULL);
26 
27     event_subscribe(EVENT_NETMGR_DHCP_SUCCESS, wifi_event_cb, NULL);
28 }
29 
30 #if AOS_COMP_CLI
31 /* reg args: fun, cmd, description*/
32 ALIOS_CLI_CMD_REGISTER(netmgr_comp_example, netmgr_example, netmgr component base example)
33 #endif
34