Create a new project


#1

Hello everyone,

I’m trying to create a new project in C++ that sends an AT command to the target. I wrote the command from the “BUG_BASIC_DEVELOPMENT GUIDE FOR OPEN AT V310_REV012.PDF” page 30. When i do debug i get the following errors.

The program is:

#include “adl_global.h”
#include “wm_types.h”
#include “wm_apm.h”
#include “appli.h”
#include “wm_at.h”

u32 wm_apmCustomStack [ 256 ];
const u16 wm_apmCustomStackSize = sizeof ( wm_apmCustomStack );

void adl_main ( adl_InitType_e InitType )
{
TRACE (( 1, “Embedded Application : Main” ));

// TO DO : Add your initialization code here

wm_atSend_command(16,WM_AT_SEND_RSP_TO_EMBEDDED,“ATD1234567890\r”);

}

Deleting intermediate files and output files for project ‘new_rte - Win32 Debug’.
--------------------Configuration: new_rte - Win32 Debug--------------------
Compiling…
appli.c
c:\new\src\appli.c(17) : warning C4013: ‘wm_atSend_command’ undefined; assuming extern returning int
Linking…
LINK : warning LNK4075: ignoring /EDITANDCONTINUE due to /INCREMENTAL:NO specification
Creating library rte/vc6/Debug/new_rte.lib and object rte/vc6/Debug/new_rte.exp
LINK : warning LNK4098: defaultlib “MSVCRT” conflicts with use of other libs; use /NODEFAULTLIB:library
appli.obj : error LNK2001: unresolved external symbol _wm_atSend_command
rte/vc6/Debug/new_rte.dll : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

new_rte.dll - 2 error(s), 3 warning(s)

How can i solve this errors?

I’d appreciate your help.


#2

Did you start with the Open-AT Project Wizard?


#3

Yes i did the steps and when i tried to compile it i got these errors.


#4

Hi takis,

I think the spelling should be “wm_atSendCommand” (that was the spelling in OpenAT 3.01). Please note the capital “C” and no second underscore. I don’t think this name changed in OpenAT 3.10…

Best Regards,
Jan


#5

Thanks for your reply, i had made a mistake.
I removed some libraries because i don’t know if it is necessary to include them and now i have only one error.

#include “adl_global.h”

u32 wm_apmCustomStack [ 256 ];
const u16 wm_apmCustomStackSize = sizeof ( wm_apmCustomStack );

void adl_main ( adl_InitType_e InitType )
{
TRACE (( 1, “Embedded Application : Main” ));

// TO DO : Add your initialization code here*/
wm_atSendCommand(16,WM_AT_SEND_RSP_TO_EMBEDDED,"ATD6948199512\r");

}

Deleting intermediate files and output files for project ‘new_rte - Win32 Debug’.
--------------------Configuration: new_rte - Win32 Debug--------------------
Compiling…
appli.c
c:\new\src\appli.c(13) : warning C4013: ‘wm_atSendCommand’ undefined; assuming extern returning int
c:\new\src\appli.c(13) : error C2065: ‘WM_AT_SEND_RSP_TO_EMBEDDED’ : undeclared identifier
Error executing cl.exe.

new_rte.dll - 1 error(s), 1 warning(s)

I’d appreciate your help.


#6

Thanks for your reply, i had made a mistake.
I removed some libraries because i don’t know if it is necessary to include them and now i have only one error.

#include “adl_global.h”

u32 wm_apmCustomStack [ 256 ];
const u16 wm_apmCustomStackSize = sizeof ( wm_apmCustomStack );

void adl_main ( adl_InitType_e InitType )
{
TRACE (( 1, “Embedded Application : Main” ));

// TO DO : Add your initialization code here*/
wm_atSendCommand(16,WM_AT_SEND_RSP_TO_EMBEDDED,"ATD6948199512\r");

}

Deleting intermediate files and output files for project ‘new_rte - Win32 Debug’.
--------------------Configuration: new_rte - Win32 Debug--------------------
Compiling…
appli.c
c:\new\src\appli.c(13) : warning C4013: ‘wm_atSendCommand’ undefined; assuming extern returning int
c:\new\src\appli.c(13) : error C2065: ‘WM_AT_SEND_RSP_TO_EMBEDDED’ : undeclared identifier
Error executing cl.exe.

new_rte.dll - 1 error(s), 1 warning(s)

I’d appreciate your help.


#7

Oh, that’s right… There is an other mistake. You are mixing ADL with the classic OpenAT…

If you would like to use ADL, you should read the ADL User Guide (AUG) and not the BUG. You will need to use the adl_atCmdCreate function instead of wm_atSendCommand().

Best Regards,
Jan


#8

I have just understand what you mean but i want to use this command ( wm_atSendCommand(16,WM_AT_SEND_RSP_TO_EMBEDDED,“ATD6948199512\r”); ) in order to send an AT command from a C++ program.

How can i do it? Is it possible?

I’d appreciate your help.


#9

Hi again,

as awneil said, you should start with the Open-AT Project Wizard to create the project files. In this program you must not choose ADL. Instead you will need to use (I think it is called) basic API.

Then you can use the command…

If you are starting a new project, you should consider using ADL. Sending AT commands from the application you still will be able to do, but the function you will use then is the the adl_atCmdCreate…

ADL is much more flexible and is better supported by Wavecom. For example if you would like to do TCP/IP one day you will not get around using ADL…

Best Regards,
Jan


#10

Hello everyone,
Thank you for your help!
Now, I have another problem. I did the program as it is shown below.
The steps that I did are:

  1. I sent the program to the target.
  2. I entered the PINCODE in order to enter to the network.
  3. Then I ran the application using the following commands in order to make a call.
    at+wopen=2
    +WOPEN: 2,“AT v03.10”,“AT v03.10”
    OK
    at+wopen=1
    OK
    The target doesn’t make the call.
    What am I doing wrong?

The program is:
#include “wm_types.h”
#include “wm_apm.h”

#define wm_apmCustomStackSize 1024
u32 wm_apmCustomStack1[ wm_apmCustomStackSize / 4 ];
u32 wm_apmCustomStack2[ wm_apmCustomStackSize / 4 ];
u32 wm_apmCustomStack3[ wm_apmCustomStackSize / 4 ];

s32 wm_apmAppliInit1 ( wm_apmInitType_e InitType )
{
wm_osDebugTrace ( 1, “Embedded Application Task 1 Init” );

// TO DO : Add your initialization code here
wm_atSendCommand(16, WM_AT_SEND_RSP_TO_EMBEDDED, "ATD6997106773\r");
return OK;

}

I’d appreciate your help.


#11

Firstly, you should switch the modem into safe mode with the “Safe target” button of Remote Tasks Monitor.
Without it, the device remains debug mode and your program won’t run.

Best regards

[quote=“takis”]


at+wopen=2
+WOPEN: 2,“AT v03.10”,“AT v03.10”
OK
at+wopen=1
OK
The target doesn’t make the call.

What am I doing wrong?