这里会显示出您选择的修订版和当前版本之间的差别。
后一修订版 | 前一修订版 | ||
reference:library:ethernetmaintain [2017/04/07 10:03] – 外部编辑 127.0.0.1 | reference:library:ethernetmaintain [2023/06/07 04:24] (当前版本) – 外部编辑 127.0.0.1 | ||
---|---|---|---|
行 1: | 行 1: | ||
+ | [[reference: | ||
+ | ====== Ethernet.maintain() ====== | ||
+ | |||
+ | ===== 描述 ===== | ||
+ | |||
+ | Allows for the renewal of DHCP leases. When assigned an IP address via DHCP, ethernet devices are given a lease on the address for an amount of time. With Ethernet.maintain(), | ||
+ | |||
+ | You can call this function as often as you want, it will only re-request a DHCP lease when needed (returning 0 in all other cases). The easiest way is to just call it on every loop() invocation, but less often is also fine. Not calling this function (or calling it significantly less then once per second) will prevent the lease to be renewed when the DHCP protocol requires this, continuing to use the expired lease instead (which will not directly break connectivity, | ||
+ | |||
+ | |||
+ | Ethernet.maintain() 被添加到 Arduino 1.0.1版IDE中. | ||
+ | ===== 语法 ===== | ||
+ | <code cpp> | ||
+ | Ethernet.maintain(); | ||
+ | </ | ||
+ | ===== 参数 ===== | ||
+ | |||
+ | 无 | ||
+ | ===== 返回值 ===== | ||
+ | |||
+ | < | ||
+ | 字节: | ||
+ | 0: nothing happened | ||
+ | 1: renew failed | ||
+ | 2: renew success | ||
+ | 3: rebind fail | ||
+ | 4: rebind success | ||
+ | </ | ||
+ | [[zh: | ||