# Running Internal AT Commands

**URL:** <https://forum.sierrawireless.com/t/running-internal-at-commands/572>\
**Category:** Development tools\
**Created:** [July 17, 2006, 2:59pm UTC](https://forum.sierrawireless.com/t/running-internal-at-commands/572 "2006-07-17T14:59:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mark\_newbs](https://avatars.discourse-cdn.com/v4/letter/m/b77776/32.png) [@mark\_newbs](https://forum.sierrawireless.com/u/mark_newbs)\
**Post date:** [July 17, 2006, 2:59pm UTC](https://forum.sierrawireless.com/t/running-internal-at-commands/572/1 "2006-07-17T14:59:13Z")

</div>

Hello,  
I am starting to develop programs within the Open AT framework. I need to delete all the SMS messages that may be stored on the device once a day. I have created a loop that will subscribe to the timer and run a function every 24 hours. What code do I require to run the

AT+CMGD=1,4 (delete all messages)

Command? I have read about the adl\_atCmdCreate function but what port do I run it on so that it acts on the device running the software?

This task is probably really simple but I am having trouble getting my head around the inner workings of this process.

Thank you for any help

Mark

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [July 18, 2006, 11:01pm UTC](https://forum.sierrawireless.com/t/running-internal-at-commands/572/2 "2006-07-18T23:01:47Z")

</div>

> [@mark\_newbs](#):
>
> I have read about the adl\_atCmdCreate function but what port do I run it on so that it acts on the device running the software?

You don’t run it on a port - you just make the API call, and the Wavecom core executes the command.

The stuff about ports if for the case where you want responses from the command forwarded to a port; if you don’t want responses forwarded to a port (ie, your application “consumes” them), just set the Rspflag parameter to FALSE; EG,

```auto
// Delete all Text Messages
adl_atCmdCreate
( 
    "AT+CMGD=1,4", // Delete ALL messages
    FALSE, // Do not forward responses to the external app
    my_sms_response_handler, // Response Handler
    "*", // Subscribe to all responses
    NULL // Marks the end of the subscribed response list
);
```

Note that the v3.03 ADL User Guide, Rev 001, Dec 05, incorrectly states that Rspflag is a bool - but this is clearly not the case!

The prototype in adl\_CmdStackHandler.h declares it as a u16

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [July 18, 2006, 11:08pm UTC](https://forum.sierrawireless.com/t/running-internal-at-commands/572/3 "2006-07-18T23:08:48Z")

</div>

> [@I](#):
>
> Note that the v3.03 ADL User Guide, Rev 001, Dec 05, incorrectly states that Rspflag is a bool - but this is clearly not the case!
> 
> The prototype in adl\_CmdStackHandler.h declares it as a u16

Previously noted here: [wavecom.com/modules/movie/sc … tcmdcreate](http://www.wavecom.com/modules/movie/scenes/forums/viewtopic.php?t=444&highlight=adl_atcmdcreate)

---

<div class="post-metadata">

**Author:** ![mark\_newbs](https://avatars.discourse-cdn.com/v4/letter/m/b77776/32.png) [@mark\_newbs](https://forum.sierrawireless.com/u/mark_newbs)\
**Post date:** [July 19, 2006, 11:12am UTC](https://forum.sierrawireless.com/t/running-internal-at-commands/572/4 "2006-07-19T11:12:37Z")

</div>

Awneil,

Thank you for your reply, it was very helpful

Mark
