This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Trying to pass pointers as arguemnts to a function

Below is a code Snippet:

I am trying to pass pointers through a function; And I am trying to get back the results.
Does not work at this time?

main()
{

static UCHAR ucRcvAddress, *ucMBFrame, usLength;

eStatus = eMBRTUReceive( &ucRcvAddress, &ucMBFrame, &usLength );

}

eMBErrorCode
eMBRTUReceive( UCHAR * pucRcvAddress, UCHAR ** pucFrame, USHORT * pusLength )
{ BOOL xdata xFrameReceived = FALSE; eMBErrorCode xdata eStatus = MB_ENOERR; UCHAR test = 5;

ENTER_CRITICAL_SECTION(); assert( usRcvBufferPos < MB_SER_PDU_SIZE_MAX );

if( ( usRcvBufferPos >= MB_SER_PDU_SIZE_MIN ) && ( usMBCRC16( ( UCHAR * ) ucRTUBuf, usRcvBufferPos ) >= 0 ) ) { *pusLength = ( USHORT )( usRcvBufferPos - MB_SER_PDU_PDU_OFF - MB_SER_PDU_SIZE_CRC );

*pucFrame = ( UCHAR * ) & ucRTUBuf[MB_SER_PDU_PDU_OFF]; xFrameReceived = TRUE; } else { eStatus = MB_EIO; } EXIT_CRITICAL_SECTION( ); return eStatus;
}

I am trying to pass a pointer to capture an array[] then pass it back.

Phil

0