based on phpMQTT class modified for running with Symcon (http://www.symcon.de)
More...
|
| __construct ($address, $port, $clientid) |
| IPSphpMQTT constructor.
|
|
| debugtxt ($func, $msg) |
| keep debug messages to retrieve from IPS module
|
|
| connect_auto ($clean=true, $will=NULL, $username=NULL, $password=NULL) |
| Auto connect function.
|
|
| connect ($clean=true, $will=NULL, $username=NULL, $password=NULL) |
| connects to the broker
|
|
| subscribe ($topics, $qos=0) |
| subscribes to topics
|
|
| disconnect () |
| sends a proper disconect cmd
|
|
| close () |
| sends a proper disconect, then closes the socket
|
|
| publish ($topic, $content, $qos=0, $retain=0) |
| publishes $content on a $topic
|
|
| proc ( $loop=true) |
| the processing loop for an "allways on" client
|
|
|
| $msgid = 1 |
| counter for message id
|
|
| $keepalive = 10 |
| default keepalive timer
|
|
| $timesinceping |
| host unix time, used to detect disconects
|
|
| $topics = array() |
| used to store currently subscribed topics
|
|
| $debug = false |
| debug flag
|
|
| $address |
| broker address
|
|
| $port |
| broker port
|
|
| $clientid |
| client id sent to brocker
|
|
| $will |
| stores the will of the client
|
|
| $debugmsg =array() |
| store debug messages for IPS
|
|
based on phpMQTT class modified for running with Symcon (http://www.symcon.de)
◆ __construct()
__construct |
( |
|
$address, |
|
|
|
$port, |
|
|
|
$clientid |
|
) |
| |
IPSphpMQTT constructor.
- Parameters
-
string | $address | Broker IP/Hostname |
int | $port | Broker Port |
string | $clientid | Client ID for broker |
◆ connect()
connect |
( |
|
$clean = true , |
|
|
|
$will = NULL , |
|
|
|
$username = NULL , |
|
|
|
$password = NULL |
|
) |
| |
connects to the broker
- Parameters
-
bool | $clean | should the client send a clean session flag |
string | $will | Last will |
string | $username | Broker Username (if needed) |
string | $password | Broker Password (if needed) |
- Returns
- bool
◆ connect_auto()
connect_auto |
( |
|
$clean = true , |
|
|
|
$will = NULL , |
|
|
|
$username = NULL , |
|
|
|
$password = NULL |
|
) |
| |
Auto connect function.
- Parameters
-
bool | $clean | should the client send a clean session flag |
string | $will | Last will |
string | $username | Broker Username (if needed) |
string | $password | Broker Password (if needed) |
- Returns
- bool success
◆ debugtxt()
keep debug messages to retrieve from IPS module
- Parameters
-
◆ proc()
the processing loop for an "allways on" client
- Parameters
-
boolean | $loop | boolean set true when you are doing other stuff in the loop good for watching something else at the same time |
- Returns
- boolean
◆ publish()
publish |
( |
|
$topic, |
|
|
|
$content, |
|
|
|
$qos = 0 , |
|
|
|
$retain = 0 |
|
) |
| |
publishes $content on a $topic
- Parameters
-
string | $topic | Topic to publish |
string | $content | Content to publish |
int | $qos | QOS to publish(0,1,2) |
int | $retain | |
◆ subscribe()
subscribe |
( |
|
$topics, |
|
|
|
$qos = 0 |
|
) |
| |
subscribes to topics
- Parameters
-
array | $topics | Array with topics to subscribe |
int | $qos | QOS setting (0,1 or 2) |
- Returns
- string
The documentation for this class was generated from the following file:
- C:/local/progs/ipsymcon/phpmodule/ipsymcon-phpmodule-by-Tommi/MQTTPUB/IPSphpMQTT.php