This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
您好,我正在使用 simplelink_cc13xx_cc26xx_sdk_6_10_00_29,并希望通过BTool或UNPI使用GATT服务器
并希望使用GATT服务器的一些抽象功能(如 GATTServApp),但无法使用BTool或HOST_TEST示例执行此操作。
ATM我们将串行命令从Windows/C++发送到host_test闪存的TI Launchpad,实现了大部分BLE功能。 现在,我们想为其添加GATT服务器功能。
您好,
下面介绍了host_test示例公开的GATT API。 GATT文档 可从此处获取。
如果您缺少某些命令或事件,请告知我们。
此致,
我看到仅适用于GATT服务器的功能来添加/删除服务和添加属性。 加上与广告相关的广告。
1)这些功能是否足以处理GATT服务器?
2) GATT服务器的所有响应是否由BLE堆栈在内部处理? 如"发现所有主要特征"的自动响应? 还是在属性值更改且设置了相应的CCCD时自动发送指示或通知?
3)我看不到用于更改属性值的函数。 服务器将如何更改此值?
您好,
我已将该主题重新分配给支持您的团队。
此致,
您好,
1)是的,提供的功能可用于创建和处理GATT服务器。 主机测试示例已包括一些GATT服务和特征,例如设备名称。
2)服务器响应由堆栈处理,正确。
3)使用'GATT'中列出的功能访问属性值,例如GATT_ReadCharValue或GATT_WriteCharValue。
如果要在没有btool的代码中实现配置文件,我建议使用 SimpleLink Academy:自定义配置文件
如果您的问题得到了回答,请告诉我。
此致
我已经了解了提供的操作方法(SimpleLink Academy:自定义配置文件)。 这个例子是SimplePeripheral,它与host_test有很大的不同,我很难找到如何在现有host_test默认服务的基础上修补简单的电池配置文件。 (host_test是我们的必备工具,因为我们通过UART和SPI使用该设备)
1)我看到在Host_test中实施了2个默认服务。 这些服务/配置文件在何处/如何实施?
2)如何将我的battery_service添加到host_test? 我是否应该在HostTestApp_init中的batteryService_AddService中添加一个呼叫,然后再添加:
// Add our services to GATT Server
VOID GGS_AddService(GAP_SERVICE);
VOID GATTServApp_AddService(GATT_ALL_SERVICES);
您好,
我现在看到,主机测试的结构与SimplePeripheral不同,但学院的更改也可以应用。
1)这些默认服务和特征在SDK的源文件中定义。 该项目在StackWrapper/Host/中列出这些文件,但它们链接到SKD文件。 如果您修改它们,它们将在项目文件夹之外修改,因此请注意可能对其他项目和工作区产生的副作用。 您应该能够删除链接的文件并从SDK复制到项目文件夹。
2)我从SimpleLink学院几乎遵循相同的步骤,例如,我添加了两个解决方案文件Application/services/sunlightService.c和.h
然后添加了服务和回叫,并设置了默认值。 我没有包括通过按钮按下和计时器进行的更新,但现在正在btool中发现这些服务,包括读/写访问。 修改后的host_test_app.c文件以及其他两个文件都被附加。
最后一步是以下步骤(从SimpleLink学院复制)
通过Application/services
打开项目属性,导航至Build (构建)→Arm Compiler (Arm编译器)→Include Options${PROJECT_LOC}/Application/services
(包含选项)并添加到列表,将添加到#include路径。
e2e.ti.com/.../host_5F00_test_5F00_app.c
e2e.ti.com/.../7217.sunlightService.c
e2e.ti.com/.../4162.sunlightService.h
这应该为您提供实施自己的服务的良好基础。
此致
感谢您的详细回答。 从第一次尝试开始就工作,现在我可以在Android中看到日光服务。
我必须启动BTool,将角色更改为外围设备(在HSIExt_ResetSystemCommand之后),创建广告,启用广告,然后我可以在扫描结果中看到TI,可以连接到它并看到日光服务。
将尝试立即适应蓄电池服务。
-------------------------------------------------------------------- [15] : <Tx> - 02:25:36.853 -Type : 0x01 (Command) -OpCode : 0xFC1D (HCIExt_ResetSystemCmd) -Data Length : 0x01 (1) byte(s) Type : 0x00 (0) (Chip Reset) Dump(Tx): 0000:01 1D FC 01 00 ..... -------------------------------------------------------------------- [16] : <Rx> - 02:25:36.866 -Type : 0x04 (Event) -EventCode : 0x00FF (HCI_LE_ExtEvent) -Data Length : 0x05 (5) bytes(s) Event : 0x041D (1053) (HCIExt_ResetSystemCmdDone) Status : 0x00 (0) (SUCCESS) CmdOpCode : 0xFC1D (HCIExt_ResetSystemCmd) Dump(Rx): 0000:04 FF 05 1D 04 00 1D FC ........ -------------------------------------------------------------------- [17] : <Tx> - 02:40:37.345 -Type : 0x01 (Command) -OpCode : 0xFE00 (GAP_DeviceInit) -Data Length : 0x08 (8) byte(s) ProfileRole : 0x04 (4) ( Peripheral) AddrMode : 0x00 (0) (ADDRMODE_PUBLIC) RandomAddr : 00:00:00:00:00:00 Dump(Tx): 0000:01 00 FE 08 04 00 00 00 00 00 00 00 ............ -------------------------------------------------------------------- [18] : <Rx> - 02:40:37.371 -Type : 0x04 (Event) -EventCode : 0x00FF (HCI_LE_ExtEvent) -Data Length : 0x06 (6) bytes(s) Event : 0x067F (1663) (GAP_HCI_ExtentionCommandStatus) Status : 0x00 (0) (SUCCESS) OpCode : 0xFE00 (GAP_DeviceInit) DataLength : 0x00 (0) Dump(Rx): 0000:04 FF 06 7F 06 00 00 FE 00 ......... -------------------------------------------------------------------- [19] : <Rx> - 02:40:37.387 -Type : 0x04 (Event) -EventCode : 0x00FF (HCI_LE_ExtEvent) -Data Length : 0x2C (44) bytes(s) Event : 0x0600 (1536) (GAP_DeviceInitDone) Status : 0x00 (0) (SUCCESS) DevAddr : F8:8A:5E:2D:70:B4 DataPktLen : 0x00FF (255) NumDataPkts : 0x05 (5) IRK : 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 CSRK : 4B:AA:5F:34:CA:92:B7:31:39:01:40:A1:C3:E2:AE:52 Dump(Rx): 0000:04 FF 2C 00 06 00 B4 70 2D 5E 8A F8 FF 00 05 00 ..,....p-^...... 0010:00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4B ...............K 0020:AA 5F 34 CA 92 B7 31 39 01 40 A1 C3 E2 AE 52 ._4...19.@....R -------------------------------------------------------------------- [20] : <Tx> - 02:40:48.296 -Type : 0x01 (Command) -OpCode : 0xFE3E (GapAdv_create) -Data Length : 0x15 (21) byte(s) Properties : 0x0013 (19) ( GAP_ADV_PROP_CONNECTABLE GAP_ADV_PROP_SCANNABLE GAP_ADV_PROP_LEGACY) IntervalMin : 0x0000A0 (160) IntervalMax : 0x0000A0 (160) PrimaryChMap : 0x07 (7) ( GAP_ADV_CHAN_37 GAP_ADV_CHAN_38 GAP_ADV_CHAN_39) PeerAddrType : 0x00 (0) (PEER_ADDRTYPE_PUBLIC_OR_PUBLIC_ID) PeerAddress : 00:00:00:00:00:00 FilterPolicy : 0x00 (0) ( AdvFilterPolicy Bit Mask Is Not Set) TxPower : 0x7F (127) PrimaryPHY : 0x01 (1) (GAP_ADV_PRIM_PHY_1_MBPS) SecondaryPHY : 0x01 (1) (GAP_ADV_SEC_PHY_1_MBPS) SID : 0x00 (0) Dump(Tx): 0000:01 3E FE 15 13 00 A0 00 00 A0 00 00 07 00 00 00 .>.............. 0010:00 00 00 00 00 7F 01 01 00 ......... -------------------------------------------------------------------- [21] : <Rx> - 02:40:48.323 -Type : 0x04 (Event) -EventCode : 0x00FF (HCI_LE_ExtEvent) -Data Length : 0x07 (7) bytes(s) Event : 0x067F (1663) (GAP_HCI_ExtentionCommandStatus) Status : 0x00 (0) (SUCCESS) OpCode : 0xFE3E (GapAdv_create) DataLength : 0x01 (1) Handle : 0x00 (0) Dump(Rx): 0000:04 FF 07 7F 06 00 3E FE 01 00 ......>... -------------------------------------------------------------------- [22] : <Tx> - 02:40:54.722 -Type : 0x01 (Command) -OpCode : 0xFE3F (GapAdv_enable) -Data Length : 0x04 (4) byte(s) Handle : 0x00 (0) EnableOptions : 0x00 (0) (GAP_ADV_ENABLE_OPTIONS_USE_MAX) DurationMaxEvnt: 0x0000 (0) Dump(Tx): 0000:01 3F FE 04 00 00 00 00 .?...... -------------------------------------------------------------------- [23] : <Rx> - 02:40:54.761 -Type : 0x04 (Event) -EventCode : 0x00FF (HCI_LE_ExtEvent) -Data Length : 0x06 (6) bytes(s) Event : 0x067F (1663) (GAP_HCI_ExtentionCommandStatus) Status : 0x00 (0) (SUCCESS) OpCode : 0xFE3F (GapAdv_enable) DataLength : 0x00 (0) Dump(Rx): 0000:04 FF 06 7F 06 00 3F FE 00 ......?.. -------------------------------------------------------------------- [24] : <Rx> - 02:41:29.332 -Type : 0x04 (Event) -EventCode : 0x00FF (HCI_LE_ExtEvent) -Data Length : 0x14 (20) bytes(s) Event : 0x0605 (1541) (GAP_EstablishLink) Status : 0x00 (0) (SUCCESS) DevAddrType : 0x01 (1) (ADDRTYPE_RANDOM) DevAddr : 51:A8:87:F4:C8:8F ConnHandle : 0x0000 (0) ConnRole : 0x04 (4) ( Peripheral) ConnInterval : 0x0027 (39) ConnLatency : 0x0000 (0) ConnTimeout : 0x01F4 (500) ClockAccuracy : 0x01 (1) Dump(Rx): 0000:04 FF 14 05 06 00 01 8F C8 F4 87 A8 51 00 00 04 ............Q... 0010:27 00 00 00 F4 01 01 '...... -------------------------------------------------------------------- [25] : <Tx> - 02:41:29.336 -Type : 0x01 (Command) -OpCode : 0x2022 (HCI_LE_SetDataLength) -Data Length : 0x06 (6) byte(s) Handle : 0x0000 (0) TxOctets : 0x00FB (251) TxTime : 0x0848 (2120) Dump(Tx): 0000:01 22 20 06 00 00 FB 00 48 08 ." .....H. -------------------------------------------------------------------- [26] : <Info> - 02:41:29.388 Device Connected Handle = 0x0000 Addr Type = 0x01 (ADDRTYPE_RANDOM) BDAddr = 51:A8:87:F4:C8:8F -------------------------------------------------------------------- [27] : <Rx> - 02:41:29.379 -Type : 0x04 (Event) -EventCode : 0x000E (HCI_CommandCompleteEvent) -Data Length : 0x06 (6) bytes(s) Packets : 0x01 (1) OpCode : 0x2022 (HCI_LE_SetDataLength) Status : 0x11 (17) (UNSUPPORTED_FEATURE_PARAM_VALUE) Handle : 0x0000 (0) Dump(Rx): 0000:04 0E 06 01 22 20 11 00 00 ...." ... -------------------------------------------------------------------- [28] : <Rx> - 02:41:29.442 -Type : 0x04 (Event) -EventCode : 0x003E (HCI_LE_GenericReportEvent) -Data Length : 0x0C (12) bytes(s) LE Event Code : 0x04 (4) (HCI_LE_ReadRemoteUsedFeaturesCompleteEvent) LE Event Code : 0x04 (4) (HCI_LE_ReadRemoteUsedFeaturesCompleteEvent) Status : 0x00 (0) (SUCCESS) ConnectionId : 0x0000 (0) Features : 0x00000000000010DF (4319) ( Encryption Connection_Parameters_Request Reject_Extended_Indication Slave_Features_Exchange Ping Privacy Extended_Scanner_Filter_Policies Extended_Advertising) Dump(Rx): 0000:04 3E 0C 04 00 00 00 DF 10 00 00 00 00 00 00 .>............. -------------------------------------------------------------------- [29] : <Rx> - 02:41:29.584 -Type : 0x04 (Event) -EventCode : 0x000E (HCI_CommandCompleteEvent) -Data Length : 0x06 (6) bytes(s) Packets : 0x01 (1) OpCode : 0x2020 (HCI_LE_RemoteConnectionParameterRequestReply) Status : 0x00 (0) (SUCCESS) Handle : 0x0000 (0) Dump(Rx): 0000:04 0E 06 01 20 20 00 00 00 .... ... -------------------------------------------------------------------- [30] : <Rx> - 02:41:30.162 -Type : 0x04 (Event) -EventCode : 0x00FF (HCI_LE_ExtEvent) -Data Length : 0x0B (11) bytes(s) Event : 0x0607 (1543) (GAP_LinkParamUpdate) Status : 0x00 (0) (SUCCESS) ConnHandle : 0x0000 (0) ConnInterval : 0x0006 (6) ConnLatency : 0x0000 (0) ConnTimeout : 0x01F4 (500) Dump(Rx): 0000:04 FF 0B 07 06 00 00 00 06 00 00 00 F4 01 .............. -------------------------------------------------------------------- [31] : <Rx> - 02:41:30.383 -Type : 0x04 (Event) -EventCode : 0x000E (HCI_CommandCompleteEvent) -Data Length : 0x06 (6) bytes(s) Packets : 0x01 (1) OpCode : 0x2020 (HCI_LE_RemoteConnectionParameterRequestReply) Status : 0x00 (0) (SUCCESS) Handle : 0x0000 (0) Dump(Rx): 0000:04 0E 06 01 20 20 00 00 00 .... ... -------------------------------------------------------------------- [32] : <Rx> - 02:41:30.492 -Type : 0x04 (Event) -EventCode : 0x00FF (HCI_LE_ExtEvent) -Data Length : 0x0B (11) bytes(s) Event : 0x0607 (1543) (GAP_LinkParamUpdate) Status : 0x00 (0) (SUCCESS) ConnHandle : 0x0000 (0) ConnInterval : 0x0027 (39) ConnLatency : 0x0000 (0) ConnTimeout : 0x01F4 (500) Dump(Rx): 0000:04 FF 0B 07 06 00 00 00 27 00 00 00 F4 01 ........'..... --------------------------------------------------------------------