用cc2540做透传使用,#define SIMPLEPROFILE_CHAR1_LEN 20 ,然后使用
在 simpleProfileChangeCB( uint8 paramID )中处理接收数据
uint8 newValueBuf[20]={0};
SimpleProfile_GetParameter( SIMPLEPROFILE_CHAR1, newValueBuf );
SerialWrite (newValueBuf, 20);
目前这样做会出现接收1个字节数据后,串口助手实际是接收20个,那是因为SerialWrite (newValueBuf, 20)
中写了20个,而实际上我要如何去获取正真接收到,也就是说20这个值怎么替换成实际接收长度?
另外再进入SimpleProfile_GetParameter函数
case SIMPLEPROFILE_CHAR1:
VOID osal_memcpy( value, simpleProfileChar1, strlen(simpleProfileChar1) );
下面是simpleProfileChar1的申明
static uint8 simpleProfileChar1[20] = {0};
而这样处理就不能接收0x00了