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.

[参考译文] CC2650EM-7ID-RD:使用蓝牙时出现数据包值错误

Guru**** 2540720 points
Other Parts Discussed in Thread: CC2650

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

https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/781407/cc2650em-7id-rd-packet-value-error-using-bluetooth

器件型号:CC2650EM-7ID-RD
Thread 中讨论的其他器件:CC2650

大家好、我是使用 SimpleLink CC2650开发套件的用户。

我尝试使用蓝牙在两个板之间进行通信。 我已经设置了2个板(一个是 Tx 模式、另一个是 Rx 模式)。

在 Rx 端、我尝试通过工作区控制台窗口检查数据包值。

但是、当我检查该值时、该值始终如下所示。

[Cortex_M3_0] 0->30
1->0
2->16.
3->0
4->0
5->0
6->0
7->0
8->0
9->0
10->0
11->0
12->0
13->0
14->0
15->0
16->0
17->0
18->0
19->0
20->0
21->0
22->0
23->0
24->0
25->0
26->0
27->0
28->0
29->0
30->0
31->0
32->0
33->0
34->0
35->0
36->0
37->0
38->0
39>0
40->0
41->0
42->0
43->0
44->0
45->0
46->0
47->0
48->0
49->0
50->0
51->0
52->0
53->0
54->0
55->0
56->0
57->0
58->0
59->0
60->0
61->0
62->0
63->0
64->0
65->0
66->0
67->0
68->0
69->0
70->0
71->0
72->0
73->0
74->0
75->0
76->0
77->0
78->0
79->0
80->0
81->0
82->0
83->0
84->0
85>0
86->0
87->0
88->0
89->0
90->0
91->0
92->0
93->0
94->0
95->0
96->0
97->0
98->0
99->0
100->0
101->0
102->0
103->0
104->0
105->0
106>0
107->0
108->0
109->0
110->0
111->0
112->0
113->0
114->0
115->0
116->0
117->0
118->0
119->0
120->0
121->0
122->0
123>0
124->0
125->0
126->0
0->30
1->0
2->16.
3->0
4->0
5->0
6->0
7->0
8->0
9->0
10->0
11->0
12->0
13->0
14->0
15->0
16->0
17->0
18->0
19->0
20->0
21->0
22->0
23->0
24->0
25->0
26->0
27->0
28->0
29->0
30->0
31->0
32->0
33->0
34->0
35->0
36->0
37->0
38->0
39>0
40->0
41->0
42->0
43->0
44->0
45->0
46->0
47->0
48->0
49->0
50->0
51->0
52->0
53->0
54->0
55->0
56->0
57->0
58->0
59->0
60->0
61->0
62->0
63->0
64->0
65->0
66->0
67->0
68->0
69->0
70->0
71->0
72->0
73->0
74->0
75->0
76->0
77->0
78->0
79->0
80->0
81->0
82->0
83->0
84->0
85>0
86->0
87->0
88->0
89->0
90->0
91->0
92->0
93->0
94->0
95->0
96->0
97->0
98->0
99->0
100->0
101->0
102->0
103->0
104->0
105->0
106>0
107->0
108->0
109->0
110->0
111->0
112->0
113->0
114->0
115->0
116->0
117->0
118->0
119->0
120->0
121->0
122->0
123>0
124->0
125->0
126->0

从 Tx 端代码来看、0-1索引将包含序列号、其他器件必须包含随机值。 但它不是。

我缺少什么?

---------------------------------------------------- RX 端代码-------------------------------------------------------

/***** 包括***** //*

XDCtools 头文件*/
#include 
#include 
#include 

/* TI-RTOS 头文件*/
#include 
#include 

/*电路板头文件*/
#include "Board.h"

/*应用特定头文件*/
#include "menu.h"
#include "RFQueue.h"
#include "smartrf_settings/smartrf_settings.h"
#include "smartrf_settings/smartrf_settings_predefined.h"

#if (defined __CC2650EM_7_en_en_enrf_+)|_enrf_en_+电路板
设置(已定义_)|_CC2650_+电路板#_#_en_en_en_enrf_#_+(定义_)|_+电路板#CC2650_+电路板#_en_en_en_en_+电路板#_enrf_en_en_+(#_+)|#CC1310_+电路板#_+电路板#_enrf_


定义了***** /
#define DATA_Entry_header_size 8 //通用数据条目的恒定标头大小*/
#define MAX_LENGTH 10 //最大长度字节无线电将接受*/
#define NUM_DATA_ENTRIES 2 /*注意:目前仅支持两个数据条目*/
#define NUM_SUBSTED_BYTES 2 /* rf_cmdRxHs.rxConf.bIncludeLen = 1:包括接收的长度
存储数据包中的*字段(2个字节)*/

静态 uint8_t packet[MAX_LENGTH + NUM_SUBSTED_BYTES -1];/*长度字节存储在单独的变量中*/
int i=0;

/***** 原型***** /
静态空 Rx_callback (rf_handle h、rf_CmdHandle ch、rf_EventMask e);


/***** 变量声明***** /
静态 uint8_t packetReceived = false;
静态 uint16_t* crcOk;
静态 INT8_t* RSSI;

静态 RF_Object rfObject;
静态 RF_Handle rfHandle;
静态 RF_CmdHandle rxCmdHnle= NULL;//需要句柄才能调用包含

所有数据条目的 RX 命令*/* Buffer。
需要* pragma 以确保此缓冲区是4字节对齐的(射频内核的要求)*/
#if defined (__TI_Compiler_version__)
#pragma DATA_ALIGN (rxDataEntryBuffer、4);
静态 uint8_t rxDataEntryBuffer[rf_queue_data_entry_buffer_size (NUM_DATA_entries、
MAX_LENGTH、
num_appended_bytes]];
#endif


static dataQueue_t dataQueue; /*要填充数据的射频代码的接收队列*/RFC_dataEntryGeneral_t*
currentDataEntry; /*常规数据输入结构(类型= 0)*/

#if (定义了__CC2650EM_7ID_H_)||(定义了__CC2650_LAUNCHXL_Board_H_)||(定义了__CC1350_LAUNCHXL_Board_H__)||(定义了__CC1350STK_SENSTK_Generict_
);rble_RFC_RXCC1350STK_SENSTK_SENSTK_SENCT_TRF_ Statistics /* RF_BLE_cmdleGenericRx 的输出结构*/
#endif

RFC_propRxOutput_t rxStatistics_prop; //* CMD_PROP_RX 的输出结构*/


//*
运行测试应用程序的接收部分并返回结果。
//
TestResult Rx_runRxTest (const ApplicationConfig* config)
{
assert_isTrue (config!= NULL、NULL);

rf_params rfParams;
rf_params_init (&rfParams);

if (RFQueue_defineQueue (&dataQueue、
rxDataEntryBuffer、
sizeof (rxDataEntryBuffer)、
num_data_entries、
max_length + NUM_apped_bytes))
{
/*未能为所有数据条目分配空间*/
while (true);
}

RF_cmdPropRx.pQueue =&dataQueue;
rf_cmdPropRx.pOutput =(uint8_t*)&rxStatistics_prop;
RF_cmdPropRx.maxPktLen = MAX_LENGTH;
rf_cmdPropRx.pktConf.bRepeatOk = 1;
rf_cmdPropRx.pktConf.bRepeatNok = 1;
rf_cmdPropRx.rxConf.bAutoFlushCrcErr = 1;
rf_cmdProprx.rxConf.bAutoFlushIgnored = 1;
rf_ble_pcmdbleGenericRx->pOutput =&rxStatistic_Ble;
rf_ble_pcmdBleGenericRx->pParams->pRxQ =&dataQueue;
rf_ble_pcmdBleGenericRx->pParams->bRepeat= 1;
rf_ble_pcmdBleGenericRx->pParams->rxConfig.bAutoFlushCrcErr = 1;
rf_ble_pcmdbleGenericRx->通道= 0xFF;
rf_ble_pCmdBleGenericRx->whitening.bOverride = 1;
rf_ble_pCmdBleGenericRx->whitening.init = config->frequencyTable[config->frequency].whitening;



/*根据测试用例请求对无线电的访问*/
交换机(config->rfSetup)
{

案例 RfSetup_Custom:

rfHandle = RF_OPEN (&rfObject、&RF_prop、(RF_RadioSetup*)&RF_cmdPropRadioDivSetup、&rfParams);
中断;

案例 RfSetup_FSK:
rfHandle = rf_open (&rfObject、rf_pProp_2_4G_FSK、(RF_RadioSetup*) rf_pCmdPropRadioSetup_2_4G_FSK、&rfParams);
中断;
案例 RfSetup_BLE:
rfHandle = rf_open (&rfObject、rf_pModeBle、(rf_RadioSetup*) rf_ble_pCmdlet 设置、&rfParams);
中断;
默认值:
中断;
}

/*设置频率*/
if (config->rfSetup => RfSetup_Custom)
{
//从 SmartRF Studio 导出的自定义设置应使用导出的频率
rf_runCmd (rfHandle、(rf_Op*)&rf_cmdf、rf_PriorityNormal、NULL、0);
}
否则 if (config->rfSetup == RfSetup_BLE)
{
rf_ble_pmdfs->frequency = config->frequencyTable[config->frequency].frequency;
rf_ble_pCmdfs->fractFreq = config->frequencyTable[config->frequency].fractFreq;
rf_runCmd (rfHandle、(rf_Op*) rf_ble_pmdf、rf_PriorityNormal、NULL、0);
}
其他
{
rf_pCmdfs_predef->frequency = config->frequencyTable[config->frequency].frequency;
rf_pmdfs_predef->fractFreq = config->frequencyTable[config->frequency].fractFreq;
rf_runCmd (rfHandle、(rf_Op*) rf_pmdfs_predef、rf_PriorityNormal、NULL、0);
}

/*进入 RX 模式并一直保持在 RX 中*/
交换机(config->rfSetup)
{
案例 RfSetup_BLE:

rxCmdHnle = rf_postCmd (rfHandle、(rf_Op*) rf_ble_pcmdbleGenericRx、rf_PriorityNormal、&Rx_callback、rf_EventRxEntryDone);
crcOk =&rxStatistics_ble.nRxOk;
RSSI =&rxStatistics_ble.lastRssi;
中断;

默认值:

rxCmdHalf = rf_postCmd (rfHandle、(rf_Op*)&rf_cmdPropRx、rf_PriorityNormal、&rx_callback、rf_EventRxEntryDone);
crcOk =&rxStatistics_prop.nRxOk;
RSSI =&rxStatistics_prop.lastRssi;
中断;
}

*crcOk = 0;
*RSSI = 0;
while (true)
{
IF (电池组接收器)
{
PacketReceived = false;
menu_updateRxScreen (* crcOk、* RSSI);
}

if (menu_isButtonPressed())
{
/*强制缓慢中止*/
rf_cancelCmd (rfHandle、rxCmdHnle、0);
rf_pendCmd (rfHandle、rxCmdHnle、rf_EventRxEntryDone);
RF_Close (rfHandle);
返回 TestResult_Aborted;
}
}


void Rx_callback (rf_handle h、rf_CmdHandle ch、rf_EventMask e)
{
IF (e 和 RF_EventRxEntryDone)
{
/*获取当前未处理的数据输入*/
currentDataEntry = RFQueue_getDataEntry();

对于 TC_HSM、数据包长度和指向有效载荷中第一个字节的指针可如下所示:
*
// uint8_t packetLength =((*(uint8_t*)(&currentDataEntry->data + 1))<<8)|(*(uint8_t*)(&currentDataEntry->data));
// uint8_t* packetDataPointer =(uint8_t*)(&currentDataEntry->data+2);

//对于其他测试用例(TC_LRM、TC_OOK 和 TC_FSK)、可以在此处找到数据包长度和第一个有效载荷字节:
uint8_t packetLength =*(uint8_t*)(&currentDataEntry->data);
uint8_t* packetDataPointer =(uint8_t*)(&currentDataEntry->data+1);

//packetLength =*(uint8_t*)(&currentDataEntry->data);
//packetDataPointer =(uint8_t*)(&currentDataEntry->data+1);

memcpy (packet、packetDataPointer、(packetLength + 1));

for (i=0;i<=(MAX_LENGTH + NUM_SUBST_Bytes - 1);i++){
System_printf ("%d->%d\n"、i、packet[i]);
}

packetReceived = true;
RFQueue_nextEntry();
}
} 

---------------------------------------------------- TX 端代码-------------------------------------------------------

/***** 包括***** //*

XDCtools 头文件*/
#include 
#include 
#include 

/* TI-RTOS 头文件*/
#include 
#include 

/*电路板头文件*/
#include "Board.h"//

*特定于应用的头文件*/
#include 
#include "menu.h"
#include "RFQueue.h"
#include "smartrf_settings/smartrf_settings.h"
#include "smartrf_settings/smartrf_settings.h"

#if (defined __CC2650EM_7ID_H_)||(defined __CC2650_LAUNCHXL_Board_predefined __)#_CC1310_enrf_#_en_en_+(definu_CC1310_#____CC1310__________EN6410_+)|_EN6410_ENRF_ENCH_EN64_END_ENCH_ENCH_ENTRF_ENTRF_ENTRF_ENTRF_



定义了***** /#define
PAYLOAD_LENGTH 4 /*要发送的数据包的长度*/
#define DATA_Entry_header_size 8 //通用数据条目的恒定标头大小*/
#define MAX_LENGTH 4 /*设置数据条目的长度*/
#define NUM_DATA_ENTRIES 1
#define NUM_SUBSTED_Bytes 0

/***** 变量声明***** /
static rf_Object rfObject;
static rf_handle rfHandle;

static uint8_t packet[load_length];
static uint16_t seqNumber;
uint32_t packetCounter = 0;
uint32_t packetInterval;

#if defined (__TI_Compiler_version_)
#pragma DATA_ALIGN (txDataEntryBuffer、4);
静态 uint8_t txDataEntryBuffer[RF_queue_data_entry_buffer_size (NUM_DATA_entries、
MAX_LENGTH、
num_appended_bytes]];
#endif

/* Tx 队列或射频内核,用于从*/
static dataQueue_t dataQueue 读取数据;
static RFC_dataEntryGeneral_t* currentDataEntry;
static uint8_t *pPacket;


//运行测试应用程序的接收部分并返回结果。 //
TestResult TX_runTxTest (const ApplicationConfig* config)
{
assert_isTrue (config!= NULL、NULL);
uint32_t 时间;
rf_params rfParams;
rf_params_init (&rfParams);

rf_cmdPropTx.pktLen =有效载荷长度;
rf_cmdPropTx.pPkt=数据包;
RF_cmdPropTx.startTrigger.triggerType = TRIG_ABSTIME;
RF_cmdPropTx.startTrigger.PastTrig = 1;
RF_cmdPropTx.StartTime = 0;

if (RFQueue_defineQueue (&dataQueue、
txDataEntryBuffer、
sizeof (txDataEntryBuffer)、
num_data_entries、
max_length + NUM_apped_bytes))
{
/*未能为所有数据条目分配空间*/
while (true);
}

#if (定义了__CC2650EM_7ID_H__)||(定义了__CC2650_LAUNCHXL_Board_H__)||(定义了__CC1350_LAUNCHXL_Board_H__)||(定义了__CC1350STK_SENSORTAG_Board_H__)
rf_ble_pcmdbleAdvNc->pParams->pAdvData =数据包;
rf_ble_pCmDBleAdvNc->startTrigger.triggerType = trig_ABSTIME;
rf_ble_pCmDBleAdvNc->startTrigg.PastTrig = 1;
rf_ble_pcmdbleAdvNc->通道= 0xFF;
rf_ble_pCmdBleAdvNc->whitening.bOverride = 1;
rf_ble_pCmdbleAdvNc->whitening.init = config->frequencyTable[config->frequency].whitening;
rf_ble_pCmdBleAdvNc->StartTime = 0;
#endif

currentDataEntry =(RFC_dataEntryGeneral_t*)&txDataEntryBuffer;
currentDataEntry ->长度= PAYLOAD_LENGTH;
pPacket =当前数据尝试->数据;

/*根据测试案例请求对无线电的访问*/
交换机(config->rfSetup)
{

案例 RfSetup_Custom:

rfHandle = RF_OPEN (&rfObject、&RF_prop、(RF_RadioSetup*)&RF_cmdPropRadioDivSetup、&rfParams);
中断;

案例 RfSetup_FSK:
rfHandle = rf_open (&rfObject、rf_pProp_2_4G_FSK、(RF_RadioSetup*) rf_pCmdPropRadioSetup_2_4G_FSK、&rfParams);
packetInterval =(uint32_t)(4000000*0.05f);//将数据包间隔设置为50ms */

break;
#if (定义了__CC2650EM_7ID_H__)||(定义了__CC2650_LAUNCHXL_Board_H__)||(定义了__CC1350_LAUNCHXL_Board_H__)||(定义了__CC1350STK_SENSORTAG_Board_H__)
案例 RfSetup_BLE:

rfHandle = rf_open (&rfObject、rf_pModeBle、(rf_RadioSetup*) rf_ble_pCmdlet 设置、&rfParams);
packetInterval =(uint32_t)(4000000*0.1f);//将数据包间隔设置为100ms */
break;
#endif

默认值:
中断;
}

/*设置频率*/
if (config->rfSetup => RfSetup_Custom)
{
//从 SmartRF Studio 导出的自定义设置应使用导出的频率
rf_runCmd (rfHandle、(rf_Op*)&rf_cmdf、rf_PriorityNormal、NULL、0);
}
否则 if (config->rfSetup == RfSetup_BLE)
{
rf_ble_pmdfs->frequency = config->frequencyTable[config->frequency].frequency;
rf_ble_pCmdfs->fractFreq = config->frequencyTable[config->frequency].fractFreq;
rf_runCmd (rfHandle、(rf_Op*) rf_ble_pmdf、rf_PriorityNormal、NULL、0);
}
其他
{
rf_pCmdfs_predef->frequency = config->frequencyTable[config->frequency].frequency;
rf_pmdfs_predef->fractFreq = config->frequencyTable[config->frequency].fractFreq;
rf_runCmd (rfHandle、(rf_Op*) rf_pmdfs_predef、rf_PriorityNormal、NULL、0);
}

/*获取当前时间*/
时间= RF_getCurrentTime();
while (++packetCounter <= config->packetCount )
{
/*创建具有递增序列号和随机有效载荷的数据包*/
pPacket[0]= packet[0]=(uint8_t)(seqNumber >> 8);
pPacket[1]= packet[1]=(uint8_t)(seqNumber++);
uint8_t i;
对于(I = 2;I < PAYLOAD_LENGTH;I++)
{
pPacket[i]= packet[i]= rand();
}

/*设置绝对 TX 时间以利用自动电源管理*/
time += packetInterval;
RF_cmdPropTx.StartTime =时间;

/*发送数据包*/
交换机(config->rfSetup)
{
案例 RfSetup_BLE:
{
rf_ble_pcmdbleAdvNc->StartTime =时间;
RF_EventMask 结果= RF_runCmd (rfHandle、(RF_OP*) RF_BLE_pCMDBleAdvNc、RF_PriorityNormal、NULL、0);
if (!(结果和 RF_EventLastCmdDone))
{
/*错误*/
while (true);
}
中断;
}

默认值:

{
RF_EventMask 结果= RF_runCmd (rfHandle、(RF_OP*)&RF_cmdPropTx、RF_PriorityNormal、NULL、0);
if (!(结果和 RF_EventLastCmdDone))
{
/*错误*/
while (true);
}
中断;
}
}



/*更新显示*/
menu_updateTxScreen (packetCounter);

/*检查是否已按下按钮*/
if (menu_isButtonPressed())
{
packetCounter = 0;
seqNumber = 0;
RF_Close (rfHandle);
返回 TestResult_Aborted;
}
}

packetCounter = 0;
seqNumber = 0;
RF_Close (rfHandle);
返回 TestResult_Finished;
}

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    我使用的是 Workspace Resource Explorer (软件>TI-RTOS for CC2650>开发工具>CC2650开发套件(7ID)>RF 示例> RF 数据包错误率测试)的示例代码
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    您好!
    不清楚您要打印的数据是什么。 您是否在接收数据包后检查了 rxStatistics_prop 变量? 您能否发布此变量的内容。 此外、器件报告的 PER 统计信息是什么?

    此致、
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    1.接收数据包后立即使用 rxStatistics_prop 变量和 rxStatistics_ble。
    我检查了 RX 端回叫功能中的值。 代码如下所示。
    ________________________________________________________________
    void Rx_callback (rf_handle h、rf_CmdHandle ch、rf_EventMask e)

    IF (e 和 RF_EventRxEntryDone)

    System_printf ("rxStatistics_prop 值-> lastRssi 0x%x、nRXBuffFul 0x%x、nRXIgored 0x%x、nRxNok 0x%x、nRxOK 0x%x、 nRxStopPed 0x%x、时间戳0x%x\n"、rxStatistics_prop.lastRssi、rxStatistics_prop.nRxBufFull、rxStatistics_prop.nRxIgnored、 rxStatistics_prop.nRxNok、rxStatistics_prop.nRxOk、rxStatistics_prop.nRxStopped、rxStatistics_prop.timestamp);
    System_printf ("rxStatistics_ble value after ->_dummy0 0x%x、lastRssi 0x%x、nRXBufFull 0x%x、nRxNok 0x%x、nRxOK 0x%x、 timestamp 0x%x\n",rxStatistics_ble.__dummy0、rxStatistics_ble.lastRssi、rxStatistics_ble.nRxBufFull、rxStatistics_ble.nRxNok、rxStatistics_ble.nRxOk、 rxStatistics_ble.timestamp);

    PIN_setOutputValue (pinHandle、Board_LED1、!PIN_getOutputValue (Board_LED1));
    PIN_setOutputValue (pinHandle、Board_LED2、!PIN_getOutputValue (Board_LED2));
    PIN_setOutputValue (pinHandle、Board_LED3、!PIN_getOutputValue (Board_LED3));
    PIN_setOutputValue (pinHandle、Board_LED4、!PIN_getOutputValue (Board_LED4));

    /*获取当前未处理的数据输入*/
    currentDataEntry = RFQueue_getDataEntry();

    电池组长度 =*(uint8_t*)(&currentDataEntry->data);
    packetDataPointer =(uint8_t*)(&currentDataEntry->data+1);

    memcpy (packet、packetDataPointer、(packetLength + 1));
    packetReceived = true;
    RFQueue_nextEntry();




    ________________________________________________________________
    工作区的控制台响应如下所示:

    rxStatistics_prop 值-> lastRssi 0x0、nRXBuffFul 0x0、nRXIgored 0x0、nRxNok 0x0、nRxOK 0x0、 nRxStopped 0x0、时间戳0x0
    rxStatistics_ble value after ->_dummy0 0x0、lastRssi 0xffffffffdc、nRXBufFull 0x0、nRxNok 0x0、nRxOK 0x2、 时间戳0x4e3ecc1

    2.我不知道每份统计数据的含义是什么,所以我不能回复。


    我认为回调函数运行良好、这意味着数据包被很好地接收。 但我认为在尝试访问接收到的数据包时出错。(以下代码。)
    ________________________________________________________________
    currentDataEntry = RFQueue_getDataEntry();

    电池组长度 =*(uint8_t*)(&currentDataEntry->data);
    packetDataPointer =(uint8_t*)(&currentDataEntry->data+1);

    memcpy (packet、packetDataPointer、(packetLength + 1));
    ________________________________________________________________
    在 BLE 模式下(使用2404Hz)、是否正确访问了上述接收到的数据包?
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    从您发布的接收统计数据中可以清楚地看到、已收到2个 BLE 数据包、没有错误。 在 BLE 模式下、数据包格式随数据包的预期用途而变化(例如:广播与数据包)。 应根据预期的数据包格式自定义接收数据包的处理。 请参考数据包格式并交叉检查包含接收数据的缓冲区的内容。 可根据此信息修改用于在 RX 回调中检索数据包的代码。

    使用 CC2650与 CC2640R2的原因是什么? 我假设您使用的是一个非常旧的 SDK 版本、以查找 CC2650的示例。 您还可以参阅 CC2640R2的最新 SDK 版本、并查看 BLE 数据包处理的每个示例。

    此致、

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    我使用 Smart RF Studio 7测试了接收到的数据包、并对这些数据包进行了验证。 然后重试、但结果相同。
    但我可以解决使用直接访问数据包而不使用 memcpy 的问题。

    电池组长度 =*(uint8_t*)(&currentDataEntry->data);
    packetDataPointer =(uint8_t*)(&currentDataEntry->data+1);

    for (i=0;i<=(MAX_LENGTH + NUM_SUBST_Bytes - 1);i++){
    //System_printf ("%d->%x\n"、i、(packetDataPointer[i]));
    packet[i]= packetDataPointer[i];


    由于用于循环,可能需要更多的时间,但在我的机具系统中,时间并不重要。 无论如何、感谢您的回答。