Changed class name to Mqtt Service

This commit is contained in:
Salman Zafar 2019-03-11 15:24:24 +05:00
parent a65d3421e4
commit 199c767ddc
2 changed files with 4 additions and 2 deletions

View File

@ -32,7 +32,7 @@ class Mqtt
public function ConnectAndPublish($topic, $msg) public function ConnectAndPublish($topic, $msg)
{ {
$client = new phpMQTT($this->host,$this->port, rand(0,100), $this->cert_file, $this->debug); $client = new MqttService($this->host,$this->port, rand(0,100), $this->cert_file, $this->debug);
if ($client->connect(true)) if ($client->connect(true))
{ {

View File

@ -7,12 +7,14 @@
*/ */
namespace Salman\Mqtt\MqttClass; namespace Salman\Mqtt\MqttClass;
/* /*
A simple php class to connect/publish to an MQTT broker A simple php class to connect/publish to an MQTT broker
*/ */
/* phpMQTT */ /* phpMQTT */
class phpMQTT { class MqttService
{
private $socket; /* holds the socket */ private $socket; /* holds the socket */
private $msgid = 1; /* counter for message id */ private $msgid = 1; /* counter for message id */
public $keepalive = 10; /* default keepalive timmer */ public $keepalive = 10; /* default keepalive timmer */