GKD.RoboCtrl
载入中...
搜索中...
未找到
roboctrl::io::serial类 参考

串口设备对象。 更多...

详细描述

串口设备对象。

在文件 serial.h28 行定义.

#include <serial.h>

类 roboctrl::io::serial 继承关系图:
roboctrl::io::keyed_io_base< uint8_t > roboctrl::utils::immovable_base roboctrl::utils::not_copyable_base

struct  info_type
 串口初始化参数。 更多...
 

Public 类型

using key_type = std::uint8_t
 

Public 成员函数

 serial (info_type info)
 打开并配置串口。
 
awaitable< voidsend (key_type key, byte_span data)
 发送字节数据。
 
awaitable< voidtask ()
 接收循环任务。
 
std::string desc () const
 
- Public 成员函数 继承自 roboctrl::io::keyed_io_base< uint8_t >
void on_data (const uint8_t &key, callback_fn< byte_span > auto fn, size_t size=0)
 注册指定 key 的回调。
 
void on_data (const uint8_t &key, Fn &&fn)
 注册平凡类型包的回调。
 
- Public 成员函数 继承自 roboctrl::utils::immovable_base
 immovable_base (immovable_base &&)=delete
 
immovable_baseoperator= (immovable_base &&)=delete
 
- Public 成员函数 继承自 roboctrl::utils::not_copyable_base
 not_copyable_base (const not_copyable_base &)=delete
 
not_copyable_baseoperator= (const not_copyable_base &)=delete
 

额外继承的成员函数

- Protected 成员函数 继承自 roboctrl::io::keyed_io_base< uint8_t >
void dispatch (const uint8_t &key, byte_span data)
 将数据派发给对应 key 的回调。
 
size_t package_size (const uint8_t &key)
 

成员类型定义说明

◆ key_type

using roboctrl::io::serial::key_type = std::uint8_t

在文件 serial.h46 行定义.

构造及析构函数说明

◆ serial()

serial::serial ( info_type  info)
explicit

打开并配置串口。

在文件 serial.cpp15 行定义.

成员函数说明

◆ desc()

std::string roboctrl::io::serial::desc ( ) const
inline

在文件 serial.h63 行定义.

◆ send()

roboctrl::awaitable< void > serial::send ( key_type  key,
byte_span  data 
)

发送字节数据。

在文件 serial.cpp30 行定义.

◆ task()

roboctrl::awaitable< void > serial::task ( )

接收循环任务。

在文件 serial.cpp44 行定义.

引用了 roboctrl::io::keyed_io_base< uint8_t >::dispatch().


该类的文档由以下文件生成: