change method name to ConnectAndPublish
This commit is contained in:
parent
98ff2fe0f9
commit
0e3dc32f5d
|
|
@ -35,7 +35,7 @@ use Salman\Mqtt\MqttClass\Mqtt;
|
||||||
public function SendMsgViaMqtt($topic, $message)
|
public function SendMsgViaMqtt($topic, $message)
|
||||||
{
|
{
|
||||||
$mqtt = new Mqtt();
|
$mqtt = new Mqtt();
|
||||||
$output = $mqtt->ConnectAndSendMessage($topic, $message);
|
$output = $mqtt->ConnectAndPublish($topic, $message);
|
||||||
|
|
||||||
if ($output === true)
|
if ($output === true)
|
||||||
{
|
{
|
||||||
|
|
@ -48,4 +48,4 @@ public function SendMsgViaMqtt($topic, $message)
|
||||||
|
|
||||||
### Tested on php 7.3 and laravel 5.7
|
### Tested on php 7.3 and laravel 5.7
|
||||||
|
|
||||||
# Full documentation Coming Soon
|
# Full documentation Coming Soon
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ class Mqtt
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function ConnectAndSendMessage($topic, $msg)
|
public function ConnectAndPublish($topic, $msg)
|
||||||
{
|
{
|
||||||
$client = new phpMQTT($this->host,$this->port, rand(0,100), $this->cert_file, $this->debug);
|
$client = new phpMQTT($this->host,$this->port, rand(0,100), $this->cert_file, $this->debug);
|
||||||
|
|
||||||
|
|
@ -46,4 +46,5 @@ class Mqtt
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue