XBEE_MODEGETLIST

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

NAME

xbee_modeGetList, xbee_modeGet  

SYNOPSIS

#include <xbee.h>

xbee_err xbee_modeGetList(char ***retList);

xbee_err xbee_modeGet(struct xbee *xbee, const char **mode);  

DESCRIPTION

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.  

Return Value

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

EXAMPLE

xbee_modeGetList()

#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);
 

AUTHOR

Attie Grande <attie@attie.co.uk>  

SEE ALSO

libxbee(3), xbee_setup(3), xbee_conGetTypes(3)


 

Index

NAME
SYNOPSIS
DESCRIPTION
Return Value
EXAMPLE
AUTHOR
SEE ALSO

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