类 VoE
java.lang.Object
com.darra.ethercat.slave.VoE
- 所有已实现的接口:
IMailboxProtocol
VoE (Vendor specific over EtherCAT) 完整实现
对齐 C# VoEInstance: Send/Receive/SendAndReceive + Raw 帧操作 + 帧构建解析
+ SendRawAndReceive + IsSupported
-
嵌套类概要
嵌套类修饰符和类型类说明static interface监听器接口 (Listener interface) — Vendor-initiated VoE 帧到达时触发.static class通知事件参数 (对齐 C# VoENotificationEventArgs).static classVoE 协议异常 (VoE protocol exception).static classVoE 响应数据结构 -
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明void添加通知监听器 (Add notification listener).byte[]BuildVoEFrame(int vendorId, short vendorType, byte[] data) 构建标准 VoE 帧 (头 + 数据)protected Executor默认 Executor, 子类或用户可覆盖以使用自定义线程池 (Default Executor, subclass or user can override for custom thread pool)intvoidDefaultTimeoutMs(int value) protected void内部分发入口 — FFI 回调到达时调用此方法将事件分发给所有监听器.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.邮箱统计快照.static boolean监听线程是否运行 (Whether the listener thread is running).boolean从站是否支持 VoE 邮箱协议 (委托给IsSupported()).boolean检查从站是否支持 VoE 邮箱协议 (mbx_proto bit 5 = 0x0020) 对齐 C# VoEInstance.IsSupportedParseVoEFrame(byte[] frame) 解析 VoE 帧头部Receive()Receive(int timeoutMs) 从从站接收 VoE 数据异步接收 (默认超时) (Async receive with default timeout)receiveAsync(int timeoutMs) 异步接收 VoE 数据 (Asynchronously receive VoE data).byte[]byte[]ReceiveRaw(int timeoutMs) 接收原始 VoE 帧void移除通知监听器 (Remove notification listener).void重置邮箱统计.booleanSend(int vendorId, short vendorType, byte[] data) booleanSend(int vendorId, short vendorType, byte[] data, int timeoutMs) 发送 VoE 数据到从站SendAndReceive(int vendorId, short vendorType, byte[] data) SendAndReceive(int vendorId, short vendorType, byte[] data, int timeoutMs) 发送并等待响应sendAndReceiveAsync(int vendorId, short vendorType, byte[] data) 异步发送并接收 (默认超时) (Async send-and-receive with default timeout)sendAndReceiveAsync(int vendorId, short vendorType, byte[] data, int timeoutMs) 异步发送并接收响应 (Asynchronously send and receive response).sendAsync(int vendorId, short vendorType, byte[] data) 异步发送 (默认超时) (Async send with default timeout)sendAsync(int vendorId, short vendorType, byte[] data, int timeoutMs) 异步发送 VoE 数据 (Asynchronously send VoE data).booleanSendRaw(byte[] frameData) booleanSendRaw(byte[] frameData, int timeoutMs) 发送原始 VoE 帧byte[]SendRawAndReceive(byte[] frameData) 发送原始帧并等待响应 (默认超时)byte[]SendRawAndReceive(byte[] frameData, int timeoutMs) 发送原始帧并等待响应 对齐 C# VoEInstance.SendRawAndReceiveboolean启动 VoE 监听线程 (Start VoE notification listener thread).static void停止整个 master 的 VoE 监听线程 (Stop all listeners on the master).void停止本实例的 VoE 通知订阅 (Stop notification subscription for this instance).
-
字段详细资料
-
VOE_HEADER_SIZE
public static final int VOE_HEADER_SIZEVoE 头部大小 (VendorID 4字节 + VendorType 2字节)- 另请参阅:
-
-
构造器详细资料
-
VoE
public VoE(short masterIndex, short slaveIndex)
-
-
方法详细资料
-
DefaultTimeoutMs
public int DefaultTimeoutMs() -
DefaultTimeoutMs
public void DefaultTimeoutMs(int value) -
IsSupported
public boolean IsSupported()检查从站是否支持 VoE 邮箱协议 (mbx_proto bit 5 = 0x0020) 对齐 C# VoEInstance.IsSupported- 返回:
- 支持返回 true
-
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- 返回:
- 协议类型 0x0F (VoE).
-
getProtocolName
从接口复制的说明:IMailboxProtocol协议名称 ("CoE" / "FoE" / "SoE" / "AoE" / "EoE" / "VoE" / "FSoE").
Protocol name literal.- 指定者:
getProtocolName在接口中IMailboxProtocol- 返回:
- 协议名称 "VoE".
-
isSupported
public boolean isSupported()- 指定者:
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
-
Send
public boolean Send(int vendorId, short vendorType, byte[] data, int timeoutMs) 发送 VoE 数据到从站 -
Send
public boolean Send(int vendorId, short vendorType, byte[] data) -
Receive
从从站接收 VoE 数据 -
Receive
-
SendAndReceive
发送并等待响应 -
SendAndReceive
-
defaultExecutor
默认 Executor, 子类或用户可覆盖以使用自定义线程池 (Default Executor, subclass or user can override for custom thread pool) -
sendAsync
public CompletableFuture<Boolean> sendAsync(int vendorId, short vendorType, byte[] data, int timeoutMs) 异步发送 VoE 数据 (Asynchronously send VoE data).- 参数:
vendorId- 厂商 ID (vendor ID)vendorType- 厂商类型 (vendor type)data- 数据字节 (payload bytes)timeoutMs- 超时毫秒 (timeout ms)- 返回:
- 成功为 true 的 CompletableFuture (CompletableFuture resolving to true on success)
- 抛出:
VoE.VoEProtocolException- 发送失败 (VoE send failure)
-
sendAsync
异步发送 (默认超时) (Async send with default timeout) -
receiveAsync
异步接收 VoE 数据 (Asynchronously receive VoE data).- 参数:
timeoutMs- 超时毫秒 (timeout ms)- 返回:
- 包含 VoEResponse 的 CompletableFuture (CompletableFuture with VoEResponse)
- 抛出:
VoE.VoEProtocolException- 接收失败 (VoE receive failure)
-
receiveAsync
异步接收 (默认超时) (Async receive with default timeout) -
sendAndReceiveAsync
public CompletableFuture<VoE.VoEResponse> sendAndReceiveAsync(int vendorId, short vendorType, byte[] data, int timeoutMs) 异步发送并接收响应 (Asynchronously send and receive response).- 参数:
vendorId- 厂商 ID (vendor ID)vendorType- 厂商类型 (vendor type)data- 数据字节 (payload bytes)timeoutMs- 超时毫秒 (timeout ms)- 返回:
- 包含 VoEResponse 的 CompletableFuture (CompletableFuture with VoEResponse)
- 抛出:
VoE.VoEProtocolException- 失败 (VoE exchange failure)
-
sendAndReceiveAsync
public CompletableFuture<VoE.VoEResponse> sendAndReceiveAsync(int vendorId, short vendorType, byte[] data) 异步发送并接收 (默认超时) (Async send-and-receive with default timeout) -
StartNotificationListener
public boolean StartNotificationListener()启动 VoE 监听线程 (Start VoE notification listener thread).对齐 C#
VoEInstance.StartNotificationListener.FFI 路径: 调用
VOEStartNotificationListener+VOERegisterNotification; DLL 未导出 (UnsatisfiedLinkError) 时静默 fallback 返回 false.- 返回:
- 真实启动成功返回 true; DLL 未导出或失败返回 false.
-
StopNotificationListener
public void StopNotificationListener()停止本实例的 VoE 通知订阅 (Stop notification subscription for this instance).FFI 路径: 调用
VOEUnregisterNotification; DLL 未导出时静默 fallback. -
stopAllListeners
public static void stopAllListeners()停止整个 master 的 VoE 监听线程 (Stop all listeners on the master).FFI 路径: 调用
VOEStopNotificationListener; DLL 未导出时静默 fallback. -
isListenerRunning
public static boolean isListenerRunning()监听线程是否运行 (Whether the listener thread is running).FFI 路径: 调用
VOEIsNotificationListening; DLL 未导出时返回 false. -
addNotificationListener
添加通知监听器 (Add notification listener). -
removeNotificationListener
移除通知监听器 (Remove notification listener). -
dispatchNotification
内部分发入口 — FFI 回调到达时调用此方法将事件分发给所有监听器.
Internal dispatch hook — called by the JNI callback once FFI binding lands. -
SendRaw
public boolean SendRaw(byte[] frameData, int timeoutMs) 发送原始 VoE 帧 -
SendRaw
public boolean SendRaw(byte[] frameData) -
ReceiveRaw
public byte[] ReceiveRaw(int timeoutMs) 接收原始 VoE 帧 -
ReceiveRaw
public byte[] ReceiveRaw() -
SendRawAndReceive
public byte[] SendRawAndReceive(byte[] frameData, int timeoutMs) 发送原始帧并等待响应 对齐 C# VoEInstance.SendRawAndReceive- 参数:
frameData- 要发送的帧数据timeoutMs- 超时时间 (毫秒)- 返回:
- 响应帧数据, 失败返回 null
-
SendRawAndReceive
public byte[] SendRawAndReceive(byte[] frameData) 发送原始帧并等待响应 (默认超时) -
BuildVoEFrame
public byte[] BuildVoEFrame(int vendorId, short vendorType, byte[] data) 构建标准 VoE 帧 (头 + 数据) -
ParseVoEFrame
解析 VoE 帧头部
-