A&D operation can't work in 2406b?

I tested the A&D operation in the environment :

2406B
650a09gg.2406B 1949844 122204 14:53
+WOPEN: 2,“AT v03.01”
VC++6
OPENAT 3.02
Remote mode

the code is :

void adl_main ( adl_InitType_e InitType )
{
u8 i,Buffer;
s32 sReturn;
adl_adState_t State;
for(i = 0;i<132;i++)
     FCM_temp[i] = test_temp[i];
dwl_AppCellHandle = adl_adSubscribe ( dwl_CellID, ADL_AD_SIZE_UNDEF );
    TRACE (( 3, "Subscribe to A&&D cell %.8X : %d", dwl_CellID, dwl_AppCellHandle ));
   sReturn = adl_adWrite ( dwl_AppCellHandle, 130, FCM_temp );
   TRACE (( 3, "Write cell %d", sReturn ));
   sReturn = adl_adGetState ( &State );
   TRACE (( 3, "cell State1%d", sReturn ));
 
    // TO DO : Add your initialization code here
}

dwl_AppCellHandle return value is 0x00000000
sReturn = adl_adWrite ( dwl_AppCellHandle, 130, FCM_temp );
return value is 0xffffffea
sReturn = adl_adGetState ( &State );
return value is 0x00000000

Subscribe is OK, But adl_adWrite didn’t work
Why?

pls help me
thanks

Note that the return values are signed - so that represents -22

This is an undocumented error code - see:

wavecom.com/modules/movie/sc … documented

Also search the FAQ for “-22” and “ADL_AD_RET_ERROR” - it seems that this is not an uncommon problem :angry:

I get the impression that there are a number of restrictions that need to be observed when using A&D storage, but which are not documented :angry: :angry:

eg, see:
wavecom.com/modules/movie/sc … .php?t=928
wavecom.com/modules/movie/sc … php?p=3332

Thanks, awneil.

There’re poor documents for A&D operation! :smiling_imp:
I updated the firmware of 2406b to version 652a,and tested adWrite();
The return value is 0;

I did the next step:

void adl_main ( adl_InitType_e InitType )
{
u8 i,Buffer,temp[200],*AD_Read_Buffer,*AD_Read_Buffer1;
s32 sReturn;
adl_adState_t State;
adl_adInfo_t Info;
////
for(i = 0;i<132;i++)
    FCM_temp[i] = '2';

//format the A&D Area//
sReturn = adl_adFormat();
TRACE (( 3, "adl_adFormat %d", sReturn ));//return value is 0//

//for delay//
for(i = 0;i<250;i++);

dwl_AppCellHandle = adl_adSubscribe ( dwl_CellID, ADL_AD_SIZE_UNDEF );                           //return value is 0//
TRACE (( 3, "Subscribe to A&&D cell %.8X : %d", dwl_CellID, dwl_AppCellHandle ));
//test the Storage AREA add or not//
sReturn = adl_adGetState ( &State );
TRACE (( 3, "cell State1%d", sReturn ));//return value is 0//
for(i = 0;i<250;i++);
sReturn = adl_adWrite ( dwl_AppCellHandle, 130, FCM_temp );
//return value is 0//
for(i = 0;i<250;i++);
TRACE (( 3, "Write cell %d", sReturn ));
for(i = 0;i<250;i++);
sReturn = adl_adGetState ( &State );
//return value is 0//
//but the freemem,pad...are all same as the first adl_adGetState got//
TRACE (( 3, "cell State1%d", sReturn ));
for(i = 0;i<250;i++);
//read A&D area I wrote in//
sReturn = adl_adInfo(dwl_AppCellHandle,&Info);//return value is 0//
TRACE (( 3, "adl_adInfo%d", sReturn ));
AD_Read_Buffer = temp;
AD_Read_Buffer1 = Info.data;
wm_memcpy(AD_Read_Buffer,AD_Read_Buffer1,130);
//value in temp are 0xcd from 0~127//
//value in temp are 0x31 from 128~130  :roll:  :roll:  :roll: //
for(i = 0;i<250;i++);
for(i = 0;i<132;i++)
    FCM_temp[i] = '1';
sReturn = adl_adWrite ( dwl_AppCellHandle, 130, FCM_temp );//return value is 0//
for(i = 0;i<250;i++);
TRACE (( 3, "Write cell %d", sReturn ));
for(i = 0;i<250;i++);
sReturn = adl_adInfo(dwl_AppCellHandle,&Info);//return value is 0//
TRACE (( 3, "adl_adInfo%d", sReturn ));
AD_Read_Buffer = temp;
AD_Read_Buffer1 = Info.data;
wm_memcpy(AD_Read_Buffer,AD_Read_Buffer1,130);
//Faint........the value in temp are same as the first operation.....//
for(i = 0;i<250;i++);
}

I have no idea… :open_mouth:

This forum …

Sorry for my silly question, but why do you expect a change in the array temp, if you change the content of the array FCM_temp?
Regards
Ralf

Hi FengT,

It seems you are keep reading the “first” 130 bytes of the cell, so you will always get the same result… remember newer data written is added after old ones but not overwrite.

Also I STRONGLY recommend you to read ALL Wavecom website’s Q&A:

http://www.wavecom.com/modules/movie/scenes/support/index.php?fuseAction=listFaqs

You will find a lot of info not mentioned in pdf files…
That’s Wavecom way… much infomation is only “documented” there… :confused:

thanks Ralf,Wallace.

The important thing is the String I wrote is different from the String I Read

//read A&D area I wrote in// 
sReturn = adl_adInfo(dwl_AppCellHandle,&Info);//return value is 0// 
TRACE (( 3, "adl_adInfo%d", sReturn )); 
AD_Read_Buffer = temp; 
AD_Read_Buffer1 = Info.data; 
wm_memcpy(AD_Read_Buffer,AD_Read_Buffer1,130); 
//value in temp are 0xcd from 0~127// 
//value in temp are 0x31 from 128~130 //

the String I Wrote is “1111111111…1111”(130BYTE)
the String I Read is 0xcd,0xcd…0xcd,0x31,0x31,0x31(130BYTE)

Wallace,I test your app,It has the same problem :frowning:
Ralf,I chang the content and test,same,too… :cry:
(the String I wrote is different from the String I Read)

thanks again.

Best Regards

That was the old Wavecom site - where can this now be found on the Sierra Wireless site :question: