![]() |
IDTech Windows SDK Guide
1.2.177.4
API reference for NEO2
|
Most NEO2 devices connects through USB, Serial Interface (COM), or IP depending on hardware capabnilities.
All NEO2 devices use USB-HID (Human Interface Device) and does not need any vendor-specific drivers. Simply by plugging into an available USB port makes it available for SDK connectivity. To inform the SDK you are using the USB interface of the SpectrumPro, you would execute the following command during program initialization to establish a connection:
Most NEO2 devices can connect via Serial Interface. The default serial port settings are as follows:
To inform the SDK you are using the Serial Interface of a NEO2 device, you would execute the following command during program initialization to establish a connection by passing the correct COM port number. In the following example, we are connecting to COM1 non-SRED device:
If you change the default baud rate, then there is an overloaded method to also include the baud rate:
Some NEO2 devices can connect via a network connection. The default port is is 1025.
To inform the SDK you are using the IP interface of a NEO2 device, you would execute the following command during program initialization to establish a connection by passing the correct address. In the following example, we are connecting to a device as IP address 10.0.1.1:
The IP address can optionally contain a port, separated by a colon:
The IP address can optionally contain a description, separated by hash tag:
The IP address can optionally contain both a port and a description:
There can be multiple IP connected devices to a single SDK instance. Each one is initially connected and registered with ip_connectToSocket.
To get a listing of all registered devices the SDK has access to, a listing of all the strings passed to ip_connectToSocket can be retrieved by the following
To switch between devices listed in ip_getSocketList():
NOTE: the string passed to ip_switchToSocket must match the complete gateway string as originally defined, and reported by ip_getSocketList.'
The IDTechSDK.dll framework uses a data file called NEO2_Devices.xml that resides in the same location. This file provides information for automatically connecting to NEO2 devices via USB or TCP/IP. The file is comprised of Device entries as follows:
Multiple device connections can be defined by a single Device entry, if those devices will use consecutive IP addresses, or multiple device connections can be defined by multiple Device entries, each with unique IP.
Every IP connection attempt is reported to a callback as connection successful, or connection could not be established
To activate autoConnect when NEO2_Devices.xml is properly configured:
The SDK has a method that can ping any of it's known connected devices on a regular interval, and report when it is not longer reachable via a callback. It can also be configured to execute ip_autoConnectToSocket() on a regular interval to detect devices connected on a regular interval: