我试着在PRIME工程里,把接收到的数据发到电脑串口上去,但收到的数据和接收到的不一样。
根据TI_plcSUITE_G3_phy_api.pdf 收到的数据应该是放在 PHY_status_t PHY_rxPpduRelease(PHY_rxPpdu_t *ppdu_p);
而在test_rx_tx_c中函数这么改写void cb_ppdu(PHY_ev_t ev, PHY_cbData_t *data_p)
void cb_ppdu(PHY_ev_t ev, PHY_cbData_t *data_p)
{
PHY_rxPpdu_t *getid;
if (data_p->status == PHY_STAT_SUCCESS)
{
/* ok to read data */
rxppdu_cnt++;
{
PHY_rxPpdu_t *getid;
if (data_p->status == PHY_STAT_SUCCESS)
{
/* ok to read data */
rxppdu_cnt++;
/* release */
PHY_rxPpduRelease((PHY_rxPpdu_t *)(data_p->cbParms.rxPpdu.ppduInfoAddr));
scib_xmit_uint16(getid->mcs);//transmit to PC scib_xmit_uint16(getid->id);
scib_xmit_uint16(getid->length);
scib_xmit_uint16(getid->snr);
scib_xmit_uint16(getid->time);
PHY_rxPpduRelease((PHY_rxPpdu_t *)(data_p->cbParms.rxPpdu.ppduInfoAddr));
scib_xmit_uint16(getid->mcs);//transmit to PC scib_xmit_uint16(getid->id);
scib_xmit_uint16(getid->length);
scib_xmit_uint16(getid->snr);
scib_xmit_uint16(getid->time);
/* flash led every 8 pkt for testing */
if ((rxppdu_cnt & 0x7) == 0)
GpioDataRegs.GPATOGGLE.bit.GPIO31 = 1;
rxppdu_done = 1;
if ((rxppdu_cnt & 0x7) == 0)
GpioDataRegs.GPATOGGLE.bit.GPIO31 = 1;
rxppdu_done = 1;
}
}
但接收到的数据和发送的明显不一样,应该是我理解错了那函数。请问,我得怎么调用,才能把接收到的数据发到串口。