Ejemplo n.º 1
0
        objectIdentifier=599,
        maxApduLengthAccepted=1024,
        segmentationSupported='segmentedBoth',
        vendorIdentifier=15,
    )
    app = BIPSimpleApplication(this_device, '10.81.0.14')

    # get the services supported
    services_supported = app.get_services_supported()
    _logger.info('    - services_supported: %s', services_supported)
    # this_device.protocolServicesSupported = services_supported.value

    loop = asyncio.get_event_loop()
    loop.set_debug(True)
    host = '192.168.2.70'
    device_id = 881000
    loop.run_until_complete(app.create_endoint())
    # loop.create_task(read_device_props(app, device_id, host))
    properties = {}
    loop.run_until_complete(discover_properties(app, device_id, host))
    loop.close()
    # prop_values = loop.run_until_complete(read_prop_values(app, host))
    # pprint(properties)

    for key, prop in properties.items():
        if prop['objectType'] == 'device':
            continue
        print(
            f'{key:<24}{prop["objectName"]!s:40.40}{prop["description"]!s:60.60} {prop["presentValue"]} {prop["units"]}'
        )