awneil
September 3, 2007, 8:05am
1
In ‘C’, the term “string” has a specific meaning; viz , a NUL-terminated array of char - therefore the above are misleading, as they do not provide or use the NUL-termination.
In other words, they are not “strings” in the ‘C’ sense of the word.
For an example of someone caught-out by this, see: wavecom.com/modules/movie/sc … =6104#6104
This is the same for both v3.03 and v3.12
awneil
October 1, 2007, 11:15pm
2
A follow-up to the above.
The adl_flh… functions do not automatically NUL-terminate strings, so you have a choice:
1. Store the NUL termination in the flash;
2. Don’t store the NUL, and remember to add it when you read a string from Flash
But there is a catch with (2) - the Flash API will not store a zero size object!
This is not documented!
awneil
September 9, 2009, 6:28am
3
The description of the APIs seems to be changed in the latest ADL USER GUIDE
3.8.6. The adl_flhWrite Function
This function writes the flash object from the given Handle at the given ID, for the length provided with
the buffer provided. A single flash object can use up to 30 Kbytes of memory.
3.8.7. The adl_flhRead Function
This function reads the flash object from the given Handle at the given ID, for the length provided and
stores it in a buffer.
awneil
June 10, 2010, 10:55am
6
No, I’m afraid it hasn’t.
Look at the descriptions of the individual parameters - they still (R7.4A) refer to “strings”
Unfortunately, Sierra Wireless have disabled copy-and-paste from the R7.4a Guide!
See: copy text from documentation
awneil
June 10, 2010, 12:11pm
8
Again, you’re looking at the wrong part of the text!
What does it say in the individual parameter descriptions?
ADL User Guide for Open AT® OS v6.21:
3.8.6 The adl_flhWrite Function
This function writes the flash object from the given Handle at the given ID, for the length provided with the buffer provided. A single flash object can use up to 30 Kbytes of memory.
• Prototype
s8 adl_flhWrite (ascii* Handle, u16 ID, u16 Len, u8 *WriteData )
• Parameters
Handle:
The Handle of the subscribed set of objects.
ID:
The ID of the flash object to write.
Len:
The length of the flash object to write.
WriteData:
The provided string to write in the flash object
Note that the error is in the description of the WriteData parameter - not the description of the function!
Apart from the paragraph number, the text in the v6.31 guide is identical
Similarly:
3.8.7 The adl_flhRead Function
This function reads the flash object from the given Handle at the given ID, for the length provided and stores it in a buffer.
• Prototype
s8 adl_flhRead (ascii* Handle, u16 ID, u16 Len, u8 *ReadData )
• Parameters
Handle:
The Handle of the subscribed set of objects
ID:
The ID of the flash object to read.
Len:
The length of the flash object to read.
ReadData:
The string allocated to store the read flash object
Again, the error is in the description of the ReadData parameter - not the description of the function!
Whatever u said is correct wrt v6.31 guide. Have u checked in v6.32 guide
awneil
June 10, 2010, 12:40pm
10
I don’t have that to hand at the moment…