Hi :
I am writing a string to the A&D memory and trying to read it back. below is my code and why do I read all FFFF back instead of the string I wrote in A&D. The adl_adWrite is successful with the same CellID.
int8_t read_AND(uint32_t CellID, uint32_t Size, ascii * pData )
{
int8_t retVal = 0;
int32_t cellHandle = -1;
int32_t adSize;
uint8_t * Buffer;
/* Subscribe to the cell */
cellHandle = adl_adSubscribe (CellID, Size);
if(cellHandle < 0){
TRACE((1,"AnD subscription failed %d\r\n", cellHandle));
return (retVal = ERROR);
}
adSize = adl_adInfo(cellHandle, &info );
if (info.size < 0){
TRACE((1,"AnD get info fail %d\r\n", cellHandle));
return (retVal = ERROR);
}
Buffer = (uint8_t *) adl_memGet( info.size + 1 );
if ( NULL == Buffer ){
TRACE((1,"\r\n Memory allocation failure \r\n"));
return (retVal = ERROR);
}
wm_memset(Buffer, 0x00, (info.size+1));
wm_memcpy(Buffer, info.data, info.size);
DUMP(1, Buffer, 32);
/* Unsubscribe */
adl_adUnsubscribe (cellHandle);
return retVal;
}