Arduino等效的流函数在免费RTOS ESP-IDF中
我试图在ESP-IDF上找到一个等效函数,就像Arduino的流()一样 我要做的是使MSP函数与ESPS UART与MSP协议进行通信,我在Ubuntu环境中使用ESP-IDF和Free-RTOS,然后CMAKE构建
https://www.arduino.cc/reference/reference/en/language/language/language/functions/communication/communication/communication/communication/communication /stream/ https://github.com/yaojo10/msp-arduino/msp-arduino/blob/ master/msp.cpp
我尝试使用std :: ostringstream*,但显然没有做相同的工作
i am trying to find an equivalent function on ESP-IDF that will be like Stream() of arduino ,
what i am trying to do is to make an MSP function to communicate with the MSP protocol with the ESPs UART, i am using ESP-IDF and Free-Rtos in an Ubuntu environment and cmake to built
https://www.arduino.cc/reference/en/language/functions/communication/stream/
https://github.com/yajo10/MSP-Arduino/blob/master/MSP.cpp
i tryied to use std::ostringstream* but obviously doesnt make the same job
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
OSTRINGSTREAM
是A 专业ostream
其中“设备”是存储器缓冲区。流
是许多设备子类的 基类,它是双向的。标准库在给定合适的流I/O驱动程序的标准库将是std :: istream
和std :: Ostream
用于输入和输出,每个都在特定设备上打开。在大多数情况下,您将使用派生的std :: ifstream
和std :: ofStream
类S类,并以“文件流”打开设备。如果您需要一个相同的接口才能使用未修改的代码,则可以实现
stream
作为围绕iostream
的包装器,这是可行的。ostringstream
is a specialisedostream
where the "device" is a memory buffer.Stream
is an unspecialised base class for a number of device sub-classes, and it is bi-directional. The standard library equivalent given a suitable stream I/O driver would bestd::istream
andstd::ostream
for input and output respectively, each opened on the specific device. In most cases you would use the derivedstd::ifstream
andstd::ofstream
class s and open the device as a "file stream".If you require an identical interface in order to use the code unmodified, then implementing
Stream
as a wrapper aroundiostream
is feasible.