Beispiel #1
0
def queryHandler(msgRef, t1, clientData):
    print "queryHandler: Receiving %s [%s]",  \
   (IPC.IPC_msgInstanceName(msgRef), clientData)
    IPC.IPC_printData(IPC.IPC_msgInstanceFormatter(msgRef), sys.stdout, t1)

    # Publish this message -- all subscribers get it
    str1 = "Hello, world"
    print '\n  IPC.IPC_publishData(%s, "%s")' % (MSG2, str1)
    IPC.IPC_publishData(MSG2, str1)

    t2 = T2()
    t2.str1 = str1
    # Variable length array of one element
    t2.t1 = [T1()]
    t2.t1[0] = t1
    t2.count = 1
    t2.status = ReceiveVal

    # Respond with this message -- only the query handler gets it
    print "\n  IPC.IPC_respondData(%s, %s, %s)" % (msgRef, RESPONSE1, t2)
    IPC.IPC_respondData(msgRef, RESPONSE1, t2)
Beispiel #2
0
def msg1Handler(msgRef, callData, clientData):
    print "msg1Handler: Receiving %s (%d) [%s] " % \
   (IPC.IPC_msgInstanceName(msgRef), callData, clientData)
Beispiel #3
0
def msg2Handler_3(msgRef, callData, clientData):
    (str1, ret) = IPC.IPC_unmarshallData(IPC.IPC_msgInstanceFormatter(msgRef),
                                         callData)
    print "msg2Handler: Receiving %s (%s) [%s]" % \
          (IPC.IPC_msgInstanceName(msgRef), str1, clientData)
    IPC.IPC_freeByteArray(callData)