Beispiel #1
0
def on_pub(sub, pub, payload):
    print "Received on port %d" % dps.get_port_number(
        dps.subscription_get_node(sub))
    print "Pub %s(%d) matches:" % (dps.publication_get_uuid(pub),
                                   dps.publication_get_sequence_num(pub))
    print "  pub " + " | ".join(dps.publication_get_topics(pub))
    print "  sub " + " | ".join(dps.subscription_get_topics(sub))
    print payload
Beispiel #2
0
def on_pub(sub, pub, payload):
    print("Received on %s" %
          dps.get_listen_address(dps.subscription_get_node(sub)))
    print(
        "Pub %s(%d) matches:" %
        (dps.publication_get_uuid(pub), dps.publication_get_sequence_num(pub)))
    print("  pub " + " | ".join(dps.publication_get_topics(pub)))
    print("  sub " + " | ".join(dps.subscription_get_topics(sub)))
    print(payload.tobytes())
Beispiel #3
0
def on_pub(sub, pub, payload):
    print("Pub %s(%d) matches:" % (dps.publication_get_uuid(pub), dps.publication_get_sequence_num(pub)))
    print("  pub " + " | ".join(dps.publication_get_topics(pub)))
    print("  sub " + " | ".join(dps.subscription_get_topics(sub)))
    print(payload.tobytes())
    if dps.publication_is_ack_requested(pub):
        ack_msg = "This is an ACK from %s" % (dps.get_listen_address(dps.publication_get_node(pub)))
        print("Sending ack for pub UUID %s(%d)" % (dps.publication_get_uuid(pub), dps.publication_get_sequence_num(pub)))
        print("    %s" % (ack_msg))
        dps.ack_publication(pub, ack_msg);
Beispiel #4
0
def on_pub(sub, pub, payload):
    print "Pub %s(%d) matches:" % (dps.publication_get_uuid(pub), dps.publication_get_sequence_num(pub))
    print "  pub " + " | ".join(dps.publication_get_topics(pub))
    print "  sub " + " | ".join(dps.subscription_get_topics(sub))
    print payload
    if dps.publication_is_ack_requested(pub):
        ack_msg = "This is an ACK from %d" % (dps.get_port_number(dps.publication_get_node(pub)))
        print "Sending ack for pub UUID %s(%d)" % (dps.publication_get_uuid(pub), dps.publication_get_sequence_num(pub))
        print "    %s" % (ack_msg)
        dps.ack_publication(pub, ack_msg);