Menu

Handling multiple telegrams

DrMad
2014-04-30
2014-05-21
  • DrMad

    DrMad - 2014-04-30

    Hi,
    Thank you for this extraordinary work on EIB first of all !

    Now I have this question:
    I am using the async code below to check events on a KNX bus, and that seems to work fine.
    How can I guarantee that I will not miss events (eg if I stay too long in the do_some_other_stuff routine, or if 2 events arrived "simultaneously") ?
    Thanks for your help on this (it is pretty urgent for me...)

    con = EIBSocketURL (ag[1]);
    if (!con)
    die ("Open failed");

    if (EIBOpen_GroupSocket_async (con, 0) == -1)
    die ("Connect failed");

    while (1) {
    if (EIB_Poll_Complete(con) != 0) {
    len = EIBGetGroup_Src (con, sizeof (buf), buf, &src, &dest);
    do_stuff(buf, &src, &dest);
    }
    do_some_other_stuff();
    }

     
    • Michael Markstaller

      From memory/AFAIR: you won't loose any telegram as long as
      do_some_other_stuff doesn't take forever.
      It's a socket (buffer-size unknown but it's pretty big)..

      Michael

      On 30.04.2014 12:09, DrMad wrote:

      Hi,
      Thank you for this extraordinary work on EIB first of all !

      Now I have this question:
      I am using the async code below to check events on a KNX bus, and that
      seems to work fine.
      How can I guarantee that I will not miss events (eg if I stay too long
      in the do_some_other_stuff routine, or if 2 events arrived
      "simultaneously") ?
      Thanks for your help on this (it is pretty urgent for me...)

      con = EIBSocketURL (ag[1]);
      if (!con)
      die ("Open failed");

      if (EIBOpen_GroupSocket_async (con, 0) == -1)
      die ("Connect failed");

      while (1) {
      if (EIB_Poll_Complete(con) != 0) {
      len = EIBGetGroup_Src (con, sizeof (buf), buf, &src, &dest);
      do_stuff(buf, &src, &dest);
      }
      do_some_other_stuff();
      }

       
      • DrMad

        DrMad - 2014-05-21

        Sorry, forgot to say "thank you" for the prompt reply...
        :)

         

Log in to post a comment.

MongoDB Logo MongoDB