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.

[参考译文] LP-CC1352P7:LP-CC1352P7的数据流示例代码

Guru**** 2391795 points
Other Parts Discussed in Thread: LP-CC1352P7, CC1352P7, CC2650

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/1340513/lp-cc1352p7-data-streamer-example-code-for-lp-cc1352p7

器件型号:LP-CC1352P7
主题中讨论的其他器件: CC1352P7CC2650

您好!

我有 LP-CC1352P7-4 Launchpad、我想使用"data streamer"或"simple serial socket master "等显式代码实现 BLE 中央角色、可以发送更多数据、如100KB。

是否有适用于 LP-CC1352P7-4的任何 GitHub 链接

谢谢!

D·萨尔维

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Dnyaneshvar:

    最简单的方法是从 LP-CC1352P7上的 simple_peripheral 项目开始、然后将这些文件的内容复制到 simple_peripheral 应用文件中: https://github.com/TexasInstruments/ble_examples/tree/simplelink_cc13xx_26xx_sdk-6.40/examples/rtos/LP_CC2651R3SIPA/ble5apps/simple_serial_socket_client

    此致、

    亚瑟

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好 Arthur、

    我在项目"simple_central_LP_CC1352P7_4_tirtos7_ticlang"中进行了一些更改 (SDK - simplelink_cc13xx_cc26xx_sdk_7_40_00_77 )

    文件名 -> simple_central.c

    函数名称 -> bool SimpleCentral_doGattWrite (uint8_t index)

    我在 image.h 文件中有(图像)数组存储。 (包含文件头)

     int remained_data_bytes = 0;
    
    bool SimpleCentral_doGattWrite(uint8_t index)
    {
        uint32 tx_buff_size = 244;
        int height = 480;
        int width = 800;
        int image_size = height*width/8*2;
    
    //    while(remained_data_bytes <= (tx_buff_size*2))
        while (remained_data_bytes <= image_size)
        {
            status_t status;
            uint8_t charVals[4] = { 0x43, 0x55, 0xAA, 0xFF }; // Should be consistent with    0x43 is 'c' in ascii to clear the display
                                                              // those in scMenuGattWrite
    
            attWriteReq_t req;
            req.pValue = GATT_bm_alloc(scConnHandle, ATT_WRITE_RSP, tx_buff_size,
            NULL);
    
            if (req.pValue != NULL)
            {
                uint8_t connIndex = SimpleCentral_getConnIndex(scConnHandle);
    
                // connIndex cannot be equal to or greater than MAX_NUM_BLE_CONNS
                SIMPLECENTRAL_ASSERT(connIndex < MAX_NUM_BLE_CONNS);
    
                req.handle = connList[connIndex].charHandle;
                req.len = tx_buff_size;
                memcpy(req.pValue, (gImage_7in5_V2_b + remained_data_bytes),
                       tx_buff_size); // Copy the entire array to pValue
                req.sig = 0;
                req.cmd = 0;
    
                status = GATT_WriteCharValue(scConnHandle, &req, selfEntity);
                if (status != SUCCESS)
                {
                    GATT_bm_free((gattMsg_t*) &req, ATT_WRITE_RSP);
                }
                remained_data_bytes += tx_buff_size;
            }
        }
      return (true);
    }

    当我使用按钮菜单选项从 simple_central_menu.c 文件执行此代码时、可 将244字节从 LP_CC1352P7_4成功发送 至 BLE 外设(CC2650)。

    未发送其余字节(96000-244 = 95756)。  

    请帮助我理解代码执行流程和代码结构、以便可以根据我的应用编辑此代码

    请指南。

    // Menu: GattWrite
    // upper: PerConnection
      MENU_OBJ(scMenuGattWrite, "GATT Write", 4, &scMenuPerConn)
      MENU_ITEM_ACTION(scMenuGattWrite,0,"Write clear",SimpleCentral_doGattWrite)
      MENU_ITEM_ACTION(scMenuGattWrite,1,"Write 0x55", SimpleCentral_doGattWrite)
      MENU_ITEM_ACTION(scMenuGattWrite,2,"Write 0xAA", SimpleCentral_doGattWrite)
      MENU_ITEM_ACTION(scMenuGattWrite,3,"Write 0xFF", SimpleCentral_doGattWrite)
      MENU_OBJ_END

    谢谢!

    D·萨尔维

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Dnyaneshvar:

    您是否放弃了将简单的串行插座移植到 CC1352P7?

    GATT_WriteCharValue 的返回值是多少?

    根据 https://software-dl.ti.com/lprf/simplelink_cc2640r2_latest/docs/blestack/ble_user_guide/doxygen/ble/html/group___a_t_t___g_a_t_t.html

    您不应在该方法的 while 循环中运行逻辑、而应在收到 GATT_MSG_EVENT 并使用 ATT_WRITE_RSP 值再次调用函数:

    此致、

    亚瑟

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Dnyanesh:

    我拆分了这个主题、因为它是关于新器件。

    此致、

    亚瑟

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    好的。 我需要创建另一个线程吗?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我已经在此处创建了新主题、因此不需要: e2e.ti.com/.../re-lp-cc1352p7-data-streamer-example-code-for-lp-cc1352p7

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我应该由其他 TI 人员来解答、或者您也将在这个问题中提供帮助?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我仍会提供帮助、但我将此主题拆分、以澄清问题、并在 CC2650部分获得更多支持。

    此致、

    亚瑟