說明
設置以太網控製器在放棄前將進行的傳輸嘗試次數。初始值為 8。8 次傳輸嘗試乘以 200 毫秒默認超時等於通信失敗期間 1600 毫秒的阻塞延遲。您可能更願意設置一個較小的數字,以使您的程序在通信出現問題時更具響應性。盡管名稱如此,但這會設置傳輸嘗試的總數(而不是第一次嘗試失敗後的重試次數),因此您想要設置的最小值是 1。
用法
Ethernet.setRetransmissionCount(number)
參數
- number:以太網控製器在放棄之前應該進行的傳輸嘗試次數(字節)
返回
無
示例
#include <SPI.h>
#include <Ethernet.h>
byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
IPAddress ip(10, 0, 0, 177);
void setup() {
Ethernet.begin(mac, ip);
Ethernet.setRetransmissionCount(1); // configure the Ethernet controller to only attempt one transmission before giving up
}
void loop () {}
相關用法
- Arduino Ethernet - Ethernet.setRetransmissionTimeout()用法及代碼示例
- Arduino Ethernet - Ethernet.setDnsServerIP()用法及代碼示例
- Arduino Ethernet - Ethernet.setMACAddress()用法及代碼示例
- Arduino Ethernet - Ethernet.setSubnetMask()用法及代碼示例
- Arduino Ethernet - Ethernet.setLocalIP()用法及代碼示例
- Arduino Ethernet - Ethernet.setGatewayIP()用法及代碼示例
- Arduino Ethernet - Ethernet.subnetMask()用法及代碼示例
- Arduino Ethernet - Ethernet.MACAddress()用法及代碼示例
- Arduino Ethernet - Ethernet.hardwareStatus()用法及代碼示例
- Arduino Ethernet - Ethernet.localIP()用法及代碼示例
- Arduino Ethernet - Ethernet.init()用法及代碼示例
- Arduino Ethernet - Ethernet.dnsServerIP()用法及代碼示例
- Arduino Ethernet - Ethernet.gatewayIP()用法及代碼示例
- Arduino Ethernet - Ethernet.linkStatus()用法及代碼示例
- Arduino Ethernet - Ethernet.begin()用法及代碼示例
- Arduino Ethernet - EthernetUDP.parsePacket()用法及代碼示例
- Arduino Ethernet - EthernetUDP.beginPacket()用法及代碼示例
- Arduino Ethernet - EthernetUDP.available()用法及代碼示例
- Arduino Ethernet - EthernetUDP.read()用法及代碼示例
- Arduino Ethernet - EthernetUDP.endPacket()用法及代碼示例
- Arduino Ethernet - EthernetUDP.begin()用法及代碼示例
- Arduino Ethernet - EthernetServer()用法及代碼示例
- Arduino Ethernet - EthernetClient()用法及代碼示例
- Arduino Ethernet - EthernetUDP.write()用法及代碼示例
- Arduino Ethernet - server.begin()用法及代碼示例
注:本文由純淨天空篩選整理自arduino.cc大神的英文原創作品 Ethernet - Ethernet.setRetransmissionCount()。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。