Kaynağa Gözat

docs: use ETH_HWADDR_LEN, not sizeof(netif->hwaddr)

Simon Goldschmidt 7 yıl önce
ebeveyn
işleme
ab922582dc
1 değiştirilmiş dosya ile 2 ekleme ve 2 silme
  1. 2 2
      doc/NO_SYS_SampleCode.c

+ 2 - 2
doc/NO_SYS_SampleCode.c

@@ -56,8 +56,8 @@ netif_init(struct netif *netif)
   netif->flags      = NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP | NETIF_FLAG_ETHERNET | NETIF_FLAG_IGMP | NETIF_FLAG_MLD6;
   MIB2_INIT_NETIF(netif, snmp_ifType_ethernet_csmacd, 100000000);
 
-  SMEMCPY(netif->hwaddr, your_mac_address_goes_here, sizeof(netif->hwaddr));
-  netif->hwaddr_len = sizeof(netif->hwaddr);
+  SMEMCPY(netif->hwaddr, your_mac_address_goes_here, ETH_HWADDR_LEN);
+  netif->hwaddr_len = ETH_HWADDR_LEN;
 
   return ERR_OK;
 }