waqasaps2 / gsm-shield-arduino

This library can be used with GSM shield
0 stars 0 forks source link

call #7

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
How can this work if the phone number sent to SIM900 in the next format:

[code]
ATD
+420123456789
;
[/code]

???

Fix in call.cpp

void CallGSM::Call(char *number_string)
{
  if (CLS_FREE != gsm.GetCommLineStatus()) return;
  gsm.SetCommLineStatus(CLS_ATCMD);
  // ATDxxxxxx;<CR>
  gsm.SimpleWriteWOln("ATD");
  gsm.SimpleWriteWOln(number_string);    
  gsm.SimpleWrite(";");
  // 10 sec. for initial comm tmout
  // 50 msec. for inter character timeout
  gsm.WaitResp(10000, 50);
  gsm.SetCommLineStatus(CLS_FREE);
}

Original issue reported on code.google.com by dmg...@gmail.com on 15 Jan 2012 at 1:22

GoogleCodeExporter commented 8 years ago
On svn-69 this function is:

void CallGSM::Call(char *number_string)
{
  if (CLS_FREE != gsm.GetCommLineStatus()) return;
  gsm.SetCommLineStatus(CLS_ATCMD);
  // ATDxxxxxx;<CR>
  gsm.SimpleWrite("ATD");
  gsm.SimpleWrite(number_string);    
  gsm.SimpleWrite(";\r");
  // 10 sec. for initial comm tmout
  // 50 msec. for inter character timeout
  gsm.WaitResp(10000, 50);
  gsm.SetCommLineStatus(CLS_FREE);
}

No SimpleWriteWOln, but last '\r' seems odd.

Original comment by aapo.rantalainen on 16 Jan 2012 at 6:11

GoogleCodeExporter commented 8 years ago
Why? You tested the command on the real SIM900?

Original comment by dmg...@gmail.com on 16 Jan 2012 at 6:32

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
The difference between SimpleWriteWOln and SimpleWrite is the \r at the end ;) 
the first is without so the command is ATD+3933282343;

Original comment by martines...@gmail.com on 18 Jan 2012 at 10:03

GoogleCodeExporter commented 8 years ago

void SIMCOM900::SimpleWrite(char *comm)

{

    _cell.println(comm);

}

void SIMCOM900::SimpleWrite(const char *comm)

{

    _cell.println(comm);

}

void SIMCOM900::SimpleWrite(int comm)

{

    _cell.println(comm);

}

void SIMCOM900::SimpleWriteWOln(char *comm)

{

    _cell.print(comm);

}

http://arduino.cc/en/Serial/Println
Description
Prints data to the serial port as human-readable ASCII text followed by a 
carriage return character (ASCII 13, or '\r') AND A NEWLINE CHARACTER (ASCII 
10, or '\n').

Original comment by dmg...@gmail.com on 18 Jan 2012 at 10:54

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
You send this: ATD/r/n+3933282343/r/n;/r/r/n

Original comment by dmg...@gmail.com on 18 Jan 2012 at 10:59

GoogleCodeExporter commented 8 years ago
From sniffer

Original comment by dmg...@gmail.com on 18 Jan 2012 at 11:05

Attachments:

GoogleCodeExporter commented 8 years ago
Yes... but pay attention that the last one is _cell.print(comm); and not 
_cell.println(comm)
it is WithOut ln at the end ;)

Original comment by martines...@gmail.com on 18 Jan 2012 at 11:06

GoogleCodeExporter commented 8 years ago
Which code is correct?

1)
 gsm.SimpleWrite("ATD");
 gsm.SimpleWrite(number_string);    
 gsm.SimpleWrite(";\r");

2)
 gsm.SimpleWriteWOln("ATD");
 gsm.SimpleWriteWOln(number_string);    
 gsm.SimpleWrite(";");

Original comment by dmg...@gmail.com on 18 Jan 2012 at 11:14

GoogleCodeExporter commented 8 years ago
Cool the sniffer program.. Which is its name? :) 
OK I've checked...the solution is that the correct one is 
 gsm.SimpleWriteWOln("ATD");
 gsm.SimpleWriteWOln(number_string);    
 gsm.SimpleWrite(";");
But if you ask me why in the last version there is the first..I don't know. 
Sorry, I didn't understood your right suggestion in the first comment!
Thank you :)

Original comment by martines...@gmail.com on 18 Jan 2012 at 11:24

GoogleCodeExporter commented 8 years ago
> Which is its name? :) 
http://www.saleae.com/Logic

ps/ check all code, for example:

  gsm.SimpleWrite("GET ");

  gsm.SimpleWrite(path);

  gsm.SimpleWrite(" HTTP/1.0\nHost: ");

  gsm.SimpleWrite(server);

  gsm.SimpleWrite("\n");

  gsm.SimpleWrite("User-Agent: Arduino");

  gsm.SimpleWrite("\n\n");

  gsm.SimpleWrite(end_c);

and etc...

pps/ see attachment for email, HTTP, FTP for SIM900

Original comment by dmg...@gmail.com on 18 Jan 2012 at 11:48

Attachments:

GoogleCodeExporter commented 8 years ago
Thank you! 
For the PS (get method) it works, but now I'm going to check all the code.
I also fixed another point where there was the same mistake.
For PPS: For now I want to improve the stability and try to fix all bugs before 
start new implementations (I haven't a lot of time in this months). But if you 
want to try or just to publish some your functions, I can add you at the 
project. Let me know :)

Original comment by martines...@gmail.com on 18 Jan 2012 at 11:59

GoogleCodeExporter commented 8 years ago

Original comment by dmg...@gmail.com on 21 Jan 2012 at 4:45

GoogleCodeExporter commented 8 years ago
This issue section is not longer supported.
Please check the support page www.gsmlib.org 

Original comment by martines...@gmail.com on 6 Jul 2013 at 11:27