attie / libxbee3

A C/C++ library to aid the use of Digi XBee radios in API mode
GNU Lesser General Public License v3.0
68 stars 40 forks source link

single-core systems no longer suffer from delayed callback execution #5

Closed attie closed 9 years ago

attie commented 9 years ago

... continuation of #2

attie commented 9 years ago

@christophertfoo reported a bug on single-core systems that caused the callback execution to be delayed (see #2)

I've re-created the reported problems (on a single-core VM), and after applying this patch the issue no longer presents. To test, I applied the following patch to 2fad955 - to prevent the UART buffer from being cleared on startup.

diff --git a/xsys_linux.c b/xsys_linux.c
index 141d295..7778ebe 100644
--- a/xsys_linux.c
+++ b/xsys_linux.c
@@ -179,6 +179,7 @@ int xsys_serialSetup(struct xbee_serialInfo *info) {
        return XBEE_ESETUP;
    }

+#if 0
    /* purge buffer */
    {
        int flags;
@@ -200,6 +201,7 @@ int xsys_serialSetup(struct xbee_serialInfo *info) {
            return XBEE_ESETUP;
        }
    }
+#endif

 #ifndef linux
 /* for FreeBSD */

Then, using another XBee module I sent a number of messages, started the libxbee sample 3.simple_data and observed the reception of messages.

@christophertfoo: please confirm that this resolves the issue.

Attie

christophertfoo commented 9 years ago

@attie Looks good. I have tested it on my system and this resolves the issue.

Thanks! Chris

attie commented 9 years ago

Great! No problem :)