TI中文支持网
TI专业的中文技术问题搜集分享网站

CC1310: CC1310 15.4 collector processIncomingICallMsg 问题

Part Number:CC1310Other Parts Discussed in Thread: CC1350

各位专家:我在分析 CC1310 15.4 collector  中 MAC 事件回调程序中 processIncomingICallMsg 加入新的回调事件

case UART_MESSAGE_IND: //OSAL 发过来的消息 add by jhy 2022-02-28 加入UART_MESSAGE_IND 事件,在程序中用 OsalPort_msgSend(appTaskId, (uint8_t*)pMsg ); 发送消息到APPTASK

现在已经接到这个消息回调。

现在我想显示消息中数据,macCbackEvent_t *pMsg

macCbackEvent_t  中加入了自己定义的消息结构

typedef struct _UserTaskEventInd
{
macEventHdr_t hdr; // Internal use only */
uint8_t SrcTaskId; //发送的源TASK_ID
uint8_t EventId; //
char *EventData; //MESSAGE BODY
uint8_t EventDataLen; //MESSAGE BODY LEN
} UserTaskEventInd_t;

/* Union of callback structures */
typedef union
{
macEventHdr_t hdr;
macMlmeAssociateInd_t associateInd; /* MAC_MLME_ASSOCIATE_IND */
macMlmeAssociateCnf_t associateCnf; /* MAC_MLME_ASSOCIATE_CNF */
macMlmeDisassociateInd_t disassociateInd; /* MAC_MLME_DISASSOCIATE_IND */
macMlmeDisassociateCnf_t disassociateCnf; /* MAC_MLME_DISASSOCIATE_CNF */
macMlmeBeaconNotifyInd_t beaconNotifyInd; /* MAC_MLME_BEACON_NOTIFY_IND */
macMlmeOrphanInd_t orphanInd; /* MAC_MLME_ORPHAN_IND */
macMlmeScanCnf_t scanCnf; /* MAC_MLME_SCAN_CNF */
macMlmeStartCnf_t startCnf; /* MAC_MLME_START_CNF */
macMlmeSyncLossInd_t syncLossInd; /* MAC_MLME_SYNC_LOSS_IND */
macMlmePollCnf_t pollCnf; /* MAC_MLME_POLL_CNF */
macMlmeCommStatusInd_t commStatusInd; /* MAC_MLME_COMM_STATUS_IND */
macMlmePollInd_t pollInd; /* MAC_MLME_POLL_IND */
macMcpsDataCnf_t dataCnf; /* MAC_MCPS_DATA_CNF */
macMcpsDataInd_t dataInd; /* MAC_MCPS_DATA_IND */
macMcpsPurgeCnf_t purgeCnf; /* MAC_MCPS_PURGE_CNF */
macMlmeWSAsyncInd_t asyncInd; /* MAC_MLME_WS_ASYNC_FRAME_IND */
macMlmeWSAsyncCnf_t asyncCnf; /* MAC_MLME_WS_ASYNC_FRAME_CNF */
macNpiMtMsg_t npiMtMsg; /* NPI MT message */
UserTaskEventInd_t useruartdataInd; /* 用户UART 任务发送过来的队列信息 add by jhy 2022-03-01 */
} macCbackEvent_t;

我在应用MAC 回调处理时加入如下语句:

case UART_MESSAGE_IND: //OSAL 发过来的消息 add by jhy 2022-02-28

DisPlayStr=Board_Lcd_IntToString("\r\nUART_MESSAGE_IND_len=",pMsg->useruartdataInd,10);

UART_write(hUart, DisPlayStr, strlen(DisPlayStr));

编译时,始终显示../Application/api_mac.c", line 1491: error #137: union "<unnamed>" has no field "useruartdataInd"
1 error detected in the compilation of "../Application/api_mac.c".
为什么呀,我在回调信息定义中已经加入了UserTaskEventInd_t useruartdataInd; /* 用户UART 任务发送过来的队列信息 add by jhy 2022-03-01 */ 。

调试半天没找到问题,请教。多谢。

Kevin Qiu1:

似乎是文件没有正确包含或者定义的位置有问题

UserTaskEventInd_t这个结构体是在哪里定义的?

,

自由飞翔:

已经定义了,和macCbackEvent_t 在mac_api.h 中定义的,编译时没提示该变量定义问题,提示的是macCbackEvent_t  类型变量调用其中的结构于有问题

,

自由飞翔:

我又查了下,好像问题出在macCbackEvent_t  定义包含的头文件上,macCbackEvent_t   是在mac_api.h 中定义,那么包含这个文件是在项目中macTask.h 中包含的  //#include "mac_api.h" 我打开mac_api.h 文件发现是调用的 D:\ti\simplelink_cc13x0_sdk_4_10_03_10\source\ti\ti154stack\inc 下的mac_api.h

并没有调用应用项目中的D:\CcsProject\UserProject\collector_CC1350_Wifi_433_tirtos_copy\Application\MAC 下的 mac_api.h文件。

,

Kevin Qiu1:

这是有可能的,你在另一个mac_api.h定义结构体看一下是否可行

赞(0)
未经允许不得转载:TI中文支持网 » CC1310: CC1310 15.4 collector processIncomingICallMsg 问题
分享到: 更多 (0)

© 2024 TI中文支持网   网站地图 鲁ICP备2022002796号-1