if( GAPROLE_CONNECTED == gapProfileState) // 已连接上
{
#if 0// 直接通过串口返回
NPI_WriteTransport(buffer, sendBytes);
#else// 通过CHAR6 特征值发送出去, 这里有两种方法
#if 0 // 这种速度慢 SimpleProfile_SetParameter
//simpleBLEChar6DoWrite2 = FALSE;
SimpleProfile_SetParameter( SIMPLEPROFILE_CHAR6,numBytes, buf );
#else // 这种速度快 GATT_Notification
static attHandleValueNoti_t pReport;
uint16 connectedhandle;
uint16 i,j;
uint8 allowsendlen=SIMPLEPROFILE_CHAR6_LEN;
uint16 SendTimes=0;
if(sendBytes>=19)
{
if(sendBytes%19==0)
{
SendTimes=sendBytes/19;
for(i=0;i<SendTimes;i++)
{
GAPRole_GetParameter(GAPROLE_CONNHANDLE,&connectedhandle);
pReport.len = allowsendlen;
pReport.handl
Ble分包发送
最新推荐文章于 2024-01-22 21:43:56 发布