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.

#cc2640r2f关于快速传输数据问题;



你好我使用notfy快速传输数据:

    if ( len == SIMPLEPROFILE_CHAR4_LEN)
      {
         VOID memcpy( simpleProfileChar4, value, SIMPLEPROFILE_CHAR4_LEN );
        // See if Notification has been enabled
        GATTServApp_ProcessCharCfg( simpleProfileChar4Config, simpleProfileChar4, FALSE,
                                    simpleProfileAttrTbl, GATT_NUM_ATTRS( simpleProfileAttrTbl ),
                                    INVALID_TASK_ID, simpleProfile_ReadAttrCB );
      }
     
perdic 函数 100ms发送一次,发送数据过快或者距离过远,就会卡死,难道协议栈不会自动处理吗
代码进入
    case HAL_ASSERT_CAUSE_ICALL_TIMEOUT:
      Display_print0(dispHandle, 0, 0, "***ERROR***");
      Display_print0(dispHandle, 2, 0, ">> ICALL TIMEOUT!");
      HAL_ASSERT_SPINLOCK;
      break
我改怎么解决,距离变化自动进入死机状态;
  • 发送频繁了,内存分配不过来就有可能卡死,已在 下面帖子回复,请勿重复发帖e2echina.ti.com/.../596898
  • 有没有notfly 的相关程序,我觉得按下面这样操作notlfy不太好,为什么不判断是否连接等

    VOID memcpy( simpleProfileChar4, value, SIMPLEPROFILE_CHAR4_LEN );
    // See if Notification has been enabled
    GATTServApp_ProcessCharCfg( simpleProfileChar4Config, simpleProfileChar4, FALSE,
    simpleProfileAttrTbl, GATT_NUM_ATTRS( simpleProfileAttrTbl ),
    INVALID_TASK_ID, simpleProfile_ReadAttrCB );
  • 如果要确保对方收到,建议不要用notify,换用indication,有确认机制
  • 你好,我notfly 为什么在距离过长的时候断开,一般都直接报TIME_out ;

    bStatus_t ServApp_SendNotiInd( uint8_t *nvalue,uint16_t nlen)
    {
      attHandleValueNoti_t noti;
      uint16_t slen;
      bStatus_t status;
      slen  = nlen;
      gattCharCfg_t *pItem = simpleProfileChar4Config;
      if  ( pItem->connHandle != CONNHANDLE_INVALID)
      {
          noti.pValue = (uint8 *)GATT_bm_alloc( pItem->connHandle, ATT_HANDLE_VALUE_NOTI,slen,&slen);
    //                                            GATT_MAX_MTU, &slen );
          if ( noti.pValue != NULL )                //申请到了地址。=NULL说明没申请到地址
          {
              noti.handle =  simpleProfileAttrTbl[11].handle;
              noti.len = slen;
              memcpy(noti.pValue, nvalue, slen);
              status = GATT_Notification( pItem->connHandle, &noti, FALSE );
            if ( status != SUCCESS )
            {
              GATT_bm_free( (gattMsg_t *)&noti, ATT_HANDLE_VALUE_NOTI );
            }
          }
          else
          {
            GATT_bm_free( (gattMsg_t *)&noti, ATT_HANDLE_VALUE_NOTI );
            status = bleNoResources;
          }
      }
      return ( status );
    }
    报申请内存不成功
    indication速度快吗,有没有相关的例程
  • 速度是notify比较快,但是发的快了对方每来得及收,数据可能会被后面的冲掉,而indication可确认对方是否收到,看你自己取舍了。下面这个例程用到了indication:
    http://dev.ti.com/tirex/explore/node?node=ABLh-budrPNNeEoULdAnRg__KbOGwol__LATEST

  • 谢谢,目前还想尝试一下notfly ,我使用的oad offchip 例程,包越小越稳定,我由原来的184,换成64 数据 mtu ,数据比比原来稳定一些,长距离断线试了十几次没有死机,很烦恼啊