andrew_zx 发表于 2007-10-17 17:44:45

怎么替换data.ws中预期的数据包,谢谢

以下的是log,很明显看出来,回放所接受到的数据和录制时接收到的数据不符

Action.c(35): Notify: Parameter Substitution: parameter "random" ="101"
================================EXPECTED BUFFER================================
        "<?xml version='1.0'?><stream:stream xmlns:stream='http://etherx.jabber.org"
        "/streams' xmlns='jabber:client' from='v1.im.net' version='1.0' id='o6y9"
        "w81hxq80laly179nf1isdaf04opsvo2rw101'>"
===============================================================================
Action.c(35): getAsciiReceivedBuffer: Wed Oct 17 15:50:46.640: Translate data for printing
Action.c(35): getAsciiReceivedBuffer: Wed Oct 17 15:50:46.640: Binary to ascii
================================RECEIVED BUFFER================================
        "<?xml version='1.0'?><stream:stream xmlns:stream='http://etherx.jabber.org"
        "/streams' xmlns='jabber:client' from='v1.im.net' version='1.0' id='dhqv"
        "pmmnck75qedf1gjwh0vvblictfj6xa2nwpa9'><stream:features xmlns:stream='http:"
        "//etherx.jabber.
org/streams'><starttls xmlns='urn:ietf:params:xml:ns:xmpp-"
        "tls'/></stream:features>"
===============================================================================
Action.c(35): callRecv:320 bytes were received


------------------------------------

以下是action里这个错误的出处,是在接收buf3时出现的不符

    lrs_set_recv_timeout2(1,0);

    lrs_send("socket1", "buf2", LrsLastArg);

    lrs_receive("socket1", "buf3", LrsLastArg);

--------------------

buf3 预期的数据和实际得到的数据在上面的log中有

我现在知道的是要做参数化,但是应该在哪里写,还有截取的哪些内容的时候应该怎么做,刚刚接触LR,又要完成项目,不胜感激,能否帮忙一下

nataliedu 发表于 2008-1-31 11:24:23

贴几个函数楼上参考一下:
lrs_get_last_received_buffer("socket2", &ActualBuffer, &NumberOfBytes);
lrs_save_param_ex("socket2", "user", ActualBuffer, 3, 3, "ascii", "new_parameter");
lrs_free_buffer(ActualBuffer);

yxd2006 发表于 2012-6-10 16:58:28

学习中……
页: [1]
查看完整版本: 怎么替换data.ws中预期的数据包,谢谢