连接间隔设置:
#define DEFAULT_DESIRED_MIN_CONN_INTERVAL 64 //80ms#define DEFAULT_DESIRED_MAX_CONN_INTERVAL 80 //100ms发送数据事件时钟间隔
// How often to perform periodic event (in msec)#define SBP_PERIODIC_EVT_PERIOD 100修改
#define MAX_NUM_PDU 10 // default is 5 iOS support <7发送数据处理任务。每一个事件连续发送10个20字节数据。
static void EcgBLEPeripheral_performPeriodicTask(void){#ifndef FEATURE_OAD_ONCHIP bStatus_t ret=SUCCESS; uint8_t i; uint8_t reSendTimes=0; valueData[0]=(serialNumber>>8)&0xFF; valueData[1]=serialNumber&0xFF; for(i=0;i<10;i++){ valueData[2]=(uint8_t)i; EcgPRofile_SetParameter(ECGPROFILE_CHARData, ECGPROFILE_CHARData_LEN, valueData); } if(serialNumber==0xFFFF) serialNumber=0; else serialNumber++; #endif //!FEATURE_OAD_ONCHIP}速率计算
100ms interval : 5*20*10=1Kbyte/s50ms interval : 5*20*20=2Kbyte/siOS连接参数限制:
Interval Max * (Slave Latency + 1) ≤ 2 secondsInterval Min ≥ 20 msInterval Min + 20 ms ≤ Interval MaxSlave Latency ≤ 4connSupervisionTimeout ≤ 6 secondsInterval Max * (Slave Latency + 1) * 3 < connSupervisionTimeout参考链接 https://developer.apple.com/library/content/qa/qa1931/_index.html
新闻热点
疑难解答