/*********************************************************************
* @fn simpleProfileChangeCB
*
* @brief Callback from SimpleBLEProfile indicating a value change
*
* @param paramID – parameter ID of the value that was changed.
*
* @return none
*/
static void simpleProfileChangeCB( uint8 paramID )
{
uint8 newValue;
uint8 newChar6Value[SIMPLEPROFILE_CHAR6_LEN];
uint8 returnBytes;
switch( paramID )
{
case SIMPLEPROFILE_CHAR1:
SimpleProfile_GetParameter( SIMPLEPROFILE_CHAR1, &newValue, &returnBytes );
#if (defined HAL_LCD) && (HAL_LCD == TRUE)
HalLcdWriteStringValue( "Char 1:", (uint16)(newValue), 10, HAL_LCD_LINE_3 );
#endif // (defined HAL_LCD) && (HAL_LCD == TRUE)
break;
case SIMPLEPROFILE_CHAR3:
SimpleProfile_GetParameter( SIMPLEPROFILE_CHAR3, &newValue, &returnBytes );
#if (defined HAL_LCD) && (HAL_LCD == TRUE)
HalLcdWriteStringValue( "Char 3:", (uint16)(newValue), 10, HAL_LCD_LINE_3 );
#endif // (defined HAL_LCD) && (HAL_LCD == TRUE
break;
case SIMPLEPROFILE_CHAR6:
SimpleProfile_GetParameter( SIMPLEPROFILE_CHAR6, newChar6Value, &returnBytes );
if(returnBytes > 0)
{
if(simpleBLE_CheckIfUse_Uart2Uart()) //使用透传模式时才透传
{
NPI_WriteTransport(newChar6Value,returnBytes);
}
}
break;
default:
// should not reach here!
break;
}
}
da qin zheng sheng:
假如需要接收100个字节,需要分5次接收的。
user4070396:
回复 da qin zheng sheng:
因为每次都只能进入一次对特征值的读写,怎么分开收取
ZANGk:
回复 da qin zheng sheng:
分5次接收是否需要开一个100bytes的空间,每次接收调用的是同一个函数么?????
user6073130:
回复 ZANGk:
您好,我刚刚接触蓝牙,也遇到接收多个包的情况,请问您最后是如何解决的呢?感谢!