phpDocumentor eibnetmux
[ class tree: eibnetmux ] [ index: eibnetmux ] [ all elements ]

Class: eibnetmux

Source Location: /eibnetmux.php

Class eibnetmux

Class Overview

Class implementing the client interface with the eibnetmux server.

Use this class to access the KNX bus via an eibnetmux server. It creates and sends the correct requests to the server, receives the responses and extracts the required information.

Located in /eibnetmux.php [line 423]



		
		
		
		

Methods

[ Top ]
Method Summary
eibnetmux   __construct()   Instantiate an eibnetmux connection
integer   authenticate()   Authenticate to eibnetmux server.
integer   close()   Close connection to eibnetmux server.
Result   mgmt_close_session()   Forcibly close a client session
integer   mgmt_connect()   Manage connection of eibnetmux server's client to N148/21 IP Interface.
array   mgmt_getaccessblock()   Return access block level of eibnetmux server.
integer   mgmt_getAPIversion()   Return API version of eibnetmux PHP client library interface.
array   mgmt_getloglevel()   Return log level of eibnetmux server.
array   mgmt_getstatus()   Get status of eibnetmux server.
integer   mgmt_setaccessblock()   Set access block level of eibnetmux server.
integer   mgmt_setloglevel()   Set log level of eibnetmux server.
integer   open()   Open connection to eibnetmux server.
array   read()   Read value of KNX logical group from bus.
integer   write()   Send value to KNX logical group on bus.

[ Top ]
Methods
Constructor __construct  [line 457]

  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:
Access:  public


[ Top ]
authenticate  [line 537]

  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


[ Top ]
close  [line 508]

  integer close( )

Close connection to eibnetmux server.


API Tags:
Return:  Result code: 0=ok, <0: error
Access:  public


[ Top ]
mgmt_close_session  [line 847]

  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


[ Top ]
mgmt_connect  [line 826]

  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


[ Top ]
mgmt_getaccessblock  [line 793]

  array mgmt_getaccessblock( )

Return access block level of eibnetmux server.


API Tags:
Return:  Result array, elements 'status', 'level' (if status=0)


[ Top ]
mgmt_getAPIversion  [line 701]

  integer mgmt_getAPIversion( )

Return API version of eibnetmux PHP client library interface.


API Tags:
Return:  -1: no connection established, >0: version


[ Top ]
mgmt_getloglevel  [line 765]

  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)


[ Top ]
mgmt_getstatus  [line 870]

  array mgmt_getstatus( )

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'


[ Top ]
mgmt_setaccessblock  [line 804]

  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


[ Top ]
mgmt_setloglevel  [line 783]

  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


[ Top ]
open  [line 480]

  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


[ Top ]
read  [line 613]

  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


[ Top ]
write  [line 648]

  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


[ Top ]

Documentation generated on Tue, 08 Sep 2009 00:09:16 +0200 by phpDocumentor 1.4.1