XWOS API  4.0
XWOS C/C++ API参考手册
载入中...
搜索中...
未找到
XwsscPortProxy.cxx
浏览该文件的文档.
1
14
15extern "C" {
16#include "xwmd/isc/xwssc/mif.h"
18}
19
20namespace xwisc {
21
22/* Non-static Member */
24 xwu8_t default_priority, xwu8_t default_qos)
25 : mProxy(xwssc)
26 , mPort(port)
27 , mDefaultPriority(default_priority)
28 , mDefaultQos(default_qos)
29{
30}
31
33{
35}
36
38 xwu8_t pri, xwu8_t qos)
39{
40 return xwssc_tx(mProxy, data, size, pri, mPort, qos, XWTM_MAX);
41}
42
44{
45 return xwssc_tx(mProxy, data, size, mDefaultPriority, mPort, mDefaultQos, to);
46}
47
49 xwu8_t pri, xwu8_t qos, xwtm_t to)
50{
51 return xwssc_tx(mProxy, data, size, pri, mPort, qos, to);
52}
53
55 xwssc_txh_t * txhbuf)
56{
57 return xwssc_eq(mProxy, data, size, mDefaultPriority, mPort, mDefaultQos,
58 sOnAsyncWrited, this, txhbuf);
59}
60
62 xwu8_t pri, xwu8_t qos,
63 xwssc_txh_t * txhbuf)
64{
65 return xwssc_eq(mProxy, data, size, pri, mPort, qos,
66 sOnAsyncWrited, this, txhbuf);
67}
68
70{
71 return xwssc_abort(mProxy, txh);
72}
73
75{
76 return xwssc_rx(mProxy, mPort, rxbuf, size, nullptr, XWTM_MAX);
77}
78
80{
81 return xwssc_rx(mProxy, mPort, rxbuf, size, qos, to);
82}
83
85{
86 return xwssc_try_rx(mProxy, mPort, rxbuf, size, nullptr);
87}
88
90{
91 return xwssc_try_rx(mProxy, mPort, rxbuf, size, qos);
92}
93
95{
96 XWOS_UNUSED(txh);
97 XWOS_UNUSED(rc);
98}
99
100/* Static Member */
102 xwer_t rc, void * arg)
103{
104 XwsscPortProxy * proxy = reinterpret_cast<XwsscPortProxy *>(arg);
106 proxy->onAsyncWrited(txh, rc);
107}
108
109} // namespace xwisc
xwisc::XwsscPortProxy
XWSSC端口代理
xwer_t asyncWrite(const xwu8_t data[], xwsz_t *size, xwssc_txh_t *txhbuf)
异步发送数据
xwer_t write(const xwu8_t data[], xwsz_t *size)
发送数据,并同步等待发送结果
xwer_t abortAsyncWrite(xwssc_txh_t txh)
中断异步发送
xwer_t read(xwu8_t rxbuf[], xwsz_t *size)
接收数据,若数据为空,就无限等待
static void sOnAsyncWrited(struct xwssc *xwssc, xwssc_txh_t txh, xwer_t rc, void *arg)
virtual void onAsyncWrited(xwssc_txh_t txh, xwer_t rc)
xwer_t tryRead(xwu8_t rxbuf[], xwsz_t *size)
尝试接收消息,若接收队列为空,立即返回错误码
xwer_t xwssc_tx(struct xwssc *xwssc, const xwu8_t data[], xwsz_t *size, xwu8_t pri, xwu8_t port, xwu8_t qos, xwtm_t to)
XWSSC API: 将用户数据加入到XWSSC的发送队列中,并在限定的时间内等待发送结果
xwer_t xwssc_abort(struct xwssc *xwssc, xwssc_txh_t txh)
XWSSC API: 中断发送
xwer_t xwssc_rx(struct xwssc *xwssc, xwu8_t port, xwu8_t rxbuf[], xwsz_t *size, xwu8_t *qos, xwtm_t to)
XWSSC API: 接收消息,若接收队列为空,就限时等待
xwer_t xwssc_try_rx(struct xwssc *xwssc, xwu8_t port, xwu8_t rxbuf[], xwsz_t *size, xwu8_t *qos)
XWSSC API: 尝试接收消息,若接收队列为空,立即返回错误码
xwer_t xwssc_eq(struct xwssc *xwssc, const xwu8_t data[], xwsz_t *size, xwu8_t pri, xwu8_t port, xwu8_t qos, xwssc_ntf_f ntfcb, void *cbarg, xwssc_txh_t *txhbuf)
XWSSC API: 将一条用户数据加入到XWSSC的发送队列中
xws64_t xwtm_t
XWOS系统时间 (有符号)
Definition type.h:742
#define XWTM_MAX
xwtm_t 的最大值
Definition type.h:755
signed long xwer_t
Definition type.h:554
unsigned long xwsz_t
Definition type.h:339
uint8_t xwu8_t
Definition type.h:194
#define XWOS_UNUSED(x)
Definition standard.h:66
Definition Xwcq.hxx:20
SOC间点对点通讯协议:协议层
包含待发送帧的发送器
Definition protocol.h:149
XWSSC对象
Definition protocol.h:160
SOC间点对点通讯协议:用户应用接口层