User's Manual
Table Of Contents
- MeshScape™ RK-5424-5 Reference Kit for 2.4 GHz MeshScape Systems User's Guide
- Contents
- About This Guide
- 1: Introduction
- 2: Installing the MeshScape System
- 3: Running MeshScape Network Monitor
- MeshScape Network Monitor Overview
- Configuring a Node’s Operation
- Labeling an End Node or Mesh Node
- Configuring Persistence Attributes
- Selecting a Com Port on the Host PC
- Configuring Serial and ADC Data Formats
- Turning Event Tracking On/Off
- Broadcasting Data to All Nodes.
- Creating an Event Log File
- Viewing the Contents of an Event Log File
- Viewing MeshScape Statistics
- 4: Using the MeshScape API
- A: Running the Demo Application
- B: Using MeshScape Programmer
- Glossary
- Index
RK-5424-5 Reference Kit User’s Guide 4-45
Example API Code
Example API Code
Millennial Net provides as part of the reference kit, several sample API applications to be
compiled under Windows and Linux. This section lists the source code for one of the API
examples, ListDevices. ListDevicesprovides a list of all detected network nodes (MeshGate, Mesh
Node(s), and End Node(s)).
The C file containing the code shown here can be found in the Programs directory:
C:\Program Files\MeshScape\examples\windows\ListDevices.c
/*
* 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, routers, and endpoints 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