xbee_err xbee_modeGetList(char ***retList);
xbee_err xbee_modeGet(struct xbee *xbee, const char **mode);
xbee_modeGetList() allows you to retrieve a list of modes that are build into libxbee. Once you have used the returned array, you should free() the pointer to avoid memory leaks. The last item in the array is set to NULL to mark the end.
xbee_modeGet() returnes the mode that the given libxbee instance is running. The pointer returned should NOT be free()'d.
#include <xbee.h> char **modes; int i; if (xbee_modeGetList(&modes) != XBEE_ENONE) return; for (i = 0; modes[i]; i++) { printf("mode %d: %s\n", i, modes[i]); } free(modes);
xbee_modeGet()
#include <xbee.h> struct xbee *xbee; char *mode; /* initialize xbee, using xbee_setup() */ if (xbee_modeGet(xbee, &mode) != XBEE_ENONE) return; printf("libxbee is running in '%s' mode\n", mode);