HSL 2.0 Framework
Description of the framework
|
All methods for communication via UDP multicast More..
.Inherits hsl20_4_udp.hsl20_4_udp.UdpBase
Public Member Functions | |
def | set_address (self, server_ip, multicast_ip, port) |
Sets the server address and multicast address where data can be received and sent. More... | |
def | send (self, data) |
Sends data to the multicast group. More... | |
def | start_server (self) |
Starts the UDP receive server. More... | |
![]() | |
def | __init__ (self, framework, context_map) |
Constructor. More... | |
def | set_on_data (self, callback) |
Sets a callback for data reception. More... | |
def | set_on_error (self, callback) |
Sets a callback in case of an error. More... | |
def | start_server (self) |
Starts the UDP receive server. More... | |
All methods for communication via UDP multicast
Provides communication via UDP/IP in both directions.
Is derived from UdpBase.
Example
Example 2 contains a Multicast UDP client. If a telegram arrives at input 1 (PIN_I_DATA), it is sent to the multicast group via UDP.
def hsl20_4_udp.hsl20_4_udp.multicast.send | ( | self, | |
data | |||
) |
Sends data to the multicast group
data | string Data |
AttributeError | Is triggered if no multicast address or port has been defined yet |
def hsl20_4_udp.hsl20_4_udp.multicast.set_address | ( | self, | |
server_ip, | |||
multicast_ip, | |||
port | |||
) |
Sets the server address and multicast address where data can be received and sent
server_ip | string IP address. If an empty string is specified, the data is received at the HomeServer network address |
multicast_ip | string Multicast address. Specifies the multicast group where the data can be received and sent |
port | int IP port where the data can be received and sent |
RuntimeError | If this method is called while the server is already started, a RuntimeError exception is thrown |
def hsl20_4_udp.hsl20_4_udp.multicast.start_server | ( | self | ) |
Starts the UDP receive server