Subscription part implemented and updated readme
This commit is contained in:
1 parent
6a8b433192
commit
77a8b9db13
1 file changed
+3
-3
@@ -91,7 +91,8 @@ use Salman\Mqtt\MqttClass\Mqtt;
|
||||
|
||||
public function SubscribetoTopic($topic)
|
||||
{
|
||||
Mqtt::ConnectAndSubscribe($topic, function($topic, $msg){
|
||||
$mqtt = new Mqtt();
|
||||
$mqtt->ConnectAndSubscribe($topic, function($topic, $msg){
|
||||
echo "Msg Received: \n";
|
||||
echo "Topic: {$topic}\n\n";
|
||||
echo "\t$msg\n\n";
|
||||
@@ -107,8 +108,7 @@ use Mqtt;
|
||||
|
||||
public function SubscribetoTopic($topic)
|
||||
{
|
||||
$mqtt = new Mqtt();
|
||||
$mqtt->ConnectAndSubscribe($topic, function($topic, $msg){
|
||||
Mqtt::ConnectAndSubscribe($topic, function($topic, $msg){
|
||||
echo "Msg Received: \n";
|
||||
echo "Topic: {$topic}\n\n";
|
||||
echo "\t$msg\n\n";
|
||||
|
||||
Reference in new issue
Block a user