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.

cc2540的sdk都1.5了,还是不能超过20字节/帧的限制吗?

Other Parts Discussed in Thread: CC2541

在SimpleBLEPeripheral的基础上改了代码做数据传输,每次20字节以内是没问题的.但是如果把数据量加大,就不行了.

simpleGATTprofile.h文件

#define SIMPLEPROFILE_CHAR5_LEN           20

simpleGATTprofile.c文件

// Simple Profile Characteristic 5 Properties
static uint8 simpleProfileChar5Props = GATT_PROP_READ | GATT_PROP_WRITE;
......
      // Characteristic Value 5
      { 
        { ATT_BT_UUID_SIZE, simpleProfilechar5UUID },
        GATT_PERMIT_AUTHEN_READ | GATT_PERMIT_AUTHEN_WRITE, 
        0, 
        simpleProfileChar5 
      },
......

函数bStatus_t SimpleProfile_SetParameter( uint8 param, uint8 len, void *value )
......
    case SIMPLEPROFILE_CHAR5:
      if ( len <= SIMPLEPROFILE_CHAR5_LEN ) 
      {
        VOID memcpy( simpleProfileChar5, value, len );
      }
      else
      {
        ret = bleInvalidRange;
      }
      break;
......

函数
static bStatus_t simpleProfile_WriteAttrCB( uint16 connHandle, gattAttribute_t *pAttr,
                                            uint8 *pValue, uint8 len, uint16 offset,
                                            uint8 method )
......
      case SIMPLEPROFILE_CHAR5_UUID:
        notifyApp = SIMPLEPROFILE_CHAR5;
        if ( len < SIMPLEPROFILE_CHAR5_LEN )
          memcpy(pAttr->pValue,pValue,len);
        else
          status = ATT_ERR_INVALID_VALUE_SIZE;
        break;
......