How to use the bacpypes.consolelogging.ConfigArgumentParser function in bacpypes

To help you get started, we’ve selected a few bacpypes examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github JoelBender / bacpypes / samples / MultipleReadPropertyThreaded.py View on Github external
def main():
    global this_application

    # parse the command line arguments
    args = ConfigArgumentParser(description=__doc__).parse_args()

    if _debug: _log.debug("initialization")
    if _debug: _log.debug("    - args: %r", args)

    # make a device object
    this_device = LocalDeviceObject(ini=args.ini)
    if _debug: _log.debug("    - this_device: %r", this_device)

    # make a simple application
    this_application = BIPSimpleApplication(this_device, args.ini.address)

    # create a thread and
    read_thread = ReadPointListThread(point_list)
    if _debug: _log.debug("    - read_thread: %r", read_thread)

    # start it running when the core is running
github JoelBender / bacpypes / samples / ReadWriteEventMessageTexts.py View on Github external
def main():
    global this_application, context

    # parse the command line arguments
    parser = ConfigArgumentParser(description=__doc__)
    parser.add_argument(
        "address",
        help="address of server",
        )
    parser.add_argument(
        "objid",
        help="object identifier",
        )
    args = parser.parse_args()

    if _debug: _log.debug("initialization")
    if _debug: _log.debug("    - args: %r", args)

    # set the context, the collection of the above parameters
    context = args.address, args.objid
    if _debug: _log.debug("    - context: %r", context)
github JoelBender / bacpypes / samples / MultipleReadPropertyHammer.py View on Github external
def main():
    global args, this_application

    # parse the command line arguments
    parser = ConfigArgumentParser(description=__doc__)

    # add an option to override the interval time
    parser.add_argument('--interval', type=float,
        help="amount of time between intervals",
        default=INTERVAL,
        )

    # parse the command line arguments
    args = parser.parse_args()

    if _debug: _log.debug("initialization")
    if _debug: _log.debug("    - args: %r", args)

    # make a device object
    this_device = LocalDeviceObject(
        objectName=args.ini.objectname,
github VOLTTRON / volttron / scripts / bacnet / bacnet_scan.py View on Github external
request.deviceInstanceRangeHighLimit = int(args[1])
            if _debug: WhoIsIAmConsoleCmd._debug("    - request: %r", request)

            # give it to the application
            this_application.request(request)

        except Exception, e:
            WhoIsIAmConsoleCmd._exception("exception: %r", e)

#
#   __main__
#


# parse the command line arguments
arg_parser = ConfigArgumentParser(description=__doc__)

arg_parser.add_argument("--address",
                        help="Target only device(s) at <address> for request" )

arg_parser.add_argument("--range", type=int, nargs=2, metavar=('LOW', 'HIGH'),
                        help="Lower and upper limit on device ID in results" )

arg_parser.add_argument("--timeout", type=int, metavar=('SECONDS'),
                        help="Time, in seconds, to wait for responses. Default: %(default)s",
                        default = 5)

arg_parser.add_argument("--csv-out", dest="csv_out",
                        help="Write results to the CSV file specified.")


</address>
github JoelBender / bacpypes / samples / ReadPropertyMultiple.py View on Github external
def main():
    global this_application

    # parse the command line arguments
    args = ConfigArgumentParser(description=__doc__).parse_args()

    if _debug: _log.debug("initialization")
    if _debug: _log.debug("    - args: %r", args)

    # make a device object
    this_device = LocalDeviceObject(ini=args.ini)
    if _debug: _log.debug("    - this_device: %r", this_device)

    # make a simple application
    this_application = BIPSimpleApplication(this_device, args.ini.address)

    # make a console
    this_console = ReadPropertyMultipleConsoleCmd()
    if _debug: _log.debug("    - this_console: %r", this_console)

    # enable sleeping will help with threads
github JoelBender / bacpypes / samples / WritePropertyTCPServer.py View on Github external
def main():
    global args, this_application

    # parse the command line arguments
    parser = ConfigArgumentParser(description=__doc__)
    parser.add_argument(
        "host", nargs='?',
        help="listening address of server or 'any' (default %r)" % (SERVER_HOST,),
        default=SERVER_HOST,
        )
    parser.add_argument(
        "port", nargs='?', type=int,
        help="server port (default %r)" % (SERVER_PORT,),
        default=SERVER_PORT,
        )
    parser.add_argument(
        "--idle-timeout", nargs='?', type=int,
        help="idle connection timeout",
        default=IDLE_TIMEOUT,
        )
    parser.add_argument(
github JoelBender / bacpypes / samples / ReadObjectList.py View on Github external
def main():
    global this_device
    global this_application

    # parse the command line arguments
    parser = ConfigArgumentParser(description=__doc__)

    # add an argument for interval
    parser.add_argument('device_id', type=int,
          help='device identifier',
          )

    # add an argument for interval
    parser.add_argument('device_addr', type=str,
          help='device address',
          )

    # parse the args
    args = parser.parse_args()

    if _debug: _log.debug("initialization")
    if _debug: _log.debug("    - args: %r", args)
github JoelBender / bacpypes / samples / DeviceDiscovery.py View on Github external
def main():
    global this_device
    global this_application

    # parse the command line arguments
    args = ConfigArgumentParser(description=__doc__).parse_args()

    if _debug: _log.debug("initialization")
    if _debug: _log.debug("    - args: %r", args)

    # make a device object
    this_device = LocalDeviceObject(ini=args.ini)
    if _debug: _log.debug("    - this_device: %r", this_device)

    # make a simple application
    this_application = DiscoveryApplication(this_device, args.ini.address)

    # make a console
    this_console = DiscoveryConsoleCmd()
    if _debug: _log.debug("    - this_console: %r", this_console)

    # enable sleeping will help with threads
github JoelBender / bacpypes / samples / ReadPropertyMultipleServer.py View on Github external
def main():
    # parse the command line arguments
    args = ConfigArgumentParser(description=__doc__).parse_args()

    if _debug: _log.debug("initialization")
    if _debug: _log.debug("    - args: %r", args)

    # make a device object
    this_device = LocalDeviceObject(ini=args.ini)
    if _debug: _log.debug("    - this_device: %r", this_device)

    # make a sample application
    this_application = ReadPropertyMultipleApplication(this_device, args.ini.address)

    # make a random input object
    ravo1 = RandomAnalogValueObject(
        objectIdentifier=('analogValue', 1), objectName='Random1',
        eventMessageTexts=ArrayOf(CharacterString)(["hello"]),
        )