Skip to main content

EoE (Ethernet over EtherCAT)

EoE tunnels Ethernet frames through the EtherCAT mailbox. It can send and receive frames, run ICMP Ping and filter by MAC address, and it conforms to ETG.1000.6 and ETG.1020. It is a frame channel inside the mailbox, not an operating-system network adapter: it provides no DHCP, NAT or automatic fragmentation by MTU, and a single frame is limited to 2016 bytes.

Accessed through slave.eoe(). The sub-object is created lazily and always returns an instance (never null); check whether the slave supports EoE with slave.eoe().isSupported(), and treat an unknown capability as unsupported.​

Honest boundaries​

EoE in this SDK is an Ethernet frame tunnel over the EtherCAT mailbox; it is not an operating-system network adapter.

  • No TAP / tun: it creates no Windows TAP or Linux tun/tap device
  • No DHCP server / NAT: it assigns no addresses and performs no routing or NAT
  • No automatic fragmentation at MTU 1500: frames are split into 32-byte blocks according to the slave mailbox capacity (ETG.1000.6 §5.7); the whole-frame limit is the ETG.1000.6 §5.7 Frame Offset (6 bit × 32 B) = 2016 bytes. Frames larger than 2016 bytes are rejected outright
  • Receive buffer: receiveFrame returns the frame at its actual received length; the maximum is likewise bounded by 2016 bytes, not an arbitrary size

Method overview​

CategoryMethodTypeRead/writeDescription
CapabilityisSupported()booleanread-onlyWhether the slave supports EoE; treat an unknown capability as unsupported
CapabilitysupportState()Booleanread-onlyCapability tri-state: TRUE=supported, FALSE=confirmed unsupported, null=unknown
CapabilityisSupportKnown()booleanread-onlyWhether the capability conclusion is known (supportState() is not null)
Network configurationIP() / IP(String)Stringread/writeIP address (dotted decimal); a failed read returns null, a failed write throws
Network configurationsubnet() / subnet(String)Stringread/writeSubnet mask; a failed read returns null, a failed write throws
Network configurationgateway() / gateway(String)Stringread/writeDefault gateway; a failed read returns null, a failed write throws
Network configurationMAC() / MAC(String)Stringread/writeMAC address (format "AA:BB:CC:DD:EE:FF"); a failed read returns null, a failed write throws
Network configurationDNS() / DNS(String)Stringread/writeDNS server address; a failed read returns null, a failed write throws
Frame send/receivesendFrame(byte[] frame, int timeoutMs)booleanwrite-onlySends one Ethernet frame; rejected as soon as the single-frame limit is exceeded
Frame send/receivesendFrameWithTimestamp(byte[] frame, long timestamp, int timeoutMs)booleanwrite-onlySends a frame and appends a 4-byte timestamp at the end of the frame
Frame send/receivereceiveFrame(int timeoutMs)byte[]read-onlyReceives one frame; returns null on timeout or an empty frame
Frame send/receivesendFrameAsync / receiveFrameAsyncCompletableFutureread/writeAsynchronous wrappers for the send/receive methods above; a failure completes with EoEProtocolException
Connectivityping(String targetIp, int timeoutMs, int ttl)EoEPingResultread-onlySends an ICMP Echo to an IP device behind the slave and waits for the reply
ConnectivitypingAsync(String targetIp, int timeoutMs, int ttl)CompletableFutureread-onlyAsynchronous Ping that does not block the calling thread
Address filteringaddAddressFilter(byte[] mac, int timeoutMs)booleanwrite-onlyAppends one MAC address to the filter (must be 6 bytes, at most 16 entries)
Address filteringremoveAddressFilter(byte[] mac, int timeoutMs)booleanwrite-onlyRemoves one MAC address from the filter
Address filteringgetAddressFilters(int timeoutMs)List<byte[]>read-onlyReads the MAC address list from the current filter; an empty list is a valid state
Address filteringclearAddressFilters(int timeoutMs)booleanwrite-onlyClears all address filters
Frame hooksetReceiveHook(ReceiveHookListener) / clearReceiveHook()booleanwrite-onlyRegisters a frame-arrival callback; pass null to cancel
Protocol identificationgetProtocolType() / getProtocolName()byte / Stringread-onlyProtocol type constant (EoE=0x02) and protocol name ("EoE")
Transaction statusgetLastStatus() / getLastErrorCode()MailboxStatus / longread-onlyUnified status and error code of the most recent mailbox transaction (0=no error)
StatisticsgetStatistics() / resetStatistics()MailboxStatistics / voidread-only / write-onlyMailbox statistics snapshot and counter reset

Interface details​

Constants​

ConstantTypeValueDescription
DEFAULT_TIMEOUT_MSint500Default timeout (milliseconds) used by every overload that omits timeoutMs
ETG_EOE_MAX_COMPLETE_FRAME_BYTESint2016Single-frame limit (ETG.1000.6 §5.7: Frame Offset 6 bit × 32 bytes)

isSupported() / supportState() / isSupportKnown()​

public boolean isSupported()
public Boolean supportState()
public boolean isSupportKnown()

EoE capability detection for the slave: only a confirmed capability is treated as supported; an unknown capability is not treated as supported (the SDK does not overstate the capability).

Returns:

  • isSupported() — boolean: returns true when support is confirmed; both "confirmed unsupported" and "unknown" return false, and the two cannot be distinguished as a boolean
  • supportState() — Boolean: Boolean.TRUE = supported, Boolean.FALSE = confirmed unsupported, null = capability unknown
  • isSupportKnown() — boolean: returns true when the capability conclusion is known and false when it is unknown (unknown is not the same as unsupported)

Example:

EoE eoe = slave.eoe();
if (!eoe.isSupported()) {
System.out.println("从站不支持 EoE,或能力未知"); // Slave does not support EoE, or its capability is unknown
return;
}

IP() / IP(String ip)​

public String IP()
public void IP(String ip)

Reads and writes the IP address (dotted decimal) of the slave virtual network port. The getter reads the current value in real time on every call; the setter validates the format and writes to the device straight away.

Parameters:

  • ip (String) — dotted-decimal IPv4 address, for example "192.168.1.100"

Returns:

  • String — the current IP address; a failed read returns null (a read is never faked with 0.0.0.0)

Throws:

  • IllegalArgumentException — the address is empty, is not dotted decimal with 4 segments, or one segment is not a decimal number
  • EoEProtocolException — reading back the current configuration before the write fails (the write is aborted and nothing is sent out), or the write is not confirmed by the slave
Triple-field write

IP, subnet mask and gateway are sent together in a single configuration write. When a single field is written, the other two keep their read-back values; if the read-back fails the write is aborted, which prevents the other two from being written as 0.0.0.0 and dropping the device off the network.

Example:

EoE eoe = slave.eoe();
System.out.println("当前 IP: " + eoe.IP()); // Current IP:
eoe.IP("10.0.0.100");

subnet() / subnet(String subnet)​

public String subnet()
public void subnet(String subnet)

Reads and writes the subnet mask (dotted decimal). The write also uses the triple-field write: IP and gateway keep their read-back values.

Parameters:

  • subnet (String) — dotted-decimal subnet mask, for example "255.255.255.0"

Returns:

  • String — the current subnet mask; a failed read returns null

Throws:

  • IllegalArgumentException — the mask format is invalid (same criteria as IP)
  • EoEProtocolException — the read-back fails (the write is aborted) or the write is not confirmed by the slave

gateway() / gateway(String gateway)​

public String gateway()
public void gateway(String gateway)

Reads and writes the default gateway (dotted decimal). The write also uses the triple-field write: IP and subnet mask keep their read-back values.

Parameters:

  • gateway (String) — dotted-decimal gateway, for example "192.168.1.1"

Returns:

  • String — the current gateway; a failed read returns null

Throws:

  • IllegalArgumentException — the gateway format is invalid (same criteria as IP)
  • EoEProtocolException — the read-back fails (the write is aborted) or the write is not confirmed by the slave

MAC() / MAC(String macString)​

public String MAC()
public void MAC(String macString)

Reads and writes the MAC address.

Parameters:

  • macString (String) — format AA:BB:CC:DD:EE:FF (both : and - are accepted as separators)

Returns:

  • String — the current MAC address (uppercase hexadecimal, : separated); a failed read returns null

Throws:

  • IllegalArgumentException — after the separators are removed it is not 12 hexadecimal characters
  • EoEProtocolException — the write is not confirmed by the slave

DNS() / DNS(String dns)​

public String DNS()
public void DNS(String dns)

Reads and writes the DNS server address (IPv4).

Parameters:

  • dns (String) — dotted-decimal IPv4 address, for example "8.8.8.8"

Returns:

  • String — the current DNS address (dotted decimal); a failed read returns null

Throws:

  • IllegalArgumentException — the address format is invalid (same criteria as IP)
  • EoEProtocolException — the write is not confirmed by the slave

Frame send and receive

sendFrame(byte[] frame, int timeoutMs)​

public boolean sendFrame(byte[] frame, int timeoutMs)
public boolean sendFrame(byte[] frame)

Sends one Ethernet frame (including the Ethernet header). Fragmentation follows ETG.1000.6 §5.7: the whole frame may be larger than the slave mailbox, and it is rejected only when it exceeds the Frame Offset limit (2016 bytes). There is no TAP / DHCP / NAT and no automatic fragmentation at MTU 1500.

Parameters:

  • frame (byte[]) — frame data; null or an empty array is treated as an invalid argument and does not count as a successful send
  • timeoutMs (int) — timeout (milliseconds, default 500, that is DEFAULT_TIMEOUT_MS)

Returns:

  • boolean — true on success; an empty frame, more than 2016 bytes, or an unfinished underlying transaction returns false

Throws:

  • An exception from the underlying call is propagated as a RuntimeException and never swallowed into false

Use getLastStatus() / getLastErrorCode() to tell the failure causes apart: an empty frame or an over-limit frame records INVALID_ARG, and a transaction that does not finish within the timeout records TIMEOUT.

sendFrameWithTimestamp(byte[] frame, long timestamp, int timeoutMs)​

public boolean sendFrameWithTimestamp(byte[] frame, long timestamp, int timeoutMs)
public boolean sendFrameWithTimestamp(byte[] frame, long timestamp)

Sends an Ethernet frame with an appended timestamp (ETG.1000.6 Table 78): a 4-byte timestamp is appended at the end of the frame, taken from the low 32 bits of timestamp (Unsigned32).

Parameters:

  • frame (byte[]) — frame data
  • timestamp (long) — DC timestamp (nanoseconds)
  • timeoutMs (int) — timeout (milliseconds, default 500)

Returns:

  • boolean — true on success

Throws:

  • Unlike sendFrame, this method folds underlying exceptions into false and records a failure status instead of throwing. An empty frame or more than 2016 bytes likewise returns false (recorded as INVALID_ARG)

receiveFrame(int timeoutMs)​

public byte[] receiveFrame(int timeoutMs)
public byte[] receiveFrame()

Receives an Ethernet frame. The frame is returned at its actual received length, and the maximum is likewise bounded by 2016 bytes, not an arbitrary size.

Parameters:

  • timeoutMs (int) — timeout (milliseconds, default 500)

Returns:

  • byte[] — the received frame data; null = timeout / transaction failure, or an empty frame was received

Throws:

  • An exception from the underlying call is propagated as a RuntimeException and never swallowed into null

Use getLastStatus() to tell "nothing received" from "an empty frame received": a timeout failure records TIMEOUT, while a successful transaction with an empty frame records SUCCESS.

Example:

EoE eoe = slave.eoe();

boolean sent = eoe.sendFrame(frameData);
byte[] received = eoe.receiveFrame();
if (received != null)
System.out.println("收到 " + received.length + " 字节"); // Received {received.length} bytes

Address filters (ETG.1020)

The filter matches Ethernet frames behind the slave by MAC address. Adding and removing use read-modify-write: read the current filter table first, then write the whole modified table back. If the read-back fails the operation is aborted, and an existing filter table on the slave is never overwritten with an empty one.

addAddressFilter(byte[] mac, int timeoutMs)​

public boolean addAddressFilter(byte[] mac, int timeoutMs)

Adds a single MAC address to the filter list. The existing filter is read first, the new address is appended, and the filter is set again.

Parameters:

  • mac (byte[]) — MAC address (6 bytes)
  • timeoutMs (int) — timeout (milliseconds, default 500)

Returns:

  • boolean — true on success

Throws:

  • IllegalArgumentException — mac is null or not 6 bytes
  • EoEProtocolException — reading back the existing filter fails (aborted, nothing is written out), or the total would exceed 16 entries after adding (aborted, the slave filter table is left untouched)

removeAddressFilter(byte[] mac, int timeoutMs)​

public boolean removeAddressFilter(byte[] mac, int timeoutMs)

Removes the given MAC address from the filter list (the whole entry is compared byte by byte). If the list is empty after removal, this is equivalent to clearing the filter.

Parameters:

  • mac (byte[]) — MAC address (6 bytes)
  • timeoutMs (int) — timeout (milliseconds, default 500)

Returns:

  • boolean — true on success

Throws:

  • IllegalArgumentException — mac is null or not 6 bytes
  • EoEProtocolException — reading back the existing filter fails (aborted, nothing is written out)

getAddressFilters(int timeoutMs)​

public List<byte[]> getAddressFilters(int timeoutMs)
public List<byte[]> getAddressFilters()

Gets the current MAC address filter list.

Parameters:

  • timeoutMs (int) — timeout (milliseconds, optional, default 500)

Returns:

  • List<byte[]> — MAC address list (6 bytes each). An empty list is a valid state: it means the slave really has no filter entries configured, not that the read failed

Throws:

  • EoEProtocolException — the read fails, or the count reported by the slave exceeds 16 (a count mismatch is treated as a failure and is not truncated into a list that "looks normal")

clearAddressFilters(int timeoutMs)​

public boolean clearAddressFilters(int timeoutMs)
public boolean clearAddressFilters()

Clears all address filters.

Parameters:

  • timeoutMs (int) — timeout (milliseconds, default 500)

Returns:

  • boolean — true on success

Example:

EoE eoe = slave.eoe();

byte[] mac = { (byte) 0xAA, (byte) 0xBB, (byte) 0xCC,
(byte) 0xDD, (byte) 0xEE, (byte) 0xFF };
eoe.addAddressFilter(mac, 500);

List<byte[]> filters = eoe.getAddressFilters();
for (byte[] f : filters) {
System.out.printf("过滤器: %02X:%02X:%02X:%02X:%02X:%02X%n", // Filter: %02X:%02X:%02X:%02X:%02X:%02X%n
f[0] & 0xFF, f[1] & 0xFF, f[2] & 0xFF,
f[3] & 0xFF, f[4] & 0xFF, f[5] & 0xFF);
}

eoe.clearAddressFilters();

ICMP Ping

Sends an ICMP Echo Request through the EoE mailbox tunnel to an IP device behind the slave to verify network-layer connectivity. A failure does not throw; the conclusion is carried in the return value.

ping(String targetIp, int timeoutMs, int ttl)​

public EoEPingResult ping(String targetIp, int timeoutMs, int ttl)
public EoEPingResult ping(String targetIp)

Sends an ICMP Echo and waits for the response (synchronous, blocking).

Parameters:

  • targetIp (String) — target IP (dotted decimal, for example "192.168.1.10")
  • timeoutMs (int) — timeout (milliseconds, default 5000)
  • ttl (int) — IP TTL (default 64)

Returns:

  • EoEPingResult — Ping result (see "EoEPingResult"). Success is false when the target is unreachable, the request cannot be sent, or no reply arrives before the timeout; the reason is recorded in ErrorMessage. This method does not throw

pingAsync(String targetIp, int timeoutMs, int ttl)​

public CompletableFuture<EoEPingResult> pingAsync(String targetIp, int timeoutMs, int ttl)
public CompletableFuture<EoEPingResult> pingAsync(String targetIp)

Asynchronous Ping. It returns a CompletableFuture without blocking the calling thread and runs on the SDK common thread pool by default. The parameters and return value are the same as ping.

EoEPingResult​

public static class EoEPingResult {
public boolean Success;
public double RoundTripTimeMs;
public String TargetAddress;
public byte TTL;
public String ErrorMessage;
}
FieldTypeMeaning
SuccessbooleanWhether a reply was received
RoundTripTimeMsdoubleRound-trip time (milliseconds); meaningful only when Success is true
TargetAddressStringTarget IP (identical to the argument)
TTLbyteIP TTL used for this request
ErrorMessageStringFailure description; states the reason when Success is false

Example:

EoE eoe = slave.eoe();

// Synchronous Ping
EoEPingResult r = eoe.ping("192.168.1.10");
if (r.Success) {
System.out.printf("Ping 成功: RTT=%.2fms TTL=%d%n", r.RoundTripTimeMs, r.TTL & 0xFF); // Ping succeeded: RTT=%.2fms TTL=%d%n
} else {
System.out.println("Ping 失败: " + r.ErrorMessage); // Ping failed:
}

// Asynchronous Ping
eoe.pingAsync("192.168.1.10").thenAccept(result -> {
System.out.println(result);
});

Asynchronous receive hook

The EoE receive hook turns "poll receiveFrame" into an event-driven model: when a slave pushes a frame the SDK invokes the listener, so the upper layer does not need a while-poll loop. Only one global hook is allowed per master (the last registrant overwrites the previous one).

setReceiveHook(ReceiveHookListener listener) / clearReceiveHook()​

public boolean setReceiveHook(ReceiveHookListener listener)
public boolean clearReceiveHook()

public interface ReceiveHookListener {
void onFrame(short slaveIndex, byte[] frameData);
}

Registers the receive hook; passing null is equivalent to clearReceiveHook(). clearReceiveHook() stops the asynchronous push.

Parameters:

  • listener (ReceiveHookListener) — frame-arrival callback that receives slaveIndex (1-based) and the frame bytes; pass null to cancel

Returns:

  • boolean — returns true when the underlying layer supports it and the registration (or clearing) succeeds; returns false when unsupported or failed

Example:

EoE eoe = slave.eoe();
eoe.setReceiveHook((slvIdx, data) -> {
System.out.printf("Slave %d 推帧, %d 字节%n", slvIdx, data.length); // Slave %d pushed frame, %d bytes%n
// Recommended: enqueue and let a business thread process it; do not do heavy work on this thread (SDK receive thread context)
});

// Close it when done
eoe.clearReceiveHook();
Callback context

The hook is invoked on the SDK receive thread. Do not call time-consuming APIs that block the main flow from inside this thread, such as slave.setState(...) (returns boolean, true=switch succeeded) / master.start(). Enqueue into a BlockingQueue and let a business thread consume it. An exception thrown inside the callback does not interrupt frame reception, but log it yourself.

Asynchronous send and receive (CompletableFuture)

sendFrameAsync(byte[] frame, int timeoutMs) / receiveFrameAsync(int timeoutMs)​

public CompletableFuture<Boolean> sendFrameAsync(byte[] frame, int timeoutMs)
public CompletableFuture<Boolean> sendFrameAsync(byte[] frame)
public CompletableFuture<byte[]> receiveFrameAsync(int timeoutMs)
public CompletableFuture<byte[]> receiveFrameAsync()

Wraps the synchronous sendFrame / receiveFrame in a CompletableFuture so they can be combined with existing Java asynchronous chains (thenApply / whenComplete and so on). The SDK common thread pool is used by default; a subclass can override defaultExecutor() to use a custom thread pool.

Parameters: the same as the synchronous version (frame / timeoutMs, timeout default 500 milliseconds).

Returns:

  • sendFrameAsync — CompletableFuture<Boolean>, whose value is true on success
  • receiveFrameAsync — CompletableFuture<byte[]>, whose value is the received frame on success

Throws:

  • Both methods turn a failure into a completion with EoEProtocolException (the ex received in whenComplete / handle): sendFrameAsync fails when the underlying call returns false, and receiveFrameAsync fails on a timeout or when no frame is received. Note that, unlike the synchronous receiveFrame which returns null, the asynchronous version never returns null

Example:

eoe.sendFrameAsync(frame, 500)
.thenCompose(ok -> eoe.receiveFrameAsync(1000))
.whenComplete((reply, ex) -> {
if (ex != null) ex.printStackTrace();
else System.out.println("收 " + reply.length + " 字节"); // Received {reply.length} bytes
});

Common mailbox protocol interface

EoE shares the same mailbox protocol interface with CoE / FoE / SoE / AoE / VoE / FSoE, so the upper layer can query capabilities, the most recent transaction status and statistics in a consistent way.

getProtocolType() / getProtocolName()​

public byte getProtocolType()
public String getProtocolName()

Returns:

  • getProtocolType() — byte: protocol type constant (EoE=0x02)
  • getProtocolName() — String: protocol name ("EoE")

getLastStatus() / getLastErrorCode()​

public MailboxStatus getLastStatus()
public long getLastErrorCode()

Reads the status and error code of the most recent mailbox transaction (frame send/receive, network address read/write, address filter read/write, hook registration); both success and failure update them.

Returns:

  • getLastStatus() — MailboxStatus: transaction status; PENDING when no transaction has been started yet
  • getLastErrorCode() — long: protocol-layer error code; 0 means no error

getStatistics() / resetStatistics()​

public MailboxStatistics getStatistics()
public void resetStatistics()

Reads or resets the mailbox statistics of this protocol. resetStatistics() also resets getLastStatus() to PENDING and getLastErrorCode() to 0.

Returns:

  • getStatistics() — MailboxStatistics: statistics snapshot of the current session (immutable)

MailboxStatus / MailboxStatistics​

MailboxStatusMeaning
PENDINGPending (the transaction has not been started or is still in progress)
SUCCESSCompleted successfully
TIMEOUTNo response before the timeout
CANCELLEDTransaction cancelled
MAILBOX_ERRORMailbox error frame
PROTO_MISMATCHResponse protocol type mismatch
WKC_FAILWorking counter did not match the expectation
NO_MEMORYOut of memory
INVALID_ARGInvalid argument (for example an empty frame or an over-limit frame)
NOT_IMPLEMENTEDNot supported (for example the underlying layer does not provide the capability)
LINK_DOWNLink down (frames fail immediately instead of timing out one by one); check the cable / NIC link status
NOT_SENTRequest never left the local host (frame never reached the wire: aborted / backoff / pool exhausted / channel closed / held by the kernel); not a slave timeout and not a slave rejection — carries no bus evidence, must not be used for slave-drop or health verdicts; callers treat it as retryable
MailboxStatistics fieldTypeMeaning
totalSentlongTotal transactions sent
totalReceivedlongTotal responses received (including error frames)
totalTimeoutlongTotal timeouts
totalMailboxErrorlongTotal mailbox error frames
totalProtocolErrorlongTotal protocol errors (protocol type / working counter mismatch)
totalCancelledlongTotal cancelled transactions
lastErrorCodelongMost recent error code (0 means none)
lastErrorTimeInstantTime of the most recent error (null when there is no error)
averageLatencyUsdoubleAverage transaction latency (microseconds)

EoEProtocolException​

public static class EoEProtocolException extends RuntimeException

Unified exception for EoE protocol-layer failures (a runtime exception, so it need not be declared). It occurs when a network address write is rejected or its read-back fails, when an address filter read/write fails or exceeds the limit, and when an asynchronous send/receive fails.

Full example​

Network configuration​

EoE eoe = slave.eoe();

// Read the current configuration
System.out.println("当前 IP: " + eoe.IP()); // Current IP:
System.out.println("当前 MAC: " + eoe.MAC()); // Current MAC:

// Set a new configuration
eoe.IP("10.0.0.100");
eoe.subnet("255.255.255.0");
eoe.gateway("10.0.0.1");
eoe.DNS("10.0.0.1");

Frame send and receive​

EoE eoe = slave.eoe();

// Send a frame
boolean sent = eoe.sendFrame(frameData);

// Send a frame with a timestamp
eoe.sendFrameWithTimestamp(frameData, System.nanoTime());

// Receive a frame
byte[] received = eoe.receiveFrame(1000);
if (received != null)
System.out.println("收到 " + received.length + " 字节"); // Received {received.length} bytes

Address filtering and receive hook​

EoE eoe = slave.eoe();

byte[] mac = { (byte) 0xAA, (byte) 0xBB, (byte) 0xCC,
(byte) 0xDD, (byte) 0xEE, (byte) 0xFF };
try {
eoe.addAddressFilter(mac, 500);

List<byte[]> filters = eoe.getAddressFilters();
for (byte[] f : filters) {
System.out.printf("过滤器: %02X:%02X:%02X:%02X:%02X:%02X%n", // Filter: %02X:%02X:%02X:%02X:%02X:%02X%n
f[0] & 0xFF, f[1] & 0xFF, f[2] & 0xFF,
f[3] & 0xFF, f[4] & 0xFF, f[5] & 0xFF);
}
} catch (EoE.EoEProtocolException ex) {
// Read/write failed: do not overwrite the slave filter table with an empty one
System.out.println("地址过滤器操作失败: " + ex.getMessage()); // Address filter operation failed:
}

eoe.setReceiveHook((slvIdx, data) -> System.out.println("推帧 " + data.length + " 字节")); // Pushed frame {data.length} bytes
// ... run ...
eoe.clearReceiveHook();

Failures and handling​

SymptomCauseHandling
sendFrame returns falseThe link is not established, the frame is longer than 2016 bytes, or the transaction does not finish within the timeoutConfirm the slave has reached a communicable state and shorten the frame; use getLastStatus() to tell an invalid argument from a timeout
receiveFrame returns nullNo frame arrived before the timeout, or an empty frame was receivedIncrease timeoutMs, or first confirm the peer is already sending frames; getLastStatus() of SUCCESS means an empty frame was received
sendFrameWithTimestamp returns falseEmpty frame, over the single-frame limit, or the send failedSame as sendFrame; this method does not throw, and every failure is folded into false
ping returns Success=falseThe target is unreachable, the slave has no IP configured, or no reply arrived before the timeoutCheck ErrorMessage together with the slave IP and gateway configuration
getAddressFilters returns an empty listThe slave really has no MAC filter entries configured (an empty table is a valid state, not a failed read)When filtering is needed, call addAddressFilter first to add the target address
getAddressFilters / addAddressFilter / removeAddressFilter throws EoEProtocolExceptionReading the existing filter fails, or the count exceeds the limit of 16Treat it as a failure and do not overwrite the slave filter table with an empty one; confirm slave communication and retry
IP / subnet / gateway / MAC / DNS write throws EoEProtocolExceptionThe write is not confirmed by the slave, or the read-back before the write fails (the write is aborted)Do not repeat the write when the read-back fails; restore slave communication first, and the device still keeps its original configuration
IP / subnet / gateway / MAC / DNS write throws IllegalArgumentExceptionThe address or MAC format is invalidFix the string passed by the caller as an invalid-argument problem
sendFrameAsync / receiveFrameAsync completes exceptionallyThe same-named synchronous method returned a failureHandle EoEProtocolException in whenComplete / handle; do not treat it as a null return
setReceiveHook returns falseThe underlying layer does not support asynchronous reception, or registration failedFall back to polling receiveFrame
isSupported() is falseThe slave really does not support EoE, or the capability is unknownUse supportState() to tell unknown from confirmed unsupported