Menu

How to process all received data

2019-05-28
2019-05-28
  • Martin Poupa

    Martin Poupa - 2019-05-28

    Hi,

    I'm quite new with using ScriptCommunicator. I need to get whole data
    packet and then process it. The packet is coming over uart and it is
    delimited by STX and ETX characters (so it is easy to recognize the data
    packet). I'm using function dataReceivedSlot(data) to get the data, but
    this function is called asynchronously, so sometimes I'm getting just part
    of the packet and then in next call is available the other part, etc. Could
    you please advise how to get remaining data in case that the
    dataReceivedSlot returns just part of incoming data packet and on the other
    hand how to left the data coming from next packet in the input buffer (to
    be processed next time, when whole next packet is available).

    Thank you in advance for any hint.

    Regars, Martin

     
  • Stefan Zieker

    Stefan Zieker - 2019-05-28

    Hi Martin,

    you can find an example script in the attachment which prints all data between STX and ETX.
    I Hope this helps.

    Regards,
    Stefan

     

    Last edit: Stefan Zieker 2019-05-28
  • Martin Poupa

    Martin Poupa - 2019-05-28

    Hi Stefan,

    It helps a lot!
    Thank you for quick and perfect answer.

    Regards, Martin

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.