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
RK-5409-5 Reference Kit User’s Guide 4-19
iBeanAPI.h
12. ibApi_WaitForDeviceEvents()
ibApi_FUNC ibApi_WaitForDeviceEvents(
ibApi_APIHANDLE api_hdl,
ibApi_DEVICEEVENTTYPE events_interested,
ibApi_INT32 timeout_ms,
ibApi_DEVICEID * device_id,
ibApi_DEVICEEVENTTYPE * events_happened
);
This function implements the simplest form of event notification using the application thread
context. It causes the calling thread to sleep until a network packet has arrived (i.e. the
sequence number has incremented), and then returns the ID of the device that was updated
along with the event(s) that woke the sleeping thread up. If multiple devices have changed
since the last call, ibApi_WaitForDeviceEvent() will return their IDs in a sequential “round
robin” order. If time timeout expires and nothing has changed, the return value is
ibApi_RESULT_ERR_TIMEOUT.
Parameters:
api_hdl: (input) API handle returned from ibApi_Open().
events_interested: (input) This parameter allows the wait condition to be restricted to a
subset of the possible event types.
timeout_ms: Number of milliseconds to wait before giving up (use -1 to wait indefinitely) A
valid of zero means the thread will check for new events since the last call but will not wait.
device_id: (output) Pointer to ID of the device that changed.
events_happened: (output) The returned value is the subset of the events_interested. It
indicates the event(s) that actually happened.
Return Value:
An ibApi_RESULT_SUCCESS if a device changed, ibApi_RESULT_ERR_TIMEOUT if not, or an
error code (<0) if unsuccessful.