# FLASH subscription

**URL:** <https://forum.sierrawireless.com/t/flash-subscription/1184>\
**Category:** Open AT\
**Created:** [March 15, 2007, 4:14am UTC](https://forum.sierrawireless.com/t/flash-subscription/1184 "2007-03-15T04:14:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sachin\_mishra](https://avatars.discourse-cdn.com/v4/letter/s/8baadc/32.png) [@sachin\_mishra](https://forum.sierrawireless.com/u/sachin_mishra)\
**Post date:** [March 15, 2007, 4:14am UTC](https://forum.sierrawireless.com/t/flash-subscription/1184/1 "2007-03-15T04:14:10Z")

</div>

Hi all,  
i am using q2686 module  
i am tring to subscribe flash multiple time using different handles and number of object range.  
how many time we can subscribe to the flash?

ascii flash\_hdl1,flash\_hdl2;

s8 sReturn,sReturn1;  
/\* first subscription _/  
sReturn = adl\_flhSubscribe ( &flash\_hdl1,30 );  
/_ Second subscription \*/  
sReturn1 = adl\_flhSubscribe ( &flash\_hdl2,50 );

waiting for reply

---

<div class="post-metadata">

**Author:** ![Bulat](https://avatars.discourse-cdn.com/v4/letter/b/2bfe46/32.png) [@Bulat](https://forum.sierrawireless.com/u/Bulat)\
**Post date:** [March 15, 2007, 10:55am UTC](https://forum.sierrawireless.com/t/flash-subscription/1184/2 "2007-03-15T10:55:51Z")

</div>

Hi  
you need to define name of yours objects set:

static const char CONFIG\_STR\_HANDLE[] = “CONFIG”;

…  
…

adl\_flhSubscribe(CONFIG\_STR\_HANDLE, 1);

---

<div class="post-metadata">

**Author:** ![sachin\_mishra](https://avatars.discourse-cdn.com/v4/letter/s/8baadc/32.png) [@sachin\_mishra](https://forum.sierrawireless.com/u/sachin_mishra)\
**Post date:** [March 16, 2007, 5:05am UTC](https://forum.sierrawireless.com/t/flash-subscription/1184/3 "2007-03-16T05:05:53Z")

</div>

hi  
thank for reply,  
for flash subscription we have to give the flash hdl and number of object.  
then what is use of giving the object name.  
please take a look in the following code which i have written:

```
ascii flash_hdl1, flash_hdl2;	
s8 sReturn1,sReturn2;

```

typedef struct{  
char \*nam;  
}name;  
name men, women;  
–  
–  
–  
sReturn1 = adl\_flhSubscribe ( flash\_hdl1, 2 );  
sReturn2 = adl\_flhSubscribe ( flash\_hdl2, 4 );

both the functions return OK;  
–  
–

```
men.nam = "ABC";
women.nam = "XYZ";

adl_flhWrite ( flash_hdl1, 1, sizeof(men), (u8 *)&men );

```

this function return OK;

```
adl_flhWrite ( flash_hdl2, 3, sizeof(women), (u8 *)&women );

```

this function return ADL\_FLH\_RET\_ERR\_ID\_OUT\_OF\_RANGE;  
–  
–  
my doubt is:  
as we are getting different handle for each cellid, in application and data storage subcription  
can we get the different handle for the flash with variable/different objects range (10,20 etc.)

waiting for reply

---

<div class="post-metadata">

**Author:** ![tobias](https://avatars.discourse-cdn.com/v4/letter/t/c67d28/32.png) [@tobias](https://forum.sierrawireless.com/u/tobias)\
**Post date:** [March 16, 2007, 8:42am UTC](https://forum.sierrawireless.com/t/flash-subscription/1184/4 "2007-03-16T08:42:32Z")

</div>

If you look in the documentation you can clearly see that adl\_fldSubscribe expects a STRING as a handle.  
A unique string for each handle you want to use.

Are you sure that the subscriptions return OK or is it “already subscribed”? Which could be treated as OK, as you will get that every time the program starts unless you make sure to erase all flash objects between.

Clear the flash and check what they both return in its current form, then replace:  
ascii flash\_hdl1, flash\_hdl2;  
with:  
static const ascii flash\_hdl1[]=“men”;  
static const ascii flash\_hdl2[]=“women”;  
and see if you still have problems.

The way you have it written now suggest that both your handles point to the same objects, and you would therefore only get 2 ID’s available as the second subscription doesn’t happen, or it does happen but on write the OS can’t know which of them you want to work with.

---

<div class="post-metadata">

**Author:** ![tobias](https://avatars.discourse-cdn.com/v4/letter/t/c67d28/32.png) [@tobias](https://forum.sierrawireless.com/u/tobias)\
**Post date:** [March 16, 2007, 8:48am UTC](https://forum.sierrawireless.com/t/flash-subscription/1184/5 "2007-03-16T08:48:26Z")

</div>

> [@sachin\_mishra](#):
>
> my doubt is:  
> as we are getting different handle for each cellid, in application and data storage subcription  
> can we get the different handle for the flash with variable/different objects range (10,20 etc.)
> 
> waiting for reply

You are not “getting” a handle. You are providing the handle with the handle strings. The OS looks at the string to determine which flash objects you want to work with, so if you need to have different handles, you also need unique identifier strings.

---

<div class="post-metadata">

**Author:** ![colin-tfe](https://avatars.discourse-cdn.com/v4/letter/c/cdc98d/32.png) [@colin-tfe](https://forum.sierrawireless.com/u/colin-tfe)\
**Post date:** [March 16, 2007, 9:16am UTC](https://forum.sierrawireless.com/t/flash-subscription/1184/6 "2007-03-16T09:16:35Z")

</div>

Hi all !

Tobias is right ! From Wavecom FAQ :

> [@](#):
>
> Problem :  
> An Open-AT application subscribes to a set of FLASH objects. However, when trying to write, the adl\_flhWrite () API returns ADL\_FLH\_RET\_ERR\_ID\_OUT\_OF\_RANGE. As per subscription, the ID value provided for adl\_flhWrite () is inside the range of subscri
> 
> Solution :  
> This problem can occur if the same flash handle is subscribed again by the Open-AT application with larger number of objects than the previous subscription. There is a known limitation that if a handle which is already subscribed, is subscribed again, the numbers of objects under its purview are not changed. Hence, if adl\_flhWrite () for subsequent calls try to write to an ID which lies outside the purview of the previous subscription, ADL\_FLH\_RET\_ERR\_ID\_OUT\_OF\_RANGE will be returned.  
> To solve this problem, before executing the OAT application in debug mode, all the files present in “/project\_workspace/rte/objects” should be deleted (as this is the place where the objects to be written the flash are stored). In target mode, AT+WOPEN=3 command should be executed to clear the previous subscription of flash handle and its associated objects.
