Retrieving A&D stored data


#1

Hi,
I want to use the A&D storage to store data recieved through the UART1. I have set up a cell and written data to it using the following code

bool FCMDataHandler (u16 DataLen, u8 * Data) {
		s32 sResponse;
		sResponse = adl_adWrite(AD_Handle, DataLen, Data);
		switch (sResponse) {
			case OK:
				count++;
				//adl_fcmSendData(FCM_Handle, "\n\rblock added", 13);
				adl_fcmSendData(FCM_Handle, Data, DataLen);
				break;
			case ADL_RET_ERR_UNKNOWN_HDL:
				adl_fcmSendData(FCM_Handle, "\n\rHandle Unknown", 20);
				break;
			case ADL_RET_ERR_PARAM:
				adl_fcmSendData(FCM_Handle, "\n\rParam Error", 20);
				break;
			case ADL_RET_ERR_BAD_STATE:
				adl_fcmSendData(FCM_Handle, "\n\rcell finalised", 20);
				adl_fcmSwitchV24State(FCM_Handle, ADL_FCM_V24_STATE_AT);
				break;
			case ADL_AD_RET_ERR_OVERFLOW:
				adl_fcmSendData(FCM_Handle, "\n\rcell size exceeded", 20);
				break;
		}
		if (count == 100){
			switch(adl_adFinalise(AD_Handle)){
				case OK:
					adl_fcmSendData(FCM_Handle, "\n\rMemory Finalised", 20);
					break;
				case ADL_RET_ERR_UNKNOWN_HDL:
					adl_fcmSendData(FCM_Handle, "\n\rUnknown Handle", 20);
					adl_fcmSwitchV24State(FCM_Handle, ADL_FCM_V24_STATE_AT);
					break;
				case ADL_RET_ERR_BAD_STATE:
					adl_fcmSendData(FCM_Handle, "\n\rBad State", 20);
					adl_fcmSwitchV24State(FCM_Handle, ADL_FCM_V24_STATE_AT);
					break;
				}
		}
	return TRUE;
}

To retrieve the data I finalise the cell and then I need to use the adl_adInfo command to get the pointer to the first byte of data and the cell size. I am finding the documentation unclear as to how to retrieve this data and pass it to the ad_ftpPut function etc. When i try to print the

Info->size field it reports as “5” which has very little in common with the 100 characters/blocks i am recieving through the data handler.

Any help or guidance would be much appreciated.

Mark