Compare commits

..

4 commits

Author SHA1 Message Date
Pierre-Lin Bonnemaison
d6b650147a
Merge pull request #192 from deajan/gammu-fix-unlock-sms
Don't bother to check SIM security status on successful unlock
2022-10-19 18:30:11 +02:00
Pierre-Lin Bonnemaison
9691ee45a0
Merge pull request #194 from deajan/gammu-utf8
Make sure Gammu always sends as UTF-8 format
2022-10-19 18:23:05 +02:00
Orsiris de Jong
4776b147e5
Make sure Gammu always sends as UTF-8 format 2022-10-19 00:46:29 +02:00
Orsiris de Jong
82021648a3
Don't bother to check SIM security status on successful unlock 2022-10-17 19:19:28 +02:00

View file

@ -195,7 +195,7 @@ namespace adapters;
'sendsms', 'sendsms',
'TEXT', 'TEXT',
escapeshellarg($destination), escapeshellarg($destination),
'-text', '-textutf8',
escapeshellarg($text), escapeshellarg($text),
'-validity', '-validity',
'MAX', 'MAX',
@ -338,7 +338,9 @@ namespace adapters;
{ {
return true; return true;
} }
// The command returns 123 on failed execution (even if SIM is already unlocked), and returns 0 if unlock was successful
// We can directly return true if command was succesful
$command_parts = [ $command_parts = [
'LC_ALL=C', 'LC_ALL=C',
'gammu', 'gammu',
@ -350,8 +352,13 @@ namespace adapters;
]; ];
$result = $this->exec_command($command_parts); $result = $this->exec_command($command_parts);
if (0 === $result['return'])
{
return true;
}
//Check security status //Check security status
// The command returns 0 regardless of the SIM security state
$command_parts = [ $command_parts = [
'LC_ALL=C', 'LC_ALL=C',
'gammu', 'gammu',