My application handles a proprietary serial protocol.
Serail frames start by “EA” (0x45 0x41) adn end by .
For this reason I switch the UART1 in data mode, but I would like to be able to send my custom AT commands while in data mode.
I do have problem as well with atCmdCreate where i need to specify array pointer that will contain the value after the equal sign of the at comand.
This array sould be added the the cpbp at command.
If i use the name of the array as followes:
adl_atCmdCreate(“at+cpbp=“num””, FALSE, Handler, “*”, NULL);
With the above format I get search for the ascii vallue of -num- and not the value that is in the array pointer itself.
Adding the name of the array as follows after the comand itself will return an error.
Just sending the sprintf without relating it to the adl_atCmdCreat will not give me anything.
i did not understand what will sprintf contribute?
In order to use the at comand i need to specify the comand format in ascii to - ascii *atstr , is that correct?
as i said before adding the correct number to the at comand that i need to send is trivial ,
it is the format of the string itself and the why it appers inside the array returns the error after jumping into this adl on the debuugging stage.
I have tried to use b as the array that represents *atstr with the following options:
If you don’t know how to do that in a “normal” C program outside of Open-AT and ADL, then you obviously won’t be able to do it with the added complications of Open-AT and ADL!
So get it going in a plain, vanilla “ordinary” C application first.
Yes
That will give you a compiler error - it is not valid ‘C’ syntax
You haven’t specified a type for ‘b’
If you don’t specify a type, ‘C’ will always default to int , which is not what you require - so it will cause an error.
Again, this is standard ‘C’ stuff - nothing specifically to do with Wavecom, Open-AT, or ADL.
Here is an example of using sprintf to build a string and subsequently using that string:
#include <stdio.h>
int main( int argc, char* argv[] )
{
// Strings to be formed into the message
char hello_string[] = "Hello";
char world_string[] = "world";
// Buffer into which to build the message
char string_to_print[80];
// Build the message
sprintf( string_to_print, "%s, %s!\n", hello_string, world_string );
// Print it!
printf( string_to_print );
// all done.
return 0;
}
You should be able to build that using any standard ‘C’ compiler to run it on a standard host system (not Open-AT).
Then experiment with adapting it to form the AT Command that you require…
Once you have that working, then move it into your Open-AT application…
So you searched for a number that isn’t in the Phonebook - what result do you expect other than the error code indicating that the number isn’t in the Phonebook?!