User Manual
Table Of Contents
- RK-5409-5 Reference Kit for 916 MHz MeshScape™ Systems
- 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
- Configuring Sample Interval of Single Node
- Configuring Sample Interval of all Network Nodes
- Configuring Digital I/O Operation
- Configuring UART Operation
- Configuring AD (analog-to-digital) Converter Operation
- Configuring RS-232 Operation (MN-5409 only)
- Configuring RS-485 Operation (MN-5409 only)
- Using Watch Function to Display Configuration Information
- 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: Sample Application
- B: Performing Firmware Upgrades and Configuring Device IDs
- Glossary
- Index
4-44 Millennial Net
Using the MeshScape API
/***************************************************************************/
void WaitForKey(void) {
printf("\r\nPress any key to close...");
_getch();
printf("\r\n");
}
/****************************************************************************
* This is a simple wrapper for detecting and reporting API error return
* values. In C++, this function could throw an exception object.
*/
ibApi_RESULT CheckResult(ibApi_RESULT result) {
char error_text[256];
/*
* Error codes always have a negative value.
*/
if (result >= 0) return result;
/*
* For the purposes of this example, ibApi_RESULT_ERR_TIMEOUT is not a
* fatal error.
*/
if (result == ibApi_RESULT_ERR_TIMEOUT) return result;
/*
* This interprets the error code, writing the result to the error_text
* variable
*/
ibApi_Utils_GetErrorDescription(result,error_text,sizeof(error_text));
printf("\r\nERROR: %s\r\n",error_text);
/*
* Technically, ibApi_Close() should be called before exiting, e.g. via
* an atexit() handler. (This is omitted in the example for simplicity.)
*/
WaitForKey();
exit(1);
return 0;
}