类 EoE
java.lang.Object
com.darra.ethercat.slave.EoE
- 所有已实现的接口:
IMailboxProtocol
EoE (Ethernet over EtherCAT) 实现
对齐 C# EoEInstance: IP/Subnet/Gateway/MAC/DNS 属性, 帧收发, 地址过滤器
注意: IP/Subnet/Gateway/DNS 使用 EOEGetIP/EOESetIP 结构体 API,
不存在 EOEGetIPString/EOESetIPString 等字符串版本的 DLL 导出
-
嵌套类概要
嵌套类修饰符和类型类说明static classEoE Ping 结果 (对齐 C# EoEPingResult).static classEoE 协议异常 (EoE protocol exception).static interfaceEoE 异步接收监听器 (BiConsumer 风格: 无效输入:'<'slaveIndex, frameBytes>). -
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明booleanaddAddressFilter(byte[] mac, int timeoutMs) 添加单个 MAC 地址到过滤器列表 先读取已有过滤器, 追加新地址后重新设置booleanbooleanClearAddressFilters(int timeoutMs) 清空所有地址过滤器boolean清除 EoE 异步接收 Hook.protected Executor默认 Executor, 子类或用户可覆盖以使用自定义线程池 (Default Executor, subclass or user can override for custom thread pool)DNS()DNS 地址 - 读取 (以 IPv4 字符串返回, dnsName 作为辅助)voidDNS 地址 - 写入 (传入 IPv4 字符串)Gateway()网关 - 读取void网关 - 写入List<byte[]> List<byte[]> getAddressFilters(int timeoutMs) 获取当前地址过滤器列表long最后一次邮箱事务的协议层错误码 (CoE=SDO Abort, FoE=FoE Error, SoE=SoE Error, 等). 0 表示无错误或不适用.最后一次邮箱事务的统一状态.协议名称 ("CoE" / "FoE" / "SoE" / "AoE" / "EoE" / "VoE" / "FSoE").byte协议类型 (ECT_MBXT_*): AoE=0x01, EoE=0x02, CoE=0x03, FoE=0x04, SoE=0x05, FSoE=0x08, VoE=0x0F.邮箱统计快照.IP()IP 地址 (点分十进制字符串) - 读取voidIP 地址 - 写入boolean从站是否支持 EoE 邮箱协议.MAC()MAC 地址 (格式 AA:BB:CC:DD:EE:FF) - 读取voidMAC 地址 - 写入Ping (默认 5s 超时, TTL=64).通过 EoE 发送 ICMP Ping 并等待响应.异步 Ping (对齐 C# PingAsync).byte[]byte[]ReceiveFrame(int timeoutMs) 接收以太网帧CompletableFuture<byte[]> 异步接收帧 (默认超时) (Async receive with default timeout)CompletableFuture<byte[]> receiveFrameAsync(int timeoutMs) 异步接收以太网帧 (Asynchronously receive Ethernet frame).booleanremoveAddressFilter(byte[] mac, int timeoutMs) 从过滤器列表中移除指定 MAC 地址void重置邮箱统计.booleanSendFrame(byte[] frame) booleanSendFrame(byte[] frame, int timeoutMs) 发送以太网帧sendFrameAsync(byte[] frame) 异步发送帧 (默认超时) (Async send with default timeout)sendFrameAsync(byte[] frame, int timeoutMs) 异步发送以太网帧 (Asynchronously send Ethernet frame).booleanSendFrameWithTimestamp(byte[] frame, long timestamp) 发送以太网帧 (附加时间戳, 默认超时)booleanSendFrameWithTimestamp(byte[] frame, long timestamp, int timeoutMs) 发送以太网帧 (附加时间戳) 对齐 C# EoEInstance.SendFrameWithTimestamp 在帧末尾附加 4 字节时间戳 (ETG.1000.6 Table 78, Unsigned32)booleansetReceiveHook(EoE.ReceiveHookListener listener) 注册 EoE 异步接收 Hook (每 master 一个, 整库共用; 重复调用覆盖之前 listener).Subnet()子网掩码 - 读取void子网掩码 - 写入
-
字段详细资料
-
DEFAULT_TIMEOUT_MS
public static final int DEFAULT_TIMEOUT_MS默认超时 (毫秒)- 另请参阅:
-
-
构造器详细资料
-
EoE
public EoE(short masterIndex, short slaveIndex, byte port) -
EoE
public EoE(short masterIndex, short slaveIndex)
-
-
方法详细资料
-
getProtocolType
public byte getProtocolType()从接口复制的说明:IMailboxProtocol协议类型 (ECT_MBXT_*): AoE=0x01, EoE=0x02, CoE=0x03, FoE=0x04, SoE=0x05, FSoE=0x08, VoE=0x0F.
Protocol type constant (ECT_MBXT_*).- 指定者:
getProtocolType在接口中IMailboxProtocol- 返回:
- 协议类型 0x02 (EoE).
-
getProtocolName
从接口复制的说明:IMailboxProtocol协议名称 ("CoE" / "FoE" / "SoE" / "AoE" / "EoE" / "VoE" / "FSoE").
Protocol name literal.- 指定者:
getProtocolName在接口中IMailboxProtocol- 返回:
- 协议名称 "EoE".
-
isSupported
public boolean isSupported()从站是否支持 EoE 邮箱协议.
Whether the slave supports EoE.- 指定者:
isSupported在接口中IMailboxProtocol
-
getLastStatus
从接口复制的说明:IMailboxProtocol最后一次邮箱事务的统一状态. 初始为MailboxStatus.PENDING.
Status of the most recent mailbox transaction; initial value isMailboxStatus.PENDING.- 指定者:
getLastStatus在接口中IMailboxProtocol- 返回:
- 最近一次邮箱事务状态.
-
getLastErrorCode
public long getLastErrorCode()从接口复制的说明:IMailboxProtocol最后一次邮箱事务的协议层错误码 (CoE=SDO Abort, FoE=FoE Error, SoE=SoE Error, 等). 0 表示无错误或不适用.
Protocol-level error code of the last transaction (CoE SDO abort, FoE error code, SoE error, etc.). Zero means no error or not applicable.- 指定者:
getLastErrorCode在接口中IMailboxProtocol- 返回:
- 最近一次协议层错误码.
-
getStatistics
邮箱统计快照.
Mailbox statistics snapshot.[审计补齐 roundSDKSAN2] 经真实导出的 native EcxMbxGetStats 拉取.
- 指定者:
getStatistics在接口中IMailboxProtocol
-
resetStatistics
public void resetStatistics()重置邮箱统计.
Reset mailbox statistics.[审计补齐 roundSDKSAN2] 真调 native EcxMbxResetStats 重置统计.
- 指定者:
resetStatistics在接口中IMailboxProtocol
-
IP
IP 地址 (点分十进制字符串) - 读取 -
IP
IP 地址 - 写入 -
Subnet
子网掩码 - 读取 -
Subnet
子网掩码 - 写入 -
Gateway
网关 - 读取 -
Gateway
网关 - 写入 -
MAC
MAC 地址 (格式 AA:BB:CC:DD:EE:FF) - 读取 -
MAC
MAC 地址 - 写入 -
DNS
DNS 地址 - 读取 (以 IPv4 字符串返回, dnsName 作为辅助) -
DNS
DNS 地址 - 写入 (传入 IPv4 字符串) -
SendFrame
public boolean SendFrame(byte[] frame, int timeoutMs) 发送以太网帧- 参数:
frame- 帧数据timeoutMs- 超时 (毫秒)- 返回:
- 成功返回 true
-
SendFrame
public boolean SendFrame(byte[] frame) -
SendFrameWithTimestamp
public boolean SendFrameWithTimestamp(byte[] frame, long timestamp, int timeoutMs) 发送以太网帧 (附加时间戳) 对齐 C# EoEInstance.SendFrameWithTimestamp 在帧末尾附加 4 字节时间戳 (ETG.1000.6 Table 78, Unsigned32)- 参数:
frame- 帧数据timestamp- DC 时间戳 (纳秒)timeoutMs- 超时 (毫秒)- 返回:
- 成功返回 true
-
SendFrameWithTimestamp
public boolean SendFrameWithTimestamp(byte[] frame, long timestamp) 发送以太网帧 (附加时间戳, 默认超时) -
ReceiveFrame
public byte[] ReceiveFrame(int timeoutMs) 接收以太网帧- 参数:
timeoutMs- 超时 (毫秒)- 返回:
- 帧数据, 失败返回 null
-
ReceiveFrame
public byte[] ReceiveFrame() -
ping
通过 EoE 发送 ICMP Ping 并等待响应.- 参数:
targetIp- 目标 IP (点分十进制)timeoutMs- 超时 (毫秒)ttl- IP TTL- 返回:
- Ping 结果
-
ping
Ping (默认 5s 超时, TTL=64). -
pingAsync
异步 Ping (对齐 C# PingAsync). -
pingAsync
-
setReceiveHook
注册 EoE 异步接收 Hook (每 master 一个, 整库共用; 重复调用覆盖之前 listener).
对齐 C# EoEInstance EOESetReceiveHook.- 参数:
listener- 用户 listener; 传 null 等价clearReceiveHook().- 返回:
- DLL 接受注册返回 true; DLL 未导出或失败返回 false.
-
clearReceiveHook
public boolean clearReceiveHook()清除 EoE 异步接收 Hook. -
defaultExecutor
默认 Executor, 子类或用户可覆盖以使用自定义线程池 (Default Executor, subclass or user can override for custom thread pool) -
sendFrameAsync
异步发送以太网帧 (Asynchronously send Ethernet frame).- 参数:
frame- 帧字节数组 (frame bytes)timeoutMs- 超时毫秒 (timeout ms)- 返回:
- 成功为 true 的 CompletableFuture (CompletableFuture resolving to true on success)
- 抛出:
EoE.EoEProtocolException- 发送失败 (EoE send failure)
-
sendFrameAsync
异步发送帧 (默认超时) (Async send with default timeout) -
receiveFrameAsync
异步接收以太网帧 (Asynchronously receive Ethernet frame).- 参数:
timeoutMs- 超时毫秒 (timeout ms)- 返回:
- 包含帧字节的 CompletableFuture (CompletableFuture with frame bytes)
- 抛出:
EoE.EoEProtocolException- 接收失败 (EoE receive failure)
-
receiveFrameAsync
异步接收帧 (默认超时) (Async receive with default timeout) -
ClearAddressFilters
public boolean ClearAddressFilters(int timeoutMs) 清空所有地址过滤器 -
ClearAddressFilters
public boolean ClearAddressFilters() -
addAddressFilter
public boolean addAddressFilter(byte[] mac, int timeoutMs) 添加单个 MAC 地址到过滤器列表 先读取已有过滤器, 追加新地址后重新设置- 参数:
mac- MAC 地址 (6 字节)timeoutMs- 超时 (毫秒)- 返回:
- 是否成功
-
removeAddressFilter
public boolean removeAddressFilter(byte[] mac, int timeoutMs) 从过滤器列表中移除指定 MAC 地址- 参数:
mac- MAC 地址 (6 字节)timeoutMs- 超时 (毫秒)- 返回:
- 是否成功
-
getAddressFilters
获取当前地址过滤器列表- 参数:
timeoutMs- 超时 (毫秒)- 返回:
- MAC 地址列表 (每个 6 字节)
-
getAddressFilters
-