DOT again!


in the link DOTA is described roughly…

I download new software using a listening TCP socket. Each TCP packet is 1000 bytes so I use the same cell of same ad handle, How can I increment the pointer of the cell each time new packet has camed. Because if I use only adl_adWrite function:

adl_adWrite(handle,size,data) … every newer packet is overwritten in handle. I must use same handle because

adl_adInstall(handle) function gets only one handle

what should I do?

I tried to first download all the *.dwl then write into flash but when file is larger then 64K I can’t malloc place in RAM!

Thanks in advance


I presume you want to download customer application (DOTA I).

First you have to know how large is your new application (max. length of wpb.dwl file). Assuming you have written quite a big appli:

#define DWL_CELL_ID  10         // cell ID
#define DWL_CELL_SIZE 256000    // size of dwl cell

Of course, cell size can be adjusted dinamically, but you allways have to assure that there is enough space in AD storage. If not, use adDelete and adFormat (you will loose some data, but who cares, your primary goal is to run new features!). Subscribe your dwl cell in AD storage:

DwlCell = adl_adSubscribe(DWL_CELL_ID, DWL_CELL_SIZE);

As data for your new application are comeing, they are saved packet after packet with:

Result = adl_adWrite(DwlCell, Len, Poi);

And finally all data are here, checksum is correct, you can install new appli with:

Result = adl_adFinalise(DwlCell);
Result = adl_adInstall(DwlCell);

If anything OK (check the Result var), the modem will reset and restart with your new appli.

In short:

  1. Implement a protocol, which announces download will follow.
  2. Announcement includes length of dwl file (wpb is packed and so shorter).
  3. Reserve enough space in AD storage within single cell.
  4. Write succesive data in that single cell.
  5. Protocol should include simple check of downloaded data.
  6. If check passes, finalize cell and install software.
  7. When new appli restarts, it can then delete DwlCell, to make room for app data.

OS download (DOTA II) folows the same procedure, but the cell must be larger.


thanks ljweko

excellent explanation…

I think “AT” is really “open” anymore! :smiley: