1、我的串口输入只能输入一次
(void)port;
uint8 numBytes = 0;
uint8 buf[128];
if (events & HAL_UART_RX_TIMEOUT) //串口有数据
{
numBytes = NPI_RxBufLen(); //读出串口缓冲区有多少字节
if(numBytes)
{
if ( numBytes >= SIMPLEPROFILE_CHAR1_LEN ) buf[0] = SIMPLEPROFILE_CHAR1_LEN-1;
else buf[0] = numBytes;
NPI_ReadTransport(&buf[1],buf[0]);
//从串口缓冲区读出numBytes字节数据
webeesensorProfile_SetParameter( WEBEESENSORPROFILE_TEMP, SIMPLEPROFILE_CHAR1_LEN, buf );
NPI_ReadTransport(buf,numBytes);
}
}
2、读取串口输入的数据,通知手机,打开的数据跟输入的不一样