eibnetmux __construct(
string
$identifier, [string
$hostname = ""], [integer
$port = 4390]
)
|
|
Instantiate an eibnetmux connection
Parameters:
string |
$identifier: |
name or type of application/client connecting to eibnetmux |
string |
$hostname: |
name of host running eibnetmux |
integer |
$port: |
port on which eibnetmux is listening on |
API Tags:
integer authenticate(
string
$user, string
$password
)
|
|
Authenticate to eibnetmux server.
The eibnetmux server may be configured to restrict publicly accessible functionality. For example, the administrator may chose to generally disallow sending to the bus unless the user has been assigned special access rights.
Such users must authenticate to the server to take advantage of special access rights. Authentication is based on username & password which must be specified by the caller.
Parameters:
string |
$user: |
name of user to authenticate for |
string |
$password: |
user's password |
API Tags:
Return: | Result code: 0=ok, <0: error |
Access: | public |
Close connection to eibnetmux server.
API Tags:
Return: | Result code: 0=ok, <0: error |
Access: | public |
Result mgmt_close_session(
integer
$session_type, integer
$session_id
)
|
|
Forcibly close a client session
Parameters:
integer |
$session_type: |
session_type 1: EIBnet/IP clients, 2: socket clients |
integer |
$session_id: |
session_id id of session to close |
API Tags:
Return: | code: 0=ok, <0: library error, >0: server error |
integer mgmt_connect(
integer
$state
)
|
|
Manage connection of eibnetmux server's client to N148/21 IP Interface.
The eibnetmux server does not directly connect to the KNX bus but talks to a Siemens N148/21 IP interface (or compatible device). This device only supports one concurrent connection (which was the primary reason to develop eibnetmux in the first place). Sometimes although rarely, it is desired to use this connection for something else than the eibnetmux server (e.g. to directly connect ETS to the N148/21). Usually, you would have to stop the server to free the connection to the device, impacting all its connected clients.
Using this function, the eibnetmux server client connection can be temporarily closed and released to allow an other application to connect to the N148/21.
Parameters:
integer |
$state: |
0: disconnect client, 1: connect client |
API Tags:
Return: | Result code: 0=ok, <0: library error, >0: server error |
array mgmt_getaccessblock(
)
|
|
Return access block level of eibnetmux server.
API Tags:
Return: | Result array, elements 'status', 'level' (if status=0) |
integer mgmt_getAPIversion(
)
|
|
Return API version of eibnetmux PHP client library interface.
API Tags:
Return: | -1: no connection established, >0: version |
array mgmt_getloglevel(
)
|
|
Return log level of eibnetmux server.
The eibnetmux server client interface does not feature a command to directly request and return the server's log level. Instead, the server's status is retrieved and the log level extracted.
API Tags:
Return: | Result array, elements 'status', 'level' (if status=0) |
Get status of eibnetmux server.
API Tags:
Return: | Result array containing information about the eibnetmux server's status. Elements 'status' (must be 0), 'common', 'client', 'server', 'socketserver' |
integer mgmt_setaccessblock(
integer
$level
)
|
|
Set access block level of eibnetmux server.
Parameters:
integer |
$level: |
New access block level of eibnetmux server |
API Tags:
Return: | Result code: 0=ok, <0: library error, >0: server error |
integer mgmt_setloglevel(
integer
$level
)
|
|
Set log level of eibnetmux server.
Parameters:
integer |
$level: |
New log level of eibnetmux server |
API Tags:
Return: | Result code: 0=ok, <0: library error, >0: server error |
integer open(
[string
$hostname = "localhost"], [integer
$port = 4390]
)
|
|
Open connection to eibnetmux server.
Parameters:
string |
$hostname: |
name of host running eibnetmux |
integer |
$port: |
port on which eibnetmux is listening on |
API Tags:
Return: | Result code: 0=ok, <0: error |
Access: | public |
array read(
integer
$knxaddress
)
|
|
Read value of KNX logical group from bus.
This function accesses the KNX bus via the eibnetmux server (using our established connection). It sends a read request for the KNX logical group and waits for any device to respond. If a response is received, the sent value is returned to the caller. It is the caller's responsibility to interpret it.
Parameters:
integer |
$knxaddress: |
Address of KNX logical group |
API Tags:
Return: | Result is an array with elements 'status', 'length', and 'value' |
Access: | public |
integer write(
integer
$knxaddress, string
$data
)
|
|
Send value to KNX logical group on bus.
This function accesses the KNX bus via the eibnetmux server (using our established connection). The value to send must be a binary string of the following format:
- length (16-bit integer)
- data (byte stream, 'length' bytes)
Parameters:
integer |
$knxaddress: |
Address of KNX logical group |
string |
$data: |
Binary string containing data to send |
API Tags:
Return: | Result code: 0: ok, -1: library error, >0: server error |
Access: | public |