User Manual

Table Of Contents
RK-5409-5 Reference Kit User’s Guide 4-43
Example API Code
ListDevicesVC7 Code
The C file containing the code shown here can be found in the Programs directory:
Programs\MeshScape\examples\src\ListDevices
/*
* ListDevices.c
*
* Copyright (c) 2000-2005 Millennial Net, Inc. All Rights Reserved.
* Reproduction or modification is strictly prohibited without express
* written consent of Millennial Net.
*
* This example illustrates the basic operations of connecting to the i-Bean
* API and obtaining basic information about the devices in the network.
* It prints out the list of gateways, mesh nodes, and end nodes currently
* participating in the network, along with some information about each
* device.
*
* This project was built using Microsoft Visual C++ version 7.1, but should
* be compatible with other similar compiler versions.
*/
#include <iBeanAPI.h>
#include <iBeanAPI_IO.h>
#include <iBeanAPI_Utils.h>
#include <stdio.h>
#include <stdlib.h>
#ifndef __GNUC__
#include <conio.h>
#else
#include <mingw/conio.h>
/* #include <mingw/conio.h> */
#endif
/*
* This is the number of "words" in a network address. For example, the
* address "127.0.1" contains three words. The i-Bean protocol supports
* up to 8 words (64-bits), but the actual maximum is reduced in some
* product releases to optimize the packet size.
*/
#define MIN_DEVICEID_WORDS 3