TpBluetoothService 类
V0.2.1TpExtUtils
2025-11-14
基础信息
| 头文件: | include <TpBluetoothService.h> |
|---|---|
| Cmake: | None |
| 发布版本: | V0.2.1 |
| 继承类: | |
| 派生类: |
Public 类型
enum TpBluetoothService::Protocol
| 名称 | 值 | 描述 |
|---|---|---|
| TP_BLUET_UNKNOWN_PROTOCOL | 0 | |
| TP_BLUET_L2CAP_PROTOCOL | 1 | |
| TP_BLUET_RFCOMM_PROTOCOL | 2 |
enum TpBluetoothService::Profile
| 名称 | 值 | 描述 |
|---|---|---|
| TP_BLUET_UNKNOWN_PROFILE | 0 | |
| TP_BLUET_SPP_PROFILE | 1 |
enum TpBluetoothService::AttributeType
| 名称 | 值 | 描述 |
|---|---|---|
| ServiceRecordHandle | 0X0000 | |
| ServiceClassIds | 0X0001 | |
| ServiceRecordState | 0X0002 | |
| ServiceId | 0X0003 | |
| ProtocolDescriptorList | 0X0004 | |
| BrowseGroupList | 0X0005 | |
| LanguageBaseAttributeIdList | 0X0006 | |
| ServiceInfoTimeToLive | 0X0007 | |
| ServiceAvailability | 0X0008 | |
| BluetoothProfileDescriptorList | 0X0009 | |
| DocumentationUrl | 0X000A | |
| ClientExecutableUrl | 0X000B | |
| IconUrl | 0X000C | |
| AdditionalProtocolDescriptorList | 0X000D | |
| PrimaryLanguageBase | 0X0100 | |
| ServiceName | PrimaryLanguageBase + 0X0000 | |
| ServiceDescription | PrimaryLanguageBase + 0X0001 | |
| ServiceProvider | PrimaryLanguageBase + 0X0002 |
Public 成员函数
| TpBluetoothService() | ||
|---|---|---|
| TpBluetoothService & TpBluetoothService::operator= | operator=(const TpBluetoothService &other) | |
| TpBluetoothService & TpBluetoothService::operator= | operator=(TpBluetoothService &&other) noexcept | |
| TpBluetoothService(TpBluetoothService &&other) noexcept | ||
| TpBluetoothService(const TpBluetoothService &other) | ||
| ~TpBluetoothService() | ||
| TpBluetoothUuid | getServiceUuid() const | 获取服务的UUID |
| setServiceUuid(const TpBluetoothUuid &uuid) | 设置服务的UUID | |
| TpString | getServiceName() const | 获取服务的名字 |
| setServiceName(const TpString &name) | 设置服务的名字 | |
| TpBluetoothAddress | getDeviceAddress() const | 获取产生服务的设备地址 |
| TpString | getServiceDescription() const | 获取服务的描述 |
| setServiceDescription(const TpString &desc) | 设置服务的描述 | |
| setServiceChannel(tpUInt16 channel) | 设置服务的通道号 | |
| getServerChannel() | 获取通道号 | |
| setServiceProvider(const TpString &provider) | 设置服务提供者 | |
| TpString | getServiceProvider() const | 获取服务提供者 |
| registerService(const TpBluetoothAddress &address=TpBluetoothAddress()) | 注册服务 | |
| isRegisted() | 是否注册 | |
| unregisterService() | 注销服务 | |
| setServiceClassUuids(TpList< TpBluetoothUuid > &uuids) | 设置服务的所有UUID(会覆盖原来的设置),如果没有设置主UUID,会默认以第一个为主UUID | |
| addServiceClassUuid(TpBluetoothUuid &uuid) | 新增uuid到服务的UUID列表 | |
| TpList< TpBluetoothUuid > | getServiceClassUuids() const | 获取服务的所有UUID |
| setServiceRecHandle(tpUInt32 handle) | ||
| getServiceRecHandle() const | ||
| setAttribute(uint16_t attributeId, const TpVariant &value) | ||
| setAttribute(uint16_t attributeId, const Sequence &value) | ||
| const TpVariant & | getAttribute(uint16_t attributeId) const | |
| const std::map< uint16_t, TpVariant > & | getAttributes() const | |
| Sequence | getProtocolDescriptorList() const | |
| Sequence | getProfileDescriptorList() const | |
| setProtocolDescriptorList(const Sequence &list) | ||
| setProfileDescriptorList(const Sequence &list) |
成员函数说明
TpBluetoothService::TpBluetoothService()
暂无注释...
TpBluetoothService & TpBluetoothService::operator=(const TpBluetoothService &other)
暂无注释...
TpBluetoothService & TpBluetoothService::operator=(TpBluetoothService &&other) noexcept
暂无注释...
TpBluetoothService::TpBluetoothService(TpBluetoothService &&other) noexcept
暂无注释...
TpBluetoothService::TpBluetoothService(const TpBluetoothService &other)
暂无注释...
TpBluetoothService::~TpBluetoothService()
暂无注释...
TpBluetoothUuid TpBluetoothService::getServiceUuid() const
获取服务的UUID...
获取服务的UUID
返回值:
int TpBluetoothService::setServiceUuid(const TpBluetoothUuid &uuid)
设置服务的UUID...
设置服务的UUID
参数:uuid:
返回值:
TpString TpBluetoothService::getServiceName() const
获取服务的名字...
获取服务的名字
返回值:
int TpBluetoothService::setServiceName(const TpString &name)
设置服务的名字...
设置服务的名字
参数:name:
返回值:
TpBluetoothAddress TpBluetoothService::getDeviceAddress() const
获取产生服务的设备地址...
获取产生服务的设备地址
返回值:
TpString TpBluetoothService::getServiceDescription() const
获取服务的描述...
获取服务的描述
返回值:
int TpBluetoothService::setServiceDescription(const TpString &desc)
设置服务的描述...
设置服务的描述
参数:desc:
返回值:
int TpBluetoothService::setServiceChannel(tpUInt16 channel)
设置服务的通道号...
设置服务的通道号
参数:channel:
返回值:
tpUInt16 TpBluetoothService::getServerChannel()
获取通道号...
获取通道号
返回值:
int TpBluetoothService::setServiceProvider(const TpString &provider)
设置服务提供者...
设置服务提供者
参数:provider:
返回值:
TpString TpBluetoothService::getServiceProvider() const
获取服务提供者...
获取服务提供者
返回值:
tpBool TpBluetoothService::registerService(const TpBluetoothAddress &address=TpBluetoothAddress())
注册服务...
注册服务
参数:address:
返回值:
tpBool TpBluetoothService::isRegisted()
是否注册...
是否注册
返回值:
tpBool TpBluetoothService::unregisterService()
注销服务...
注销服务
返回值:
int TpBluetoothService::setServiceClassUuids(TpList< TpBluetoothUuid > &uuids)
设置服务的所有UUID(会覆盖原来的设置),如果没有设置主U...
设置服务的所有UUID(会覆盖原来的设置),如果没有设置主UUID,会默认以第一个为主UUID
参数:uuids:
返回值:
int TpBluetoothService::addServiceClassUuid(TpBluetoothUuid &uuid)
新增uuid到服务的UUID列表...
新增uuid到服务的UUID列表
参数:uuid:
返回值:
TpList< TpBluetoothUuid > TpBluetoothService::getServiceClassUuids() const
获取服务的所有UUID...
获取服务的所有UUID
返回值:
int TpBluetoothService::setServiceRecHandle(tpUInt32 handle)
暂无注释...
参数:handle:
返回值:
tpUInt32 TpBluetoothService::getServiceRecHandle() const
暂无注释...
返回值:
void TpBluetoothService::setAttribute(uint16_t attributeId, const TpVariant &value)
暂无注释...
参数:attributeId:
参数:value:
void TpBluetoothService::setAttribute(uint16_t attributeId, const Sequence &value)
暂无注释...
参数:attributeId:
参数:value:
const TpVariant & TpBluetoothService::getAttribute(uint16_t attributeId) const
暂无注释...
参数:attributeId:
返回值:
const std::map< uint16_t, TpVariant > & TpBluetoothService::getAttributes() const
暂无注释...
返回值:
Sequence TpBluetoothService::getProtocolDescriptorList() const
暂无注释...
返回值:
Sequence TpBluetoothService::getProfileDescriptorList() const
暂无注释...
返回值:
int TpBluetoothService::setProtocolDescriptorList(const Sequence &list)
暂无注释...
参数:list:
返回值:
int TpBluetoothService::setProfileDescriptorList(const Sequence &list)
暂无注释...
参数:list:
返回值:
