HSL 2.0 framework Description of the framework

Public Member Functions |Static Public Member Functions |List of all members
hsl20_4.hsl20_4.Framework Class Reference
Maps

all framework functionalities More..

## Public Member Functions
def | __init__ (self, homeserver_context, module_context, module_instance)
| Constructor. More...
def | get_homeserver_version (self)
| Returns the version of the firmware loaded on the machine. More...
def | get_homeserver_version_major (self)
| Returns the major release number of the firmware installed on the unit. More...
def | get_homeserver_version_minor (self)
| Returns the minor release number of the firmware installed on the unit. More...
def | get_homeserver_serial_id (self)
| Returns the serial number of the machine. More...
def | get_homeserver_private_ip (self)
| Returns the private IP address of this machine. More...
def | get_project_id (self)
| Returns the ID of the currently loaded project. More...
def | get_coordinates (self)
| Returns the coordinates given in the project for the calculation of the sun's position. More...
def | get_context (self)
| Returns the key of the module context. More...
def | get_instance_by_id (self, instance_id)
| Returns a block instance. More...
def | get_instance_from_module_by_id (self, module_context, instance_id)
| Returns a block instance. More...
def | create_http_server (self)
| Creates an instance of an HTTP server. More...
def | create_http_client (self)
| Creates an instance of an HTTP client. More...
def | create_tcp_client (self)
| Creates an instance of a TCP client. More...
def | create_udp_unicast (self)
| Creates an instance of a UDP unicast socket. More...
def | create_udp_broadcast (self)
| Creates an instance of a UDP broadcast socket. More...
def | create_udp_multicast (self)
| Creates an instance of a UDP multicast socket. More...
def | create_timer (self)
| Creates an instance of a timer. More...
def | create_interval (self)
| Creates an instance of an interval timer. More...
def | create_debug_section (self)
| Creates a section on the debug page of the HS/FS. More...
def | create_md5_hash (self)
| Creates an instance of the MD5 class. More...
def | create_sha1_hash (self)
| Creates an instance of SHA1 class. More...
def | create_sha224_hash (self)
| Creates an instance of the SHA2 class. More...
def | create_sha256_hash (self)
| Creates an instance of SHA2 class. More...
def | create_sha384_hash (self)
| Creates an instance of the SHA2 class. More...
def | create_sha512_hash (self)
| Creates an instance of the SHA2 class. More...
def | create_aes (self)
| Creates an instance of the AES class. More...
def | resolve_dns (self, host)
| Provides an IP address. More...

## Static Public Member Functions
def | get_framework_index ()
| Returns the version index of the framework. More...

## Detailed Description

Maps all framework functionalities

The class is automatically instantiated by the base module and should not be instantiated directly

Starting with version 2.0.5:
  Buggy behaviour in connection with timers fixed

## Constructor & Destructor Documentation

## ◆ __init__()

def hsl20_4.hsl20_4.framework.__init__ | ( |  | self,
|  |  | homeserver_context,
|  |  | module_context,
|  |  | module_instance
| ) |  |

Constructor

Warning
  An instance of this class is created by the block.

Parameters

  homeserver_context | object Reference to the HomeServer object structure
  module_context | string Key of the module context
  module_instance | function Block instance

## Member Function Documentation

## ◆ create_aes()

def hsl20_4.hsl20_4.framework.create_aes | ( |  | self | ) |

Creates an instance of the AES class

Used to decrypt/encrypt data using AES

Note
  To use this function, the module hsl20_4_crypto must be imported in the XML definition of the module

Returns
  hsl20_4_crypto.hsl20_4_crypto.AESCipher

## ◆ create_debug_section()

def hsl20_4.hsl20_4.Framework.create_debug_section | ( |  | self | ) |

Creates a section on the debug page of the HS/FS

Returns
  hsl20_4_debug_page.hsl20_4_debug_page.Section
  Section

## ◆ create_http_client()

def hsl20_4.hsl20_4.framework.create_http_client | ( |  | self | ) |

Creates an instance of an HTTP client

Note
  To use this function, the module hsl20_4_http_client must be imported in the XML definition of the module

Returns
  hsl20_4_http_client.hsl20_4_http_client.Client
  HTTP client

## ◆ create_http_server()

def hsl20_4.hsl20_4.framework.create_http_server | ( |  | self | ) |

Creates an instance of an HTTP server

Note
  To use this function, the module hsl20_4_http_server must be imported in the XML definition of the module

Returns
  hsl20_4_http_server.hsl20_4_http_server.Server
  HTTP server

## ◆ create_interval()

def hsl20_4.hsl20_4.framework.create_interval | ( |  | self | ) |

Creates an instance of an interval timer

Note
  To use this function, the module hsl20_4_timer must be imported in the XML definition of the module

Returns
  hsl20_4_timer.hsl20_4_timer.interval
  Interval Timer

## ◆ create_md5_hash()

def hsl20_4.hsl20_4.framework.create_md5_hash | ( |  | self | ) |

Creates an instance of the MD5 class

Creates a 128-bit MD5 hash value

Note
  To use this function, the module hsl20_4_crypto must be imported in the XML definition of the module

Returns
  hsl20_4_crypto.hsl20_4_crypto.MD5Hash
  128 bit long MD5 hash value

## ◆ create_sha1_hash()

def hsl20_4.hsl20_4.framework.create_sha1_hash | ( |  | self | ) |

Creates an instance of SHA1 class

Used to create a 160-bit SHA1 hash value

Note
  To use this function, the module hsl20_4_crypto must be imported in the XML definition of the module

Returns
  hsl20_4_crypto.hsl20_4_crypto.SHA1Hash
  160 bit long SHA1 hash value

## ◆ create_sha224_hash()

def hsl20_4.hsl20_4.framework.create_sha224_hash | ( |  | self | ) |

Creates an instance of SHA2 class

Used to create a 224-bit SHA2 hash value

Note
  To use this function, the module hsl20_4_crypto must be imported in the XML definition of the module

Returns
  hsl20_4_crypto.hsl20_4_crypto.SHA2Hash
  224 bit long SHA2 hash value

## ◆ create_sha256_hash()

def hsl20_4.hsl20_4.framework.create_sha256_hash | ( |  | self | ) |

Creates an instance of the SHA2 class

Used to create a 256-bit SHA2 hash value

Note
  To use this function, the module hsl20_4_crypto must be imported in the XML definition of the module

Returns
  hsl20_4_crypto.hsl20_4_crypto.SHA2Hash
  256 bit long SHA2 hash value

## ◆ create_sha384_hash()

def hsl20_4.hsl20_4.framework.create_sha384_hash | ( |  | self | ) |

Creates an instance of the SHA2 class

Serves to create a 384 bit long SHA2 hash value

Note
  To use this function, the module hsl20_4_crypto must be imported in the XML definition of the module

Returns
  hsl20_4_crypto.hsl20_4_crypto.SHA2Hash
  384 bit long SHA2 hash value

## ◆ create_sha512_hash()

def hsl20_4.hsl20_4.framework.create_sha512_hash | ( |  | self | ) |

Creates an instance of the SHA2 class

Used to create 512 bit long SHA2 hash values

Note
  To use this function, the module hsl20_4_crypto must be imported in the XML definition of the module

Returns
  hsl20_4_crypto.hsl20_4_crypto.SHA2Hash
  512 bit long SHA2 hash value

## ◆ create_tcp_client()

def hsl20_4.hsl20_4.framework.create_tcp_client | ( |  | self | ) |

Creates an instance of a TCP client

Note
  To use this function, the module hsl20_4_tcp must be imported in the XML definition of the module

Returns
  hsl20_4_tcp.hsl20_4_tcp.Client
  TCP client

## ◆ create_timer()

def hsl20_4.hsl20_4.framework.create_timer | ( |  | self | ) |

Creates an instance of a timer

Note
  To use this function, the module hsl20_4_timer must be imported in the XML definition of the module

Returns
  hsl20_4_timer.hsl20_4_timer.Timer
  Timer

## ◆ create_udp_broadcast()

def hsl20_4.hsl20_4.framework.create_udp_broadcast | ( |  | self | ) |

Creates an instance of a UDP broadcast socket

Note
  To use this function, the module hsl20_4_udp must be imported in the XML definition of the module

Returns
  hsl20_4_udp.hsl20_4_udp.Broadcast
  UDP socket

## ◆ create_udp_multicast()

def hsl20_4.hsl20_4.framework.create_udp_multicast | ( |  | self | ) |

Creates an instance of a UDP multicast socket

Note
  To use this function, the module hsl20_4_udp must be imported in the XML definition of the module

Returns
  hsl20_4_udp.hsl20_4_udp.Multicast
  UDP socket

## ◆ create_udp_unicast()

def hsl20_4.hsl20_4.framework.create_udp_unicast | ( |  | self | ) |

Creates an instance of a UDP unicast socket

Note
  To use this function, the module hsl20_4_udp must be imported in the XML definition of the module

Returns
  hsl20_4_udp.hsl20_4_udp.Unicast
  UDP socket

## ◆ get_context()

def hsl20_4.hsl20_4.framework.get_context | ( |  | self | ) |

Returns the key of the module context

Returns
  string
  Key of the module context

## ◆ get_coordinates()

def hsl20_4.hsl20_4.framework.get_coordinates | ( |  | self | ) |

Returns the coordinates specified in the project for the calculation of the sun's position

Returns
  tuple
  (latitude, longitude)

From version 2.0.7:
  new method

## ◆ get_framework_index()

def hsl20_4.hsl20_4.framework.get_framework_index | ( |  | ) |
| static

Returns the version index of the framework

In this version the version index is 7

Returns
  int
  Index (=7)

## ◆ get_homeserver_private_ip()

def hsl20_4.hsl20_4.framework.get_homeserver_private_ip | ( |  | self | ) |

Returns the private IP address of this machine

Returns
  string
  IP address

## ◆ get_homeserver_serial_id()

def hsl20_4.hsl20_4.framework.get_homeserver_serial_id | ( |  | self | ) |

Returns the serial number of the machine

Returns
  string
  Serial number

## ◆ get_homeserver_version()

def hsl20_4.hsl20_4.framework.get_homeserver_version | ( |  | self | ) |

Returns the version of the firmware loaded on the device

Returns
  string
  Version of the firmware

## ◆ get_homeserver_version_major()

def hsl20_4.hsl20_4.framework.get_homeserver_version_major | ( |  | self | ) |

Returns the major release number of the firmware installed on the unit

result int Major release number of the firmware

## ◆ get_homeserver_version_minor()

def hsl20_4.hsl20_4.framework.get_homeserver_version_minor | ( |  | self | ) |

Returns the minor release number of the firmware installed on the unit

result int Minor release number of the firmware

## ◆ get_instance_by_id()

def hsl20_4.hsl20_4.framework.get_instance_by_id | ( |  | self,
|  |  | instance_id
| ) |  |

Returns an instance of a block

Used for communication between two blocks. In the GLE, the ID can be made known to another block via direct wiring of the blocks.

The ID must be located within the module context.

Parameters

  instance_id | int Runtime ID of the building block

Returns
  object
  Instance of the block (inherited from BaseModule). Returns None if an invalid ID was passed

## ◆ get_instance_from_module_by_id()

def hsl20_4.hsl20_4.framework.get_instance_from_modules_by_id | ( |  | self,
|  |  | module_context,
|  |  | instance_id
| ) |  |

Returns a block instance

Parameters

  module_context | string Key of the module context
  instance_id | int Runtime ID of the building block

Returns
  object
  Instance of a block (inherited from BaseModule). Returns None if an invalid ID was passed

## ◆ get_project_id()

def hsl20_4.hsl20_4.framework.get_project_id | ( |  | self | ) |

Returns the ID of the currently loaded project

Returns
  string
  Project ID

## ◆ resolve_dns()

def hsl20_4.hsl20_4.Framework.resolve_dns | ( |  | self,
|  |  | host
| ) |  |

Returns an IP address

Uses the DNS service of the HS/FS to resolve the host name

Returns
  string
  IP address. Returns None if the address could not be resolved

Warning
  This call blocks until a response is received or the timeout expires

The documentation for this class was generated from the following file:

- hsl20_4.py