Pointer To Byte Array
Pointer To Byte Array
I am trying to use "Master_I2CReadBuf" to read 6 bytes into an array of bytes. This function wants a pointer of type PBYTE to specify where to put the data (which I need to point to an array of six BYTE's). I am having trouble with the type agreement when defining the pointer.... any suggestions?
Re: Pointer To Byte Array
A PBYTE is just a byte pointer (BYTE*). Just define your array that is storing the data and pass in the name of the array. This is straight from the example:
C:\nburn\examples\mod5270\I2C2Serial\main.cpp
//The recieve buffer
BYTE buffer[I2C_MAX_BUF_SIZE];
// Read 30 BYTES from the selected address
I2CReadBuf( address, buffer, 30 );
C:\nburn\examples\mod5270\I2C2Serial\main.cpp
//The recieve buffer
BYTE buffer[I2C_MAX_BUF_SIZE];
// Read 30 BYTES from the selected address
I2CReadBuf( address, buffer, 30 );