出现不识别cpu版本的问题
没加热敏电阻就要将def去掉,加了就不用,不然烧录会有问题
在mde里构建选项里将
HAVE_THERMISTOR
INCLUDE_TEMPERATURE
也可以直接修改apps/applications/earbud/qcc512x_qcc302x/CF376_CF440/earbud.x2p
<property name="DEFS">AV_DEBUG BLUELAB CF376_CF440 DEBUG HAVE_1_BUTTON HAVE_32BIT_DATA_WIDTH HAVE_3_LEDS HAVE_THERMISTOR HYDRA HYDRACORE INCLUDE_AV INCLUDE_C HARGER INCLUDE_DFU INCLUDE_GATT INCLUDE_GATT_BATTERY_SERVER INCLUDE_GATT_GAIA_SERVER INCLUDE_HFP INCLUDE_MICFWD INCLUDE_PROMPTS INCLUDE_SCOFWD INCLUDE_TEMPERATURE INCLUD E_TONES INSTALL_HYDRA_LOG THERMISTOR_ADC=adcsel_led5 THERMISTOR_DATA_FILE=thermistor_lp4549652p3m.h THERMISTOR_ON=THERMISTOR_PIO_UNUSED USE_BDADDR_FOR_LEFT_RIGHT __KALIM BA__</property>
去掉再布署不会出现此问题,
但出现了在布署过程中不识别设备的问题
按住system control复位按键就可以识别id ,erase再烧录了,开发板没有问题,应该硬件问题造成的
但是遇到flash无法识别的问题
再重新拨插再用nvsapp烧录就可以烧录成功
开机后灯没有亮,
默认灯是有3个的,要修改成成一个
将HAVE_3_LEDS改成HAVE_1_LED
然后在mde中执行rebuil,然后deploy一下工程才能用tools->build single flash image file生成xuv烧录文件
调试-打开当前的debug日志:
注意 :debug时的打开的工程要与芯片中烧录的是一样的版本才有打印出来,即左耳对左耳工程 才有打印 ,否则连接不成功,出现类似如下打印
当fw_live_log不见时,在下栏处右键点击就可以出来了,或者恢复默认layout
flash大小配置:
说明当前配置用的flash大小为64Mb即8MB
发现xuv烧录包大小为11MB,但flash只有8MB,说明xuv可能是16进制的,实际大小要除以2即5.5MB,烧录器会解析成真正大小5.5MB
开发板用trbi200不识别的问题,
跳线帽要接1,2
左耳能搜索到右耳目但不能连接对耳
3243.723 apps1: 02C4: appHandleClDmInquireResult, bdaddr 0002,5b,00ff02 rssi -61 cod 240404
3243.942 apps1: 02C5: appHandleClDmInquireResult, bdaddr 0002,5b,00ff02 rssi -62 cod 240404
3244.114 apps1: 02C6: appHandleClDmInquireResult, bdaddr 0002,5b,00ff02 rssi -62 cod 240404
3244.332 apps1: 02C7: appHandleClDmInquireResult, bdaddr 0002,5b,00ff02 rssi -61 cod 240404
3244.660 apps1: 02C8: appHandleClDmInquireResult, bdaddr 0002,5b,00ff02 rssi -61 cod 240404
3245.239 apps1: 02C9: appHandleClDmInquireResult, bdaddr 0002,5b,00ff02 rssi -59 cod 240404
3245.645 apps1: 02CA: appHandleClDmInquireResult, bdaddr 0002,5b,00ff02 rssi -60 cod 240404
3245.817 apps1: 02CB: appHandleClDmInquireResult, bdaddr 0002,5b,00ff02 rssi -60 cod 240404
3246.020 apps1: 02CC: appHandleClDmInquireResult, bdaddr 0002,5b,00ff02 rssi -60 cod 240404
3246.567 apps1: 02CD: appHandleClDmInquireResult, bdaddr 0002,5b,00ff02 rssi -61 cod 240404
3246.614 apps1: 02CE: appHandleClDmInquireResult, bdaddr 0002,5b,00ff02 rssi -60 cod 240404
3246.739 apps1: 02CF: appHandleClDmInquireResult, bdaddr 0002,5b,00ff02 rssi -61 cod 240404
3246.739 apps1: 02D0: appHandleClDmInquireResult, complete, status 0, bdaddr 2,5b,ff02, rssi -52, next_rssi -60
3246.739 apps1: 02D1: appHandleClDmInquireResult, Inquiry error, too many devices nearby or unable to create new instance
3247.380 apps1: 02D2: appHandleClDmInquireResult, bdaddr 0002,5b,00ff02 rssi -62 cod 240404
分析代码发现:
rssi强度规定,扫描问题,由此可知要修改频偏
有一个需求设置io唤醒
则需要在进入 dormant(睡眠)前设备一下唤醒的io口
pio1
DormantConfigure(PIO_WAKE_MASK, 0x2); 用这个接口设置
加到-appPowerEnterDormantMode里面//自己猜的
appPowerEnterDormantMode(TRUE);就可以进入休眠了
需要再什么情况下需要进入休眠模式,调用这个接口就可以了
延时发送消息
MessageSendLater
如:
#define appGetPhyState() (&globalApp.phy_state)
phyStateTaskData* phy_state = appGetPhyState();
phy_state->task.handler = appPhyStateHandleMessage;
其中每个场景与模块都有对应的handler消息实现
appPhyStateHandleMessage中添加case 的枚举及定义与实现:
PHY_STATE_INTERNAL_NOT_IN_VNCL3020
在需要的地方发送命令:
MessageSendLater(task, PHY_STATE_INTERNAL_NOT_IN_VNCL3020, NULL,50/50ms/);
取消此task所有未执行的特定message id的任务
MessageCancelAll();
开机后的对耳广播:
刷机完后开机:左耳搜索到右耳
整个过程的日志:
https://download.csdn.net/download/u010481276/11237768
1002.406 apps1: 008F: appHandleClDmInquireResult, complete, status 0, bdaddr 0,0,0, rssi -60, next_rssi -60
1008.815 apps1: 0090: appHandleClDmInquireResult, complete, status 0, bdaddr 0,0,0, rssi -60, next_rssi -60
1012.712 apps1: 0091: appHandleClDmInquireResult, bdaddr 0002,5b,00ff02 rssi -39 cod 240404
1012.912 apps1: 0092: appHandleClDmInquireResult, bdaddr 0002,5b,00ff02 rssi -40 cod 240404
1013.343 apps1: 0093: appHandleClDmInquireResult, bdaddr 0002,5b,00ff02 rssi -36 cod 240404
1013.985 apps1: 0094: appHandleClDmInquireResult, bdaddr 0002,5b,00ff02 rssi -38 cod 240404
1014.365 apps1: 0095: appHandleClDmInquireResult, bdaddr 0002,5b,00ff02 rssi -39 cod 240404
1014.867 apps1: 0096: appHandleClDmInquireResult, bdaddr 0002,5b,00ff02 rssi -38 cod 240404
1015.223 apps1: 0097: appHandleClDmInquireResult, complete, status 0, bdaddr 2,5b,ff02, rssi -36, next_rssi -60
配对连接成功:
1015.286 apps1: 009E: appConManagerHandleClDmAclOpenedIndication, status 0, incoming 0, 2,5b,ff02[0] Flags:0
1015.289 apps1: 009F: appConManagerHandleClDmAclOpenedIndication, peer or unknown
1015.289 apps1: 00A0: appConManagerSetDeviceState, device 2,5b,ff02, state 1, lock 0
1015.289 apps1: 00A1: appSmHandleConManagerConnectionInd connected:1
1015.289 apps1: 00A2: appDeviceHandleConManagerConnectionInd UNKNOWN BREDR ff02 CONN:1 Status:0
左耳开机进入对耳连接模式(已配对过且右耳未开机)
日志:https://download.csdn.net/download/u010481276/11237869
开机即连接失败:
.126 apps1: 04DE: appLinkPolicyUpdatePowerTable for peer, index=6, prev=0
2291.126 apps1: 04DF: appConManagerHandleClDmAclClosedIndication, status 8, 2,5b,ff02
2291.126 apps1: 04E0: appConManagerSetDeviceState, device 2,5b,ff02, state 4, lock 0
state=4:
表断线,即设备没有信号造成,失败原因,time out
2291.363 apps1: 04F4: appDeviceHandleConManagerConnectionInd PEER CONN:0 Status:8
2291.363 apps1: 04F5: appPeerSigHandleAvAvrcpDisconnectInd, status 9, state 5
2291.363 apps1: 04F6: appPeerSigHandleAvAvrcpDisconnectInd, link-loss
进入page scan模式
--.--- apps1: 042F: appPeerSigHandleInternalStartupRequest, ACL not connected, attempt to open ACL
----.--- apps1: 0430: appConManagerCreateAclImpl, link-loss device, increasing page timeout to 7680 ms
----.--- apps1: 0431: appConManagerSetDeviceState, device 2,5b,ff02, state 3, lock 0
----.--- apps1: 0432: appConManagerSetDeviceState, device 2,5b,ff02, state 8, lock 8
----.--- apps1: 0433: appConManagerCreateAclImpl, 2,5b,ff02, create device, state 8, lock 8, users 1
----.--- apps1: 0434: appPeerSigSetState, state 12
----.--- apps1: 0435: appPeerSigExitDisconnected
----.--- apps1: 0436: SCANMAN Disable Page Scan, user 4
----.--- apps1: 0437: appPeerSigEnterConnectingAcl
----.--- apps1: 0438: appPeerSyncHandleConnRulesNop
----.--- apps1: 0439: appSmHandleConnRulesPageScanUpdate enable:1//进入扫描
----.--- apps1: 043A: SCANMAN Enable Page Scan, user 2 type 1
----.--- apps1: 043B: appUpgradeAllowUpgrades(0) - success:1 (sts:0)
----.--- apps1: 043C: KYMERA_OP_MSG_ID_TONE_END
----.--- apps1: 043D: appKymeraTonePromptStop, state 9
----.--- apps1: 043E: appKymeraSetState, state 9 -> 0
----.--- apps1: 043F: appConManagerHandleClDmAclOpenedIndication, status 4, incoming 0, 2,5b,ff02[0] Flags:0
----.--- apps1: 0440: appConManagerSetDeviceState, device 2,5b,ff02, state 3, lock 0
----.--- apps1: 0441: appPeerSigHandleInternalStartupRequest, state 18, bdaddr 0002,5b,00ff02
----.--- apps1: 0442: appPeerSigHandleInternalStartupRequest, ACL failed to open, giving up
----.--- apps1: 0443: appPeerSigSetState, state 1
----.--- apps1: 0444: appPeerSigExitConnectingAcl
----.--- apps1: 0445: appPeerSigEnterDisconnected
----.--- apps1: 0446: SCANMAN Enable Page Scan, user 4 type 1
----.--- apps1: 0447: appPeerSigHandleInternalMsgChannelTxRequest, state 1 chan 2 size 15
----.--- apps1: 0448: appPeerSyncHandlePeerSigMsgChannelTxCfm, failed, status 6
----.--- apps1: 0449: appSmHandlePeerSyncStatus 0
低周期的page
typedef enum
{
/*! Undefined parameter type. */
SCAN_MAN_PARAMS_TYPE_NOT_SET = 0,
/*! Slow parameters type, lower duty cycle. */
SCAN_MAN_PARAMS_TYPE_SLOW = 1,
/*! Fast parameters type, higher duty cycle. */
SCAN_MAN_PARAMS_TYPE_FAST = 2
} scanParamsType;
右耳打开后发送连接请求,左耳收到连接请求后建立连接
3244.472 apps1: 0117: appConManagerHandleClDmAclOpenedIndication, status 0, incoming 1, 2,5b,ff02[0] Flags:1
3244.472 apps1: 0118: appConManagerHandleClDmAclOpenedIndication, peer or unknown
3244.472 apps1: 0119: appConManagerSetDeviceState, device 2,5b,ff02, state 1, lock 0
3244.477 apps1: 011A: appSmHandleConManagerConnectionInd connected:1
3244.477 apps1: 011B: appDeviceHandleConManagerConnectionInd PEER CONN:1 Status:0
3244.477 apps1: 011C: appSmHandleInternalBredrConnected
appConnectionInit in av_headset_init.c (apps\applications\earbud) : ConnectionInitEx3(appGetAppTask(), &filter, appConfigMaxPairedDevices(), CONNLIB_OPTIONS_SC_ENABLE);
appConnectionInit in av_headset_init.c (apps\applications\earbud) : ConnectionInitEx3(appGetAppTask(), &filter, appConfigMaxPairedDevices(), CONNLIB_OPTIONS_NONE);
ConnectionInit in init.c (apps\libs\connection) : ConnectionInitEx3(theAppTask, &defaultMsgFilter , DEFAULT_NO_DEVICES_TO_MANAGE , CONNLIB_OPTIONS_NONE );
void ConnectionInitEx3==〉
theCm.task.handler = connectionBluestackHandler;
connectionBluestackHandler
case MESSAGE_BLUESTACK_DM_PRIM:
connectionBluestackHandlerDm(theCm, (const DM_UPRIM_T )message);
===〉
connectionBluestackHandlerDm
case DM_HCI_INQUIRY_RESULT_IND: / 1060 */
PRINT((“DM_HCI_INQUIRY_RESULT_IND\n”));
connectionHandleInquiryResult
connectionHandleExtendedInquiryResult/connectionHandleInquiryResult
inquirySendResult-》CL_DM_INQUIRE_RESULT->
static void appPairingHandleMessage(Task task, MessageId id, Message message)
case CL_DM_INQUIRE_RESULT:
appHandleClDmInquireResult(thePairing, (CL_DM_INQUIRE_RESULT_T *)message);
在上面调试i2c设备
采用vncl3020.c模块进行调试,在def打开以下两个宏
#ifdef INCLUDE_PROXIMITY
#ifdef HAVE_VNCL3020
并在 av_headset_config.c中添加pio的定义
#define PROXIMITY_PIO_ON 255
#define PROXIMITY_PIO_I2C_SCL 20
#define PROXIMITY_PIO_I2C_SDA 21
#define PROXIMITY_PIO_INT 2
后来发现在读i2c设备中的读返回的值老是为0,看了一下时序也没有找出是什么问题,用逻辑分析仪看了也有ack
结果认真分析了一下所抓取的i2c时序,发现读操作是发送寄存器地址后直接stop了,应该restart的
看了下adxl362的代码发现一个flags可以修改,所发送命令的代码改过来,就可以了
检测也查到中间没有stop,变成restart了,可以读到i2c设备的chipid了
这里开发gsensor发现来了一次中断后,第二次就没有触发,在中断状态寄存器清空了也没有效果 ,中断线也不会处理idle状态,一直是active状态,这里的解决方案是处理一段时间后再去读中断状态寄存器清空,由于还不知道delay函数,我这边一直在中断isr做for动作1000000次,之后就有效果
中间如果有通讯失败会导致系统跑不下去,如这里的i2c地址是错的会导致系统跑不下去
工程编译库的方法
怎样将特定文件编译成so,及引用so的方法,主要是需要集成算法库,供应商需要在我们的环境上编译,并release一个so给我们开发
直接在工程中添加你的源代码:
编译之后会在下面路径生成文件
在下面路径生成.a(而非so,不过也可以,因为我没有看到有动态库的生成文件)
编译生成之后通过上面的添加目录的方法配置将之前加的文件从工程中移除,将你的文件目录处里面打勾的取消掉就可以,我这里仍没有效果出现编译中还存在文件,于是我就是手动修改的方法修改libs_qcc512x_qcc302x.x2p配置 文件
然后在需要的地方引用头文件,并进行开发,并配置 一下工程新添加库 的路径
调试EQ
从官网下载qact,我这边的版本号是7.2.8
因为是earbud工程,用如下方法修改才可以连接显示eq项
a) chain_output_volume.chain:
<operator name="OPR_VOLUME_CONTROL" id="CAP_ID_VOL_CTRL_VOL">
<sink name="MAIN_IN" terminal="0"/>
<sink name="AUX_IN" terminal="1"/>
<source name="OUT" terminal="0"/>
</operator>
/*修改*/
<operator name="OPR_PEQ" id="CAP_ID_PEQ">
<sink name="IN" terminal="0"/>
<source name="OUT" terminal="0"/>
</operator>
<input sink="OPR_LATENCY_BUFFER.IN" role="EPR_SINK_MIXER_MAIN_IN"/>
<input sink="OPR_VOLUME_CONTROL.AUX_IN" role="EPR_VOLUME_AUX"/>
<connection source="OPR_LATENCY_BUFFER.OUT" sink="OPR_SOURCE_SYNC.IN"/>
<connection source="OPR_SOURCE_SYNC.OUT" sink ="OPR_PEQ.IN"/>
<connection source="OPR_PEQ.OUT" sink="OPR_VOLUME_CONTROL.MAIN_IN"/>
<output source="OPR_VOLUME_CONTROL.OUT" role="EPR_SOURCE_MIXER_OUT"/>
/*修改*/
</chain>
b) av_headset_chain_roles.h
/*! Tone generator */
OPR_TONE_GEN,
/* 修改*/
OPR_PEQ,
/* 修改 */
/*! Prompt decoder */
OPR_PROMPT_DECODER,
} chain_operator_role_t;
c) av_headset_kymera_common.c
void appKymeraConfigureOutputChainOperators(kymera_chain_handle_t chain,
uint32 sample_rate, unsigned kick_period,
unsigned buffer_size, uint8 volume)
{
Operator sync_op;
Operator volume_op;
/* 修改*/
Operator peq_op;
/* 修改 */
/* Configure operators */
if (GET_OP_FROM_CHAIN(sync_op, chain, OPR_SOURCE_SYNC))
{
/* SourceSync is optional in chains. */
appKymeraConfigureSourceSync(sync_op, sample_rate, kick_period);
}
volume_op = ChainGetOperatorByRole(chain, OPR_VOLUME_CONTROL);
OperatorsStandardSetSampleRate(volume_op, sample_rate);
/* 修改 */
peq_op = ChainGetOperatorByRole(chain, OPR_PEQ);
if(peq_op!=INVALID_OPERATOR)
{
OperatorsStandardSetUCID(peq_op, 0x00);
OperatorsStandardSetSampleRate(peq_op, sample_rate);
}
/* 修改 */
appKymeraSetVolume(chain, volume);
if (buffer_size)
{
Operator op = ChainGetOperatorByRole(chain, OPR_LATENCY_BUFFER);
OperatorsStandardSetBufferSize(op, buffer_size);
}
修改后烧录连接识别EQ,两个耳机(左右两个)烧录的img都要有上面的修改,才可以有效果,这里我走了弯路
打开软件进行如下设置:
注意上面点连接时,与耳机一定要连接着,并播放音乐,否则连不成功,连接成功后效果如下,
接下来简单介绍一下 EQ 调试的参数内容,需要注意的是,在 Generic View 调试完
的参数,需要点一下页面下方的 Set Data 再点击 Get Data,在 EQ View 页面的模
块才能看到修改后的参数
在上一步中截图介绍的 STAGE_TYPE 请参考下图配置,0 对应的 BYPASS,13 对应
PEQ
调完之后的参数,需要导出 htf 文件,再把 htf 文件中的参数写入到程序中才能正
常工作,否则断电后或者重新烧录工程后就失效了;在保存参数的时候,建议只保
存修改的内容
打开该 htf 文件,就可以看到刚才保存的修改后的配置参数了;把这些参数都添加
到工程中 user_ps_filesystem 下的 subsys7_psflash.htf(earbud)中(该 htf 文件默
认内容为空,只有一句 file=app1,所以直接覆盖没有问题),rebuild and deploy 即
可正常使用,也可以使用 deploy(skip dependencies)这样就可以直接烧录板子
射频天线配置
TWS\apps\applications\earbud\qcc512x_qcc302x\common\subsys0_config3.htf
这些值对应开发板上的丝印信息:
80-ch016-1_aa_adk_6.3.x_earbuds_application_user_guide.pdf
左右耳是通过mac地址来区分的,由最低有效位(最低位)是否置1来确定是左(置)还是右(未置)
配置地方在
TWS\apps\applications\earbud\qcc512x_qcc302x\common\subsys1_config2.htf
奇为左耳
偶为右耳
更新参数,如蓝牙名,mac地址
使用bluesuite的configcmd工具进行操作
1、 确认system版本:
打开CMD,到C:\Program Files (x86)\QTIL\BlueSuite 3.1.3下,运行 ConfigCmd工具,读取system版本信息
例如:
C:\Program Files (x86)\QTIL\BlueSuite 3.1.3>
configcmd systems -database hyd.sdb
得出system版本信息,例如本范例中,为CSRA68100_CONFIG:
2、 导出的指令为以下(trb接口指令和system版本指令为必须,htf存储路径默认为bluesuite目录,本范例中system版本信息为CSRA68100_CONFIG):
例:C:\Program Files (x86)\QTIL\BlueSuite 3.1.3>
configcmd dev2txt config.htf -trb 1 -system CSRA68100_CONFIG
可修改config.htf里的参数写入后
重新上电就可以
3、 写入htf参数
依然使用configcmd工具,用txt2dev指令进行htf参数的导入
例:C:\Program Files (x86)\QTIL\BlueSuite 3.1.3>
configcmd txt2dev config.htf replace -trb 1 -system CSRA68100_CONFIG

uart功能
蓝线是软件sscom5.13.1.exe发送时的显示,不是数字本身,纠结了一段时间
以下是串口的自收自发功能
Subject: [PATCH] [UART] add uart function
---
TWS/apps/applications/earbud/main.c | 9 +-
TWS/apps/applications/earbud/peripherals/pio_if.h | 149 +++++++++++++++++++++
TWS/apps/applications/earbud/peripherals/uart.c | 85 ++++++++++++
TWS/apps/applications/earbud/peripherals/uart.h | 26 ++++
TWS/apps/applications/earbud/peripherals/uart_if.h | 56 ++++++++
.../earbud/qcc512x_qcc302x/CF376_CF440/earbud.x2p | 4 +
6 files changed, 326 insertions(+), 3 deletions(-)
create mode 100644 TWS/apps/applications/earbud/peripherals/pio_if.h
create mode 100644 TWS/apps/applications/earbud/peripherals/uart.c
create mode 100644 TWS/apps/applications/earbud/peripherals/uart.h
create mode 100644 TWS/apps/applications/earbud/peripherals/uart_if.h
diff --git a/TWS/apps/applications/earbud/main.c b/TWS/apps/applications/earbud/main.c
index 71d4fa1..d021188 100644
--- a/TWS/apps/applications/earbud/main.c
+++ b/TWS/apps/applications/earbud/main.c
@@ -26,8 +26,9 @@
#include "av_headset_pairing.h"
#include "av_headset_scan_manager.h"
#include "av_headset_anc_tuning.h"
-
-
+#ifdef HAVE_UART
+#include "peripherals/uart.h"
+#endif
/*! Application data structure */
appTaskData globalApp;
@@ -178,7 +179,9 @@ int main(void)
/* Start the application module and library initialisation sequence */
appInit();
-
+ #ifdef HAVE_UART
+ uart_data_stream_init();/*add by zhongyukang*/
+ #endif
/* Start the message scheduler loop */
MessageLoop();
diff --git a/TWS/apps/applications/earbud/peripherals/pio_if.h b/TWS/apps/applications/earbud/peripherals/pio_if.h
new file mode 100644
index 0000000..2980ab7
--- /dev/null
+++ b/TWS/apps/applications/earbud/peripherals/pio_if.h
@@ -0,0 +1,149 @@
+/* Copyright (c) 2016 Qualcomm Technologies International, Ltd. */
+/* Part of 6.3.2 */
+/****************************************************************************
+FILE
+ pio_if.h
+
+CONTAINS
+ Definitions for the pio subsystem.
+
+DESCRIPTION
+ This file is seen by the stack, and VM applications, and
+ contains things that are common between them.
+*/
+
+#ifndef __PIO_IF_H__
+#define __PIO_IF_H__
+
+/*! @brief Functions which can be mapped onto a pin. This is used in PioSetFunction().
+ * The user must consult the relevant device datasheet for possible mappings
+ */
+typedef enum
+{
+ /** UART data input */
+ UART_RX,
+ /** UART data output */
+ UART_TX,
+ /** UART "ready to send" output */
+ UART_RTS,
+ /** UART "clear to send" input */
+ UART_CTS,
+ PCM_IN,
+ PCM_OUT,
+ PCM_SYNC,
+ PCM_CLK,
+ SQIF,
+/**
+ * Associates a PIO to a LED ID.
+ *
+ * Each chip maps a set of PIOs to a specific LED controller instance. This
+ * means a given PIO can only be associated to a particular led controller
+ * instance.
+ * The allowed configuration is specific to the chip.
+ *
+ * CSRA68100:
+ * There are 12 disjoint sets of PIOs. The PIOs from each set E.g.:
+ *
+ * led_ctrl_instance_0 = { pio | pio in {0, 12, 24, 36, 48, 60, 72, 84 }}
+ * led_ctrl_instance_1 = { pio | pio in {1, 13, 25, 37, 49, 61, 73, 85 }}
+ * ...
+ * led_ctrl_instance_11 = { pio | pio in {11, 23, 35, 47, 59, 71, 83, 95 }}
+ *
+ * The led controller instances are statically mapped to led_ids so that the
+ * led_id maps to the led pad with the same index. E.g.:
+ *
+ * +========+===========+===========+============================+
+ * | led_id | ctrl inst | LED PADS | all PIOs |
+ * +========+===========+===========+============================+
+ * | 0 | 5 | 65 (0) | 5 17 29 41 53 65 77 89 |
+ * | 1 | 6 | 66 (1) | 6 18 30 42 54 66 78 90 |
+ * | 2 | 7 | 67 (2) | 7 19 31 43 55 67 79 91 |
+ * | 3 | 8 | 68 (3) | 8 20 32 44 56 68 80 92 |
+ * | 4 | 9 | 69 (4) | 9 21 33 45 57 69 81 93 |
+ * | 5 | 10 | 70 (5) | 10 22 34 46 58 70 82 94 |
+ * | 6 | 11 | 71 (6) | 11 23 35 47 59 71 83 95 |
+ * | 7 | 0 | 72 (7) | 0 12 24 36 48 60 72 84 |
+ * | 8 | 1 | 73 (N/A) | 1 13 25 37 49 61 73 85 |
+ * | 9 | 2 | 74 (N/A) | 2 14 26 38 50 62 74 86 |
+ * | 10 | 3 | 75 (N/A) | 3 15 27 39 51 63 75 87 |
+ * | 11 | 4 | 76 (N/A) | 4 16 28 40 52 64 76 88 |
+ * +--------+-----------+-----------+----------------------------+
+ *
+ * QCC512x/QCC302x:
+ * There are 6 disjoint sets of PIOs. The PIOs from each set E.g.:
+ *
+ * led_ctrl_instance_0 =
+ { pio | pio in { 0, 6, 12, 18, 24, 30, 36, 42, 48, 54, 60, 66 }}
+ * led_ctrl_instance_1 =
+ { pio | pio in { 1, 7, 13, 19, 25, 31, 37, 43, 49, 55, 61, 67 }}
+ * led_ctrl_instance_2 =
+ { pio | pio in { 2, 8, 14, 20, 26, 32, 38, 44, 50, 56, 62, 68 }}
+ ...
+ * led_ctrl_instance_5 =
+ { pio | pio in { 5, 11, 17, 23, 29, 35, 41, 47, 53, 59, 65, 71 }}
+ *
+ * The led controller instances are statically mapped to led_ids so that the
+ * led_id maps to the led pad with the same index. E.g.:
+ *
+ * +========+===========+==========+=====================================+
+ * | led_id | ctrl inst | LED PADS | all PIOs |
+ * +========+===========+==========+=====================================+
+ * | 0 | 0 | 66 (0) | 0 6 12 18 24 30 36 42 48 54 60 66 |
+ * | 1 | 1 | 67 (1) | 1 7 13 19 25 31 37 43 49 55 61 67 |
+ * | 2 | 2 | 68 (2) | 2 8 14 20 26 32 38 44 50 56 62 68 |
+ * | 3 | 3 | 69 (3) | 3 9 15 21 27 33 39 45 51 57 63 69 |
+ * | 4 | 4 | 70 (4) | 4 10 16 22 28 34 40 46 52 58 64 70 |
+ * | 5 | 5 | 71 (5) | 5 11 17 23 29 35 41 47 53 59 65 71 |
+ * +--------+-----------+----------+-------------------------------------+
+ */
+ LED,
+ LCD_SEGMENT,
+ LCD_COMMON,
+ PIO,
+ SPDIF_RX,
+ SPDIF_TX,
+ /** Bitserial 0, clock input used in SPI slave and I2C */
+ BITSERIAL_0_CLOCK_IN,
+ /** Bitserial 0, clock output used in SPI master and I2C */
+ BITSERIAL_0_CLOCK_OUT,
+ /** Bitserial 0, data input used for SPI master MISO, SPI slave MOSI and I2C */
+ BITSERIAL_0_DATA_IN,
+ /** Bitserial 0, data output used for SPI master MOSI, SPI slave MISO and I2C */
+ BITSERIAL_0_DATA_OUT,
+ /** Bitserial 0, chip select input used for SPI slave */
+ BITSERIAL_0_SEL_IN,
+ /** Bitserial 0, chip select output used for SPI master */
+ BITSERIAL_0_SEL_OUT,
+ /** Bitserial 1, clock input used in SPI slave and I2C */
+ BITSERIAL_1_CLOCK_IN,
+ /** Bitserial 1, clock output used in SPI master and I2C */
+ BITSERIAL_1_CLOCK_OUT,
+ /** Bitserial 1, data input used for SPI master MISO, SPI slave MOSI and I2C */
+ BITSERIAL_1_DATA_IN,
+ /** Bitserial 1, data output used for SPI master MOSI, SPI slave MISO and I2C */
+ BITSERIAL_1_DATA_OUT,
+ /** Bitserial 1, chip select input used for SPI slave */
+ BITSERIAL_1_SEL_IN,
+ /** Bitserial 1, chip select output used for SPI master */
+ BITSERIAL_1_SEL_OUT,
+ /** Sets an XIO or an LED pin to analogue mode for ADC use (LED pins are
+ set by the Curator during the measurement) */
+ ANALOGUE,
+ /** Associates a PIO to something outside of Apps control. */
+ OTHER
+} pin_function_id;
+
+/*! @brief Drive strength IDs which can be set for a pin. This is used in
+ * PioSetDriveStrength() and PioGetDriveStrength().
+ * The user must consult the relevant device datasheet for supported drive
+ * strength IDs and their meaning on each pin.
+ */
+typedef enum
+{
+ DRIVE_STRENGTH_ID0 = 0,
+ DRIVE_STRENGTH_ID1,
+ DRIVE_STRENGTH_ID2,
+ DRIVE_STRENGTH_ID3
+} pin_drive_strength_id;
+
+#endif /* __PIO_IF_H__ */
diff --git a/TWS/apps/applications/earbud/peripherals/uart.c b/TWS/apps/applications/earbud/peripherals/uart.c
new file mode 100644
index 0000000..2622592
--- /dev/null
+++ b/TWS/apps/applications/earbud/peripherals/uart.c
@@ -0,0 +1,85 @@
+#ifdef HAVE_UART
+#include "uart.h"
+UARTStreamTaskData theUARTStreamTask;
+static void UARTStreamMessageHandler(Task ppTask,MessageId pId,Message pMessage);
+static void uart_data_stream_rx_data(Source src);
+static void uart_data_stream_tx_data(const uint8*data,uint16 length);
+/*UART*/
+void uart_data_stream_init(void)
+{
+ /*set pio to uart function*/
+ PioSetMapPins32Bank(UART_TX_BANK,UART_TX_MASK,0);
+ PioSetMapPins32Bank(UART_RX_BANK,UART_RX_MASK,0);
+
+ PioSetFunction(PIO_UART_TX,UART_TX);
+ PioSetFunction(PIO_UART_RX,UART_RX);
+
+ /*Assigntaskmessagehandler*/
+ theUARTStreamTask.task.handler=UARTStreamMessageHandler;
+ /*Configureuartsettings*/
+ StreamUartConfigure(VM_UART_RATE_38K4,VM_UART_STOP_ONE,VM_UART_PARITY_NONE);
+ /*Getthesinkfortheuart*/
+ theUARTStreamTask.uart_sink=StreamUartSink();
+ PanicNull(theUARTStreamTask.uart_sink);
+ /*Getthesourcefortheuart*/
+ theUARTStreamTask.uart_source=StreamUartSource();
+ PanicNull(theUARTStreamTask.uart_source);
+ /*Registeruartsourcewithtask*/
+ VmalMessageSinkTask(StreamSinkFromSource(theUARTStreamTask.uart_source),
+ &theUARTStreamTask.task);
+}
+void uart_data_stream_tx_data(const uint8*data,uint16 length)
+{
+ uint16 offset=0;
+ uint8*dest=NULL;
+ /*Claimspaceinthesink,gettingtheoffsettoit*/
+ DEBUG_LOG("uart_data_stream_rx_data reg:0x%x 0x%x 0x%x +++",data[0],data[1],data[2]);
+
+ offset=SinkClaim(theUARTStreamTask.uart_sink,length);
+ if(offset==0xFFFF)Panic();
+ /*Mapthesinkintomemoryspace*/
+ dest=SinkMap(theUARTStreamTask.uart_sink);
+ PanicNull(dest);
+ /*Copydataintotheclaimedspace*/
+ memcpy(dest+offset,data,length);
+ /*Flushthedataouttotheuart*/
+ PanicZero(SinkFlush(theUARTStreamTask.uart_sink,length));
+ DEBUG_LOG("uart_data_stream_rx_data reg:0x%x 0x%x 0x%x ---",data[0],data[1],data[2]);
+
+}
+void uart_data_stream_rx_data(Source src)
+{
+ uint16 length=0;
+ const uint8*data=NULL;
+ /*Getthenumberofbytesinthespecifiedsourcebeforethenextpacket
+ boundary*/
+ if(!(length=SourceBoundary(src)))
+ return;
+ /*Mapsthespecifiedsourceintotheaddressmap*/
+ data=SourceMap(src);
+ PanicNull((void*)data);
+ DEBUG_LOG("uart_data_stream_rx_data reg:0x%x 0x%x 0x%x",data[0],data[1],data[2]);
+ /*Transmitthereceiveddata*/
+ uart_data_stream_tx_data(data,length);
+ /*Discardsthespecifiedamountofbytesfromthefrontofthespecified
+ source*/
+ SourceDrop(src,length);
+}
+void UARTStreamMessageHandler(Task ppTask,MessageId pId,Message pMessage)
+{
+ UNUSED(ppTask);
+ DEBUG_LOG("UARTStreamMessageHandler reg pId 0x%x",pId);
+
+ switch(pId)
+ {
+ case MESSAGE_MORE_DATA:
+ uart_data_stream_rx_data(((MessageMoreData*)pMessage)->source);
+ break;
+ // case MESSAGE_MORE_SPACE:
+ // uart_data_stream_rx_data(((MessageMoreData*)pMessage)->source);
+ // break;
+ default:
+ break;
+ }
+}
+#endif
diff --git a/TWS/apps/applications/earbud/peripherals/uart.h b/TWS/apps/applications/earbud/peripherals/uart.h
new file mode 100644
index 0000000..12d33c9
--- /dev/null
+++ b/TWS/apps/applications/earbud/peripherals/uart.h
@@ -0,0 +1,26 @@
+#ifdef HAVE_UART
+/*UART*/
+#include"uart_if.h"
+#include"pio_if.h"
+#include<vmal.h>
+#include<stream.h>
+#include<panic.h>
+#include<sink.h>
+#include<source.h>
+#include<pio.h>
+#include "../av_headset_log.h"
+/*UART*/
+#define PIO_UART_TX (17)//(PIO17)
+#define PIO_UART_RX (18)//(PIO18)
+#define UART_TX_BANK (PIO_UART_TX>>5)//(0)
+#define UART_RX_BANK (PIO_UART_RX>>5)//(0)
+#define UART_TX_MASK (1UL<<(PIO_UART_TX&31))//(0x20000)
+#define UART_RX_MASK (1UL<<(PIO_UART_RX&31))//(0x40000)
+typedef struct
+{
+TaskData task;
+Sink uart_sink;
+Source uart_source;
+}UARTStreamTaskData;
+extern void uart_data_stream_init(void);
+#endif
diff --git a/TWS/apps/applications/earbud/peripherals/uart_if.h b/TWS/apps/applications/earbud/peripherals/uart_if.h
new file mode 100644
index 0000000..9c716eb
--- /dev/null
+++ b/TWS/apps/applications/earbud/peripherals/uart_if.h
@@ -0,0 +1,56 @@
+/* Copyright (c) 2016 Qualcomm Technologies International, Ltd. */
+/* Part of 6.3.2 */
+/****************************************************************************
+FILE
+ uart_if.h - HID interface
+
+CONTAINS
+ The global definitions needed for configuring the UART
+
+DESCRIPTION
+ This file is seen by the stack, and VM applications, and
+ contains things that are common between them.
+*/
+
+#ifndef __APP_UART_IF_H__
+#define __APP_UART_IF_H__
+
+/*!
+ @brief The UART baud rate.
+*/
+typedef enum
+{
+ VM_UART_RATE_SAME = 0, /*!< The same.*/
+ VM_UART_RATE_9K6 = 39, /*!< 9600 baud.*/
+ VM_UART_RATE_19K2 = 79, /*!< 19200 baud.*/
+ VM_UART_RATE_38K4 = 157, /*!< 38400 baud.*/
+ VM_UART_RATE_57K6 = 236, /*!< 57600 baud.*/
+ VM_UART_RATE_115K2 = 472, /*!< 115200 baud.*/
+ VM_UART_RATE_230K4 = 944, /*!< 230400 baud.*/
+ VM_UART_RATE_460K8 = 1887, /*!< 460800 baud.*/
+ VM_UART_RATE_921K6 = 3775, /*!< 921600 baud.*/
+ VM_UART_RATE_1382K4 = 5662 /*!< 1382400 baud.*/
+} vm_uart_rate;
+
+/*!
+ @brief The number of stop bits.
+*/
+typedef enum
+{
+ VM_UART_STOP_ONE, /*!< One. */
+ VM_UART_STOP_TWO, /*!< Two. */
+ VM_UART_STOP_SAME /*!< The same. */
+} vm_uart_stop;
+
+/*!
+ @brief The parity to use.
+*/
+typedef enum
+{
+ VM_UART_PARITY_NONE, /*!< None.*/
+ VM_UART_PARITY_ODD, /*!< Odd. */
+ VM_UART_PARITY_EVEN, /*!< Even. */
+ VM_UART_PARITY_SAME /*!< The same. */
+} vm_uart_parity;
+
+#endif
diff --git a/TWS/apps/applications/earbud/qcc512x_qcc302x/CF376_CF440/earbud.x2p b/TWS/apps/applications/earbud/qcc512x_qcc302x/CF376_CF440/earbud.x2p
index ed8ca16..70fb22c 100644
--- a/TWS/apps/applications/earbud/qcc512x_qcc302x/CF376_CF440/earbud.x2p
+++ b/TWS/apps/applications/earbud/qcc512x_qcc302x/CF376_CF440/earbud.x2p
@@ -161,10 +161,14 @@
<file path="../../peripherals/SL_SC7A20_CLICK.h"/>
<file path="../../peripherals/adxl362.c"/>
<file path="../../peripherals/adxl362.h"/>
+ <file path="../../peripherals/pio_if.h"/>
<file path="../../peripherals/thermistor.c"/>
<file path="../../peripherals/thermistor.h"/>
<file path="../../peripherals/thermistor_lp4549652p3m.h"/>
<file path="../../peripherals/thermistor_ncp15xh103.h"/>
+ <file path="../../peripherals/uart.c"/>
+ <file path="../../peripherals/uart.h"/>
+ <file path="../../peripherals/uart_if.h"/>
<file path="../../peripherals/vncl3020.c"/>
<file path="../../peripherals/vncl3020.h"/>
</project>
--
2.14.1.windows.1
UART添加遇到的问题总结:
编译中会遇到如下错误
1、
分析问题是无法打开头文件,将对应的.h文件放入TWS/apps/applications/earbud/peripherals/路径下,并在工程中添加
2、
请在函数中定义,如“红色”框所示
硬件连接示意图:
下图PIO17(TX) 接 USB转串口的RX, PIO18(RX)接USB转串口的TX
之前一直调试不成功,要么就是发不成功,要么收的数据有问题,发现和串口有关系,换了如下串口就没有问题了

支持BLE
1、进入 ”av_headset_config.h“,找到下面行,改为 TRUE
#define appConfigBleAllowedOutOfCase() (FALSE)
2、找到下面行,改为 TRUE
#define appConfigBleNewConnectionsWhenBusy() (FALSE)
3、重新编译下载,即可通过 GAIA Control APP 连接 BLE
在官网下载如下sdk编译,安装,
红色为android
安装后,连接ble后为,此时的mac地址是随机地址
电量 比
打开sdk带的心率功能
编译时需要配置INCLUDE_GATT_HR_SERVER
(全程修改参考gatt battery service )
研读了大神的blog
Subject: [PATCH 1/2] add heart rate function
---
TWS/apps/applications/earbud/av_headset.h | 6 ++++++
TWS/apps/applications/earbud/av_headset_config.h | 4 ++--
TWS/apps/applications/earbud/av_headset_db.db | 3 +++
TWS/apps/applications/earbud/av_headset_gatt.c | 7 ++++++-
TWS/apps/applications/earbud/av_headset_gatt.h | 6 +++++-
.../applications/earbud/qcc512x_qcc302x/CF376_CF440/earbud.x2p | 4 ++--
TWS/apps/libs/gatt_heart_rate_server/gatt_heart_rate_server_db.dbi | 2 +-
7 files changed, 25 insertions(+), 7 deletions(-)
diff --git a/TWS/apps/applications/earbud/av_headset.h b/TWS/apps/applications/earbud/av_headset.h
index 317c6cf..de2ce49 100644
--- a/TWS/apps/applications/earbud/av_headset.h
+++ b/TWS/apps/applications/earbud/av_headset.h
@@ -426,6 +426,12 @@ extern appTaskData globalApp;
/*! Get pointer to instance of the Battery server for the right earbud battery */
#define appGetGattBatteryServerRight(inst) (&appGetGattInstance(inst)->battery_server_right)
#endif
+#define appGetHrTask() (&globalApp.gatt.gatt_hr_task)
+
+#if defined(INCLUDE_GATT_HR_SERVER)
+#define appGetGattHrServerInst(inst) (&appGetGattInstance(inst)->hr_server)
+
+#endif
/*! Get pointer to Pairing data structure */
#define appGetPairing() (&globalApp.pairing)
diff --git a/TWS/apps/applications/earbud/av_headset_config.h b/TWS/apps/applications/earbud/av_headset_config.h
index 58f2dc0..f67b9c3 100644
--- a/TWS/apps/applications/earbud/av_headset_config.h
+++ b/TWS/apps/applications/earbud/av_headset_config.h
@@ -669,7 +669,7 @@ extern const promptConfig prompt_config[];
\note Any existing BLE connections will not be affected
when leaving the case.
*/
-#define appConfigBleAllowedOutOfCase() (FALSE)
+#define appConfigBleAllowedOutOfCase() (TRUE)
/*! Should new connections be allowed when music is being played
@@ -682,7 +682,7 @@ extern const promptConfig prompt_config[];
\note Existing connections are not affected by this option
*/
-#define appConfigBleNewConnectionsWhenBusy() (FALSE)
+#define appConfigBleNewConnectionsWhenBusy() (TRUE)
/*! Number of simultaneous GATT connections allowed */
diff --git a/TWS/apps/applications/earbud/av_headset_db.db b/TWS/apps/applications/earbud/av_headset_db.db
index 26c99c1..ba8e99a 100644
--- a/TWS/apps/applications/earbud/av_headset_db.db
+++ b/TWS/apps/applications/earbud/av_headset_db.db
@@ -19,3 +19,6 @@
ADD_BATTERY_SERVICE(1)
ADD_BATTERY_SERVICE(2)
#endif
+#ifdef INCLUDE_GATT_HR_SERVER
+#include "gatt_heart_rate_server_db.dbi"
+#endif
diff --git a/TWS/apps/applications/earbud/av_headset_gatt.c b/TWS/apps/applications/earbud/av_headset_gatt.c
index f2483a9..a8ff5ad 100644
--- a/TWS/apps/applications/earbud/av_headset_gatt.c
+++ b/TWS/apps/applications/earbud/av_headset_gatt.c
@@ -148,7 +148,9 @@ bool appGattGoConnectable(void)
#ifdef INCLUDE_GATT_BATTERY_SERVER
appAdvManagerSetService(advert, GATT_SERVICE_UUID_BATTERY_SERVICE);
#endif
-
+#ifdef INCLUDE_GATT_HR_SERVER
+ appAdvManagerSetService(advert,GATT_SERVICE_UUID_HEART_RATE);
+#endif
adv_params.undirect_adv.filter_policy = ble_filter_none;
appConfigBleGetAdvertisingRate(appGetGatt()->advertising_mode,
&adv_params.undirect_adv.adv_interval_min,
@@ -654,6 +656,9 @@ void appGattInit(void)
#ifdef INCLUDE_GATT_GAIA_SERVER
GaiaStartGattServer(HANDLE_GAIA_SERVICE, HANDLE_GAIA_SERVICE_END);
#endif
+#ifdef INCLUDE_GATT_HR_SERVER
+ GattHrServerInit(appGetHrTask(),appGetGattHrServerInst(gatt_instance),HANDLE_HEART_RATE_SERVICE,HANDLE_HEART_RATE_SERVICE_END);
+#endif
}
/* complete registration of servers */
GattManagerRegisterWithGatt();
diff --git a/TWS/apps/applications/earbud/av_headset_gatt.h b/TWS/apps/applications/earbud/av_headset_gatt.h
index 3daf4bf..16c07ef 100644
--- a/TWS/apps/applications/earbud/av_headset_gatt.h
+++ b/TWS/apps/applications/earbud/av_headset_gatt.h
@@ -15,7 +15,7 @@
#include <gatt_server.h>
#include <gatt_gap_server.h>
#include <gatt_battery_server.h>
-
+#include <gatt_heart_rate_server.h>
/*! Messages sent by the av_headset_gatt module */
typedef enum {
@@ -61,6 +61,9 @@ typedef struct
GBASS battery_server_left;
GBASS battery_server_right;
#endif
+#ifdef INCLUDE_GATT_HR_SERVER
+ GHRS_T hr_server;
+#endif
} gattGattServerInfo;
@@ -73,6 +76,7 @@ typedef struct
/*! Task for handling battery related messages */
TaskData gatt_battery_task;
+ TaskData gatt_hr_task;
/*! Advertising rate to use when connecting */
appConfigBleAdvertisingMode advertising_mode;
diff --git a/TWS/apps/applications/earbud/qcc512x_qcc302x/CF376_CF440/earbud.x2p b/TWS/apps/applications/earbud/qcc512x_qcc302x/CF376_CF440/earbud.x2p
index 70fb22c..7b0a062 100644
--- a/TWS/apps/applications/earbud/qcc512x_qcc302x/CF376_CF440/earbud.x2p
+++ b/TWS/apps/applications/earbud/qcc512x_qcc302x/CF376_CF440/earbud.x2p
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project name="earbud" path="">
+<project name="earbud" path="D:/CSR3026/GIT/C3112_TWS_QCC3026/TWS/apps/applications/earbud/qcc512x_qcc302x/CF376_CF440/">
<configurations defaultKit="kitres://{049607bf-c81c-44a1-92bb-afc0744dcab9}">
<configuration name="debug" kit="kitres://{049607bf-c81c-44a1-92bb-afc0744dcab9}" options="clean|build|deploy|run|default">
<deployProject>deploy</deployProject>
@@ -18,7 +18,7 @@
<property name="HW_VARIANT">CF376_CF440</property>
<property name="INCPATHS">../../../../installed_libs\include\firmware_qcc512x_qcc302x ../../../../installed_libs\include\firmware_qcc512x_qcc302x/app ../../../../installed_libs\include\profiles\default_qcc512x_qcc302x ../../../../installed_libs\include\standard ../../chains sdk://audio/kalimba/kymera/common/interface/gen/k32</property>
<property name="LIBPATHS">../../../../installed_libs\lib\default_qcc512x_qcc302x\native ../../../../installed_libs\lib\os\qcc512x_qcc302x</property>
- <property name="LIBS">a2dp anc audio_plugin_common audio_processor avrcp bdaddr byte_utils chain connection cryptovm custom_operator file_list gaia gain_utils gatt gatt_battery_server gatt_gap_server gatt_manager gatt_server hfp input_event_manager logging operators packetiser_helper pio_common region rtime rwcp_server sdp_parse service system_clock transport_adaptation transport_manager upgrade usb_device_class vmal</property>
+ <property name="LIBS">a2dp anc audio_plugin_common audio_processor avrcp bdaddr byte_utils chain connection cryptovm custom_operator file_list gaia gain_utils gatt gatt_battery_server gatt_gap_server gatt_manager gatt_server hfp input_event_manager logging operators packetiser_helper pio_common region rtime rwcp_server sdp_parse service system_clock transport_adaptation transport_manager upgrade usb_device_class vmal gatt_heart_rate_server</property>
<property name="OUTPUT">earbud</property>
<property name="OUTPUT_TYPE">EXECUTABLE</property>
<property name="PRESERVED_LIBS">qcc512x_qcc302x</property>
diff --git a/TWS/apps/libs/gatt_heart_rate_server/gatt_heart_rate_server_db.dbi b/TWS/apps/libs/gatt_heart_rate_server/gatt_heart_rate_server_db.dbi
index 17b56d3..c7a8c33 100644
--- a/TWS/apps/libs/gatt_heart_rate_server/gatt_heart_rate_server_db.dbi
+++ b/TWS/apps/libs/gatt_heart_rate_server/gatt_heart_rate_server_db.dbi
@@ -27,7 +27,7 @@ Copyright (c) 2015 Qualcomm Technologies International, Ltd.
primary_service {
uuid : UUID_HEART_RATE_SERVICE,
name : "HEART_RATE_SERVICE",
-
+ sdp : true,
/* Heart Rate Measurement characteristic */
characteristic {
--
1.9.1
后来忘记了一个,其实是在调试中生成的,不然会编译不过
---
TWS/apps/libs/gatt_heart_rate_server/gatt_heart_rate_server_db.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/TWS/apps/libs/gatt_heart_rate_server/gatt_heart_rate_server_db.h b/TWS/apps/libs/gatt_heart_rate_server/gatt_heart_rate_server_db.h
index 178dc2f..77ff031 100644
--- a/TWS/apps/libs/gatt_heart_rate_server/gatt_heart_rate_server_db.h
+++ b/TWS/apps/libs/gatt_heart_rate_server/gatt_heart_rate_server_db.h
@@ -14,6 +14,14 @@
#define HANDLE_HEART_RATE_MEASUREMENT_CLIENT_CONFIG (0x0004)
#define HANDLE_BODY_SENSOR_LOCATION (0x0006)
+typedef enum
+{
+ HEART_RATE_SERVICE,
+
+ gatt_sdp_last
+} gatt_sdp;
+
+uint8 *GattGetServiceRecord(gatt_sdp service, uint16 *len);
uint16 *GattGetDatabase(uint16 *len);
uint16 GattGetDatabaseSize(void);
--
1.9.1
用nrf connect查看