fix gammu adapter to remove number and update adapters to support or not sms reception
This commit is contained in:
parent
2ae2baa6c4
commit
f6e96c1133
|
@ -51,6 +51,11 @@ namespace adapters;
|
||||||
*/
|
*/
|
||||||
public static function meta_datas_fields(): array;
|
public static function meta_datas_fields(): array;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Does the implemented service support reading smss.
|
||||||
|
*/
|
||||||
|
public static function meta_support_read(): bool;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Does the implemented service support flash smss.
|
* Does the implemented service support flash smss.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -20,11 +20,6 @@ namespace adapters;
|
||||||
*/
|
*/
|
||||||
class GammuAdapter implements AdapterInterface
|
class GammuAdapter implements AdapterInterface
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Phone number using the adapter.
|
|
||||||
*/
|
|
||||||
private $number;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Datas used to configure interaction with the implemented service. (e.g : Api credentials, ports numbers, etc.).
|
* Datas used to configure interaction with the implemented service. (e.g : Api credentials, ports numbers, etc.).
|
||||||
*/
|
*/
|
||||||
|
@ -35,7 +30,7 @@ namespace adapters;
|
||||||
*
|
*
|
||||||
* @param json string $datas : JSON string of the datas to configure interaction with the implemented service
|
* @param json string $datas : JSON string of the datas to configure interaction with the implemented service
|
||||||
*/
|
*/
|
||||||
public function __construct(string $number, string $datas)
|
public function __construct(string $datas)
|
||||||
{
|
{
|
||||||
$this->datas = json_decode($datas, true);
|
$this->datas = json_decode($datas, true);
|
||||||
}
|
}
|
||||||
|
@ -89,6 +84,14 @@ namespace adapters;
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Does the implemented service support reading smss.
|
||||||
|
*/
|
||||||
|
public static function meta_support_read(): bool
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Does the implemented service support flash smss.
|
* Does the implemented service support flash smss.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -133,6 +133,14 @@ namespace adapters;
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Does the implemented service support reading smss.
|
||||||
|
*/
|
||||||
|
public static function meta_support_read(): bool
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Does the implemented service support flash smss.
|
* Does the implemented service support flash smss.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -81,6 +81,15 @@ namespace adapters;
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Does the implemented service support reading smss.
|
||||||
|
*/
|
||||||
|
public static function meta_support_read(): bool
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Does the implemented service support flash smss.
|
* Does the implemented service support flash smss.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -173,6 +173,11 @@ class Phone extends AbstractDaemon
|
||||||
$internal_received = new \controllers\internals\Received($this->bdd);
|
$internal_received = new \controllers\internals\Received($this->bdd);
|
||||||
$internal_setting = new \controllers\internals\Setting($this->bdd);
|
$internal_setting = new \controllers\internals\Setting($this->bdd);
|
||||||
|
|
||||||
|
if (!$this->adapter->meta_support_read())
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
$smss = $this->adapter->read();
|
$smss = $this->adapter->read();
|
||||||
if (!$smss)
|
if (!$smss)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue