예제 #1
0
 def __init__(self):
     self.c = Client('c4', 26000, 'ff01::1')
     self.c.subscribe("pelle", DetailedCallback(self.printFrame))
     self.c.subscribe("mo.*", DetailedCallback(self.printFrame))
     self.c.subscribe("moj.*", DetailedCallback(self.printFrame))
     t = Thread(target=self.c.run)
     t.daemon = True
     t.start()
예제 #2
0
class hepp():
  def __init__(self):
     self.c = Client('c1', 26000, 'ff01::1')
     self.c.registerBusInterface("print", Callback(self.printFrame))
     t = Thread(target=self.c.run)
     t.daemon = True
     t.start()

  def printFrame(self, message):
      print (message)
      return "This was Fun."
예제 #3
0
class hepp():
    def __init__(self):
        self.c = Client('c3', 26000, 'ff01::1')
        t = Thread(target=self.c.run)
        t.daemon = True
        t.start()

    def publish(self, channel):
        reply = self.c.publish("This is a message" + channel, channel)
        print(reply)
예제 #4
0
class hepp():
  def __init__(self):
     self.c = Client('c2', 26000, 'ff01::1')
     t = Thread(target=self.c.run)
     t.daemon = True
     t.start()

  def request(self):
      reply = self.c.request('c1', 'print', "This is a message", 10)
      print(reply)
예제 #5
0
class hepp():
    def __init__(self):
        self.c = Client('c4', 26000, 'ff01::1')
        self.c.subscribe("pelle", DetailedCallback(self.printFrame))
        self.c.subscribe("mo.*", DetailedCallback(self.printFrame))
        self.c.subscribe("moj.*", DetailedCallback(self.printFrame))
        t = Thread(target=self.c.run)
        t.daemon = True
        t.start()

    def printFrame(self, senderId, topic, mid, message):
        print(topic + "#" + message)

    def unsubscribe(self):
        self.c.unsubscribe("mo.*")
예제 #6
0
 def __init__(self):
    self.c = Client('c1', 26000, 'ff01::1')
    self.c.registerBusInterface("print", Callback(self.printFrame))
    t = Thread(target=self.c.run)
    t.daemon = True
    t.start()
예제 #7
0
 def __init__(self):
     self.c = Client('c3', 26000, 'ff01::1')
     t = Thread(target=self.c.run)
     t.daemon = True
     t.start()