TpBluetoothSocket 类
V0.2.1TpExtUtils
2025-11-14
介绍
蓝牙设备的连接通信
基础信息
| 头文件: | include <TpBluetoothSocket.h> |
|---|---|
| Cmake: | None |
| 发布版本: | V0.2.1 |
| 继承类: | |
| 派生类: |
信号
| 信号名称 | 参数 | 描述 |
|---|---|---|
| connected | ||
| disconnected | TpBluetoothSocket * | |
| readyRead | TpBluetoothSocket * |
Public 成员函数
| TpBluetoothSocket(const TpString &name, TpBluetoothService::Protocol type=TpBluetoothService::TP_BLUET_UNKNOWN_PROTOCOL) | ||
|---|---|---|
| TpBluetoothSocket(const TpString &name, int sockfd, TpBluetoothService::Protocol type=TpBluetoothService::TP_BLUET_UNKNOWN_PROTOCOL) | ||
| ~TpBluetoothSocket() | ||
| connectToService(const TpBluetoothService &service) | 连接到远端蓝牙设备(暂不支持) | |
| connectToService(const TpBluetoothAddress &addr, const TpString &uuid) | 连接到远端蓝牙设备(暂不支持) | |
| connectToService(const TpBluetoothAddress &addr, tpUInt16 port) | 连接到远端蓝牙设备 | |
| disconnectFromService() | 断开连接 | |
| send(const tpUInt8 *buff, tpUInt64 size) | ||
| recv(tpUInt8 *buff, tpUInt64 size) | ||
| TpBluetoothAddress | getPeerAddress() | |
| TpString | getPeerName() | |
| getPeerPort() |
成员函数说明
TpBluetoothSocket::TpBluetoothSocket(const TpString &name, TpBluetoothService::Protocol type=TpBluetoothService::TP_BLUET_UNKNOWN_PROTOCOL)
暂无注释...
TpBluetoothSocket::TpBluetoothSocket(const TpString &name, int sockfd, TpBluetoothService::Protocol type=TpBluetoothService::TP_BLUET_UNKNOWN_PROTOCOL)
暂无注释...
TpBluetoothSocket::~TpBluetoothSocket()
暂无注释...
int TpBluetoothSocket::connectToService(const TpBluetoothService &service)
连接到远端蓝牙设备(暂不支持)...
连接到远端蓝牙设备(暂不支持)
参数:service: 远端蓝牙的服务
返回值:
int TpBluetoothSocket::connectToService(const TpBluetoothAddress &addr, const TpString &uuid)
连接到远端蓝牙设备(暂不支持)...
连接到远端蓝牙设备(暂不支持)
参数:addr:
参数:uuid: 服务的uuid(注意不能使用protocol的uuid)
返回值:
int TpBluetoothSocket::connectToService(const TpBluetoothAddress &addr, tpUInt16 port)
连接到远端蓝牙设备...
连接到远端蓝牙设备
参数:addr: 远端地址
参数:port: 通道号或psm号
返回值:
int TpBluetoothSocket::disconnectFromService()
断开连接...
断开连接
返回值:
