Data Storage AeD


#1

Hi. Excusime, i not write has ben english.

I need a Help.
I have a code:

/************************************************************************8
void AEDRead (u32 Parametro)
{
int Rsp;
char msg[20];
adl_adInfo_t Info;

if(lAeDFormat == FALSE || lAeDRecompact == FALSE)
return;

AeDHDL = adl_adSubscribe(Parametro,20);

Rsp = adl_adInfo(AeDHDL, &Info);

if(Rsp == 0)
{
strncpy(msg,Info.data,Info.size);
}
adl_adUnsubscribe(AeDHDL);

}

void AEDWrite (s32 Parametro)
{

int Rsp;
int datasize;
char teste[4];
teste[0] = 'A';
teste[1] = 'B';
teste[2] = 'C';
teste[3] = 'D';
teste[4] = 0;

datasize  = wm_strlen(teste);

if(lAeDFormat == FALSE || lAeDRecompact == FALSE)
	return;


AeDHDL = adl_adSubscribe(Parametro,datasize );


Rsp = adl_adWrite(AeDHDL,datasize , teste);
if(Rsp==-21)
	{
	AEDDelete(Parametro);
	Rsp = adl_adWrite(AeDHDL,datasize , teste);
	}

adl_adUnsubscribe(AeDHDL);

}

*****************************************************/

His code is a example for read and write in AeD data storage and AeDHDL his a public variable.
when i call write function , “AEDWrite(1);” is recording a data in AeD, but when read a data return “yyyy”.

how is correct format for work with AeD?
what is wrong in my code?
Someone have any example?


#2

You are doing just fine, apart from checking result codes.

I do not know what is doing the ADDelete function. The parameter in adl_adDelete() function is cellHandle and it is unsubscribed in this function.

If you are testing under RTE, its behaviour on AD objects is sometimes little strange (depends on OS). Try delete object 00000001.adc in rte/objects directory to force its reread from the device with AEDRead() or use some hex editor to check its contents.


#3

My test is on RTE and direct in module making download of dwl in Q24plus.
Both modes the output was the same and the “yyyy” in hex code is 0xFF.
All data on the structure Info is correte least the Info.data. Or the data of my string are not recorded, or are not read.
Someone has an example of recording and reading that is working?
Or what is the correct way. i make tests with two modules must be an error in the program, can only.