求助!! esp8266如何在softap模式下获取广播地址

gaolei17
Posts: 1
Joined: Thu May 10, 2018 4:52 pm

求助!! esp8266如何在softap模式下获取广播地址

Postby gaolei17 » Thu May 10, 2018 5:35 pm

在RTOS_SDK_API文档中没有找到对应的API函数。
是否只能通过指定IP地址和子网掩码的方式来变相的指定广播地址?但是这种方式通用性极差。

Code: Select all

    struct ip_info info;
    IP4_ADDR(&info.ip, 192, 168, 5, 1); // set IP
    IP4_ADDR(&info.gw, 192, 168, 5, 1); // set gateway
    IP4_ADDR(&info.netmask, 255, 255, 255, 0); // set netmask
    wifi_set_ip_info(SOFTAP_IF, &info);
    struct dhcps_lease dhcp_lease;
    IP4_ADDR(&dhcp_lease.start_ip, 192, 168, 5, 100);
    IP4_ADDR(&dhcp_lease.end_ip, 192, 168, 5, 105);
    wifi_softap_set_dhcps_lease(&dhcp_lease);
    wifi_softap_dhcps_start(); // enable soft-AP DHCP server
   
    IP4_ADDR(&broadcast, 192, 168, 5, 255); //指定广播地址

Who is online

Users browsing this forum: No registered users and 13 guests