This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

GATTServApp_ProcessCharCfg问题,想发送20个数据,



不知道这么写错在哪里。请网友和ti工程师帮我指点下。

bStatus_t IRTemp_SetParameter( uint8 param, uint8 len, void *value )
{
bStatus_t ret = SUCCESS;
uint8 CacheData[20] = { 0x00 ,0x01 ,0x02 ,0x03 ,0x04 ,0x05 ,0x06 ,0x07 ,0x08 ,0x09,
0x10 ,0x11 ,0x12 ,0x13 ,0x14 ,0x15 ,0x16 ,0x17 ,0x18 ,0x19};
switch ( param )
{
case SEND_DATA_LEN:
if ( len == SEND_DATA_LEN )
{
VOID osal_memcpy( sendData, CacheData, SEND_DATA_LEN );
// See if Notification has been enabled
GATTServApp_ProcessCharCfg( irTempDataConfig, sendData, FALSE,
irTempAttrTbl, GATT_NUM_ATTRS( irTempAttrTbl ),
INVALID_TASK_ID );
}
else
{
ret = bleInvalidRange;
}
break;

case IRTEMPERATURE_CONF:
if ( len == sizeof ( uint8 ) )
{
irTempCfg = *((uint8*)value);
}
else
{
ret = bleInvalidRange;
}
break;
break;

default:
ret = INVALIDPARAMETER;
break;
}

return ( ret );
}

  • shaoxuan,

    具体是啥问题?

    数据发不出,还是发不全?

  • 问题已经解决了,是我没注意 

    bStatus_t IRTemp_SetParameter( uint8 param, uint8 len, void *value )
    {
    bStatus_t ret = SUCCESS;
    uint8 CacheData[20] = { 0x00 ,0x01 ,0x02 ,0x03 ,0x04 ,0x05 ,0x06 ,0x07 ,0x08 ,0x09,
    0x10 ,0x11 ,0x12 ,0x13 ,0x14 ,0x15 ,0x16 ,0x17 ,0x18 ,0x19};
    switch ( param )
    {
    case SEND_DATA_LEN:
    if ( len == SEND_DATA_LEN )
    {
    VOID osal_memcpy( sendData, CacheData, SEND_DATA_LEN );
    // See if Notification has been enabled
    GATTServApp_ProcessCharCfg( irTempDataConfig, sendData, FALSE,
    irTempAttrTbl, GATT_NUM_ATTRS( irTempAttrTbl ),
    INVALID_TASK_ID );
    }
    else
    {
    ret = bleInvalidRange;
    }
    break;

    case IRTEMPERATURE_CONF:
    if ( len == sizeof ( uint8 ) )
    {
    irTempCfg = *((uint8*)value);
    }
    else
    {
    ret = bleInvalidRange;
    }
    break;
    break;

    default:
    ret = INVALIDPARAMETER;
    break;
    }

    return ( ret );
    }

    这个应该写成IRTEMPERATURE_DATA。不过你们ti的在线支持真心不错,这么快就能回答。多谢你啊。


  • shaoxuan,

    很好。

    不客气:)