Revision 2c99037f os/core/src/aos_iostream.c
os/core/src/aos_iostream.c | ||
---|---|---|
72 | 72 |
/** |
73 | 73 |
* @brief Implementation of the BaseAsynchronousChannel putt() method. |
74 | 74 |
*/ |
75 |
static msg_t _channelputt(void *instance, uint8_t b, systime_t time)
|
|
75 |
static msg_t _channelputt(void *instance, uint8_t b, sysinterval_t time)
|
|
76 | 76 |
{ |
77 | 77 |
if (((AosIOChannel*)instance)->flags & AOS_IOCHANNEL_OUTPUT_ENABLE) { |
78 | 78 |
return chnPutTimeout(((AosIOChannel*)instance)->asyncchannel, b, time); |
... | ... | |
84 | 84 |
/** |
85 | 85 |
* @brief Implementation of the BaseAsynchronousChannel gett() method. |
86 | 86 |
*/ |
87 |
static msg_t _channelgett(void *instance, systime_t time)
|
|
87 |
static msg_t _channelgett(void *instance, sysinterval_t time)
|
|
88 | 88 |
{ |
89 | 89 |
if (((AosIOChannel*)instance)->flags & AOS_IOCHANNEL_INPUT_ENABLE) { |
90 | 90 |
return chnGetTimeout(((AosIOChannel*)instance)->asyncchannel, time); |
... | ... | |
96 | 96 |
/** |
97 | 97 |
* @brief Implementation of the BaseAsynchronousChannel writet() method. |
98 | 98 |
*/ |
99 |
static size_t _channelwritet(void *instance, const uint8_t *bp, size_t n, systime_t time)
|
|
99 |
static size_t _channelwritet(void *instance, const uint8_t *bp, size_t n, sysinterval_t time)
|
|
100 | 100 |
{ |
101 | 101 |
if (((AosIOChannel*)instance)->flags & AOS_IOCHANNEL_OUTPUT_ENABLE) { |
102 | 102 |
return chnWriteTimeout(((AosIOChannel*)instance)->asyncchannel, bp, n, time); |
... | ... | |
108 | 108 |
/** |
109 | 109 |
* @brief Implementation of the BaseAsynchronousChannel readt() method. |
110 | 110 |
*/ |
111 |
static size_t _channelreadt(void *instance, uint8_t *bp, size_t n, systime_t time)
|
|
111 |
static size_t _channelreadt(void *instance, uint8_t *bp, size_t n, sysinterval_t time)
|
|
112 | 112 |
{ |
113 | 113 |
if (((AosIOChannel*)instance)->flags & AOS_IOCHANNEL_INPUT_ENABLE) { |
114 | 114 |
return chnReadTimeout(((AosIOChannel*)instance)->asyncchannel, bp, n, time); |
... | ... | |
118 | 118 |
} |
119 | 119 |
|
120 | 120 |
/** |
121 |
* @brief Implementation of the BaseAsynchronousChannel ctl() method. |
|
122 |
*/ |
|
123 |
static msg_t _channelctl(void *instance, unsigned int operation, void *arg) { |
|
124 |
(void) instance; |
|
125 |
|
|
126 |
switch (operation) { |
|
127 |
case CHN_CTL_NOP: |
|
128 |
osalDbgCheck(arg == NULL); |
|
129 |
break; |
|
130 |
case CHN_CTL_INVALID: |
|
131 |
osalDbgAssert(false, "invalid CTL operation"); |
|
132 |
break; |
|
133 |
default: |
|
134 |
break; |
|
135 |
} |
|
136 |
return MSG_OK; |
|
137 |
} |
|
138 |
|
|
139 |
/** |
|
121 | 140 |
* @brief Virtual methods table for all AosIOChannel objects. |
122 | 141 |
*/ |
123 | 142 |
static const struct AosIOChannelVMT _channelvmt = { |
... | ... | |
130 | 149 |
_channelgett, |
131 | 150 |
_channelwritet, |
132 | 151 |
_channelreadt, |
152 |
_channelctl, |
|
133 | 153 |
}; |
134 | 154 |
|
135 | 155 |
/** |
Also available in: Unified diff