Revision 2c99037f os/core/src/aos_shell.c
os/core/src/aos_shell.c | ||
---|---|---|
85 | 85 |
/** |
86 | 86 |
* @brief Implementation of the BaseAsynchronous putt() method. |
87 | 87 |
*/ |
88 |
static msg_t _channelputt(void *instance, uint8_t b, systime_t time)
|
|
88 |
static msg_t _channelputt(void *instance, uint8_t b, sysinterval_t time)
|
|
89 | 89 |
{ |
90 | 90 |
if (((AosShellChannel*)instance)->flags & AOS_SHELLCHANNEL_OUTPUT_ENABLED) { |
91 | 91 |
return chnPutTimeout(((AosShellChannel*)instance)->asyncchannel, b, time); |
... | ... | |
97 | 97 |
/** |
98 | 98 |
* @brief Implementation of the BaseAsynchronous gett() method. |
99 | 99 |
*/ |
100 |
static msg_t _channelgett(void *instance, systime_t time)
|
|
100 |
static msg_t _channelgett(void *instance, sysinterval_t time)
|
|
101 | 101 |
{ |
102 | 102 |
if (((AosShellChannel*)instance)->flags & AOS_SHELLCHANNEL_INPUT_ENABLED) { |
103 | 103 |
return chnGetTimeout(((AosShellChannel*)instance)->asyncchannel, time); |
... | ... | |
109 | 109 |
/** |
110 | 110 |
* @brief Implementation of the BaseAsynchronous writet() method. |
111 | 111 |
*/ |
112 |
static size_t _channelwritet(void *instance, const uint8_t *bp, size_t n, systime_t time)
|
|
112 |
static size_t _channelwritet(void *instance, const uint8_t *bp, size_t n, sysinterval_t time)
|
|
113 | 113 |
{ |
114 | 114 |
if (((AosShellChannel*)instance)->flags & AOS_SHELLCHANNEL_OUTPUT_ENABLED) { |
115 | 115 |
return chnWriteTimeout(((AosShellChannel*)instance)->asyncchannel, bp, n, time); |
... | ... | |
121 | 121 |
/** |
122 | 122 |
* @brief Implementation of the BaseAsynchronous readt() method. |
123 | 123 |
*/ |
124 |
static size_t _channelreadt(void *instance, uint8_t *bp, size_t n, systime_t time)
|
|
124 |
static size_t _channelreadt(void *instance, uint8_t *bp, size_t n, sysinterval_t time)
|
|
125 | 125 |
{ |
126 | 126 |
if (((AosShellChannel*)instance)->flags & AOS_SHELLCHANNEL_INPUT_ENABLED) { |
127 | 127 |
return chnReadTimeout(((AosShellChannel*)instance)->asyncchannel, bp, n, time); |
... | ... | |
130 | 130 |
} |
131 | 131 |
} |
132 | 132 |
|
133 |
/** |
|
134 |
* @brief Implementation of the BaseAsynchronousChannel ctl() method. |
|
135 |
*/ |
|
136 |
static msg_t _channelctl(void *instance, unsigned int operation, void *arg) { |
|
137 |
(void) instance; |
|
138 |
|
|
139 |
switch (operation) { |
|
140 |
case CHN_CTL_NOP: |
|
141 |
osalDbgCheck(arg == NULL); |
|
142 |
break; |
|
143 |
case CHN_CTL_INVALID: |
|
144 |
osalDbgAssert(false, "invalid CTL operation"); |
|
145 |
break; |
|
146 |
default: |
|
147 |
break; |
|
148 |
} |
|
149 |
return MSG_OK; |
|
150 |
} |
|
151 |
|
|
133 | 152 |
static const struct AosShellChannelVMT _channelvmt = { |
134 | 153 |
(size_t) 0, |
135 | 154 |
_channelwrite, |
... | ... | |
140 | 159 |
_channelgett, |
141 | 160 |
_channelwritet, |
142 | 161 |
_channelreadt, |
162 |
_channelctl, |
|
143 | 163 |
}; |
144 | 164 |
|
145 | 165 |
static size_t _streamwrite(void *instance, const uint8_t *bp, size_t n) |
Also available in: Unified diff