Telemetry.c

Hi
I’m working on Q2686G DK and after the “HelloWorld” and “Melody” demo I tried the “Telemetry”
I think I’ve some problems accessing the flash memory; as far as I understand when I set a new report number it is supposed to be written in the flash in order to have it ready for the “tele_ReadSettings” next time the application is started…

what is happening is that in “tele_ReadSettings” when it do the test adl_flhExists the returned value RepNbLen is 65533 and the following adl_flhRead return the code -3 (that I assume is ADL_RET_ERR_UNKNOWN_HDL)

same return code (-3) returned by adl_flhWrite in Cmd_TEL_Handler when I set a new telephone number through the AT+TEL= command…

I suspect the flash should be initialized with the tele_NameBuffer in some way but I haven’t find how…

where am I wrong??

thanks in advance
ciao
gianni.

RepNbLen should be a signed, and not unsigned variable (that is why you get the weird 65533 return value). Bug in the sample.

The second bug it seems is that the exist return is compared against != 0. If an error occur, a negative value would be returned and it would try to read. It should really be compared against > 0 only.

As for the actual problem, adl_flhSubscribe needs to be called before a handle can be used and that seems to be non existent in this file (at least in the version that I have).

thanks for your answer

yes adl_flhSubscribe is what I’m suspecting is missing… but it should be called only once forever, to avoid filling flash memory AFAIK. is there a way to call it “manually” or using an AT command to create the handler?

ciao
g.

ok, solved
put adl_flhSubscribe in the else clause of the test if adl_flhExists inside tele_ReadSettings

in this case it creates the entry in the flash only once an then it works

ciao

gianni