Misleading: Flash Read & Write functions - not strings


#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


#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! :unamused:


#3

Another example here: viewtopic.php?f=36&t=3899&p=15249#p15249


#4

Still misleading people after 3 years: viewtopic.php?f=118&t=4932&start=0
:open_mouth: :unamused: :angry:


#5

The description of the APIs seems to be changed in the latest ADL USER GUIDE


#6

No, I’m afraid it hasn’t. :angry:

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! :angry:
See: https://forum.sierrawireless.com/t/copy-text-from-documentation/3846/1


#7

I was reffering to R7.43 :slight_smile:


#8

Again, you’re looking at the wrong part of the text!

What does it say in the individual parameter descriptions?

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:

Again, the error is in the description of the ReadData parameter - not the description of the function!


#9

Whatever u said is correct wrt v6.31 guide. Have u checked in v6.32 guide :question:


#10

I don’t have that to hand at the moment…