def ArtNetConfigureReply(state, response): reply = ArtNetConfigMessages_pb2.Reply() reply.ParseFromString(response) print('Short Name: %s' % reply.options.short_name) print('Long Name: %s' % reply.options.long_name) print('Subnet: %d' % reply.options.subnet) wrapper.Stop()
def main(): # Set this appropriately device_alias = 1 global wrapper wrapper = ClientWrapper() client = wrapper.Client() artnet_request = ArtNetConfigMessages_pb2.Request() artnet_request.type = artnet_request.ARTNET_OPTIONS_REQUEST client.ConfigureDevice(device_alias, artnet_request.SerializeToString(), ArtNetConfigureReply) wrapper.Run()
def ArtNetConfigureReply(status, response): if status.Succeeded(): reply = ArtNetConfigMessages_pb2.Reply() reply.ParseFromString(response) print('Short Name: %s' % reply.options.short_name) print('Long Name: %s' % reply.options.long_name) print('Subnet: %d' % reply.options.subnet) else: print('Error: %s' % status.message, file=sys.stderr) global wrapper if wrapper: wrapper.Stop()
# # ola_artnet_params.py # Copyright (C) 2005 Simon Newton """Fetch some ArtNet parameters.""" __author__ = '[email protected] (Simon Newton)' from ola.ClientWrapper import ClientWrapper from ola import ArtNetConfigMessages_pb2 def ArtNetConfigureReply(state, response): reply = ArtNetConfigMessages_pb2.Reply() reply.ParseFromString(response) print('Short Name: %s' % reply.options.short_name) print('Long Name: %s' % reply.options.long_name) print('Subnet: %d' % reply.options.subnet) wrapper.Stop() # Set this appropriately device_alias = 1 wrapper = ClientWrapper() client = wrapper.Client() artnet_request = ArtNetConfigMessages_pb2.Request() artnet_request.type = artnet_request.ARTNET_OPTIONS_REQUEST client.ConfigureDevice(device_alias, artnet_request.SerializeToString(), ArtNetConfigureReply) wrapper.Run()