XBEE_ATTACHEOFCALLBACK

Section: Linux Programmer's Manual (3)
Updated: 02-Mar-2012
Index Return to Main Contents
 

NAME

xbee_attachEOFCallback  

SYNOPSIS

#include <xbee.h>

xbee_err xbee_attachEOFCallback(struct xbee *xbee, void (*eofCallback)(struct xbee *xbee, void *rxInfo));  

DESCRIPTION

xbee_attachEOFCallback() allows you to be notified if an EOF occurs on the device. An EOF can occur if a USB Serial Adaptor is unplugged, or if the network server closes the connection. It is useful to know that an EOF has occured so that you can take action (e.g: warn the user).  

Return Value

On success this function will return XBEE_ENONE, otherwise an error number from enum xbee_errors (as specified in <xbee.h>)  

EXAMPLE

To configure an EOF callback:

#include <xbee.h>

void eek_eof(struct xbee *xbee, void *rxInfo) {
        printf("device failed - EOF\n");
        xbee_shutdown(xbee);
}

struct xbee *xbee;

/* initialize xbee, using xbee_setup() */

if (xbee_attachEOFCallback(xbee, eek_eof) != XBEE_ENONE) {
        /* alert of error */
}
 

AUTHOR

Attie Grande <attie@attie.co.uk>  

SEE ALSO

libxbee(3), xbee_setup(3), xbee_shutdown(3)


 

Index

NAME
SYNOPSIS
DESCRIPTION
Return Value
EXAMPLE
AUTHOR
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 13:52:19 GMT, August 11, 2019