Listed here are the types, enumerations, and definitions used throughout the SeaMAX library.
SeaMAX Enumerations
DeviceConfig
typedef struct configuration
{
int model;
int commType;
int baudrate;
int parity;
int firmware;
} DeviceConfig;
AnalogConfig
typedef struct analog_configuration
{
short channelMode;
char precision;
char exponent;
short minValue;
short maxValue;
} AnalogConfig;
Baudrates
enum
{
SM_BAUD_INVALID = 0,
SM_BAUD_1200 = 1,
SM_BAUD_2400 = 2,
SM_BAUD_4800 = 3,
SM_BAUD_9600 = 4,
SM_BAUD_14400 = 5,
SM_BAUD_19200 = 6,
SM_BAUD_28800 = 7,
SM_BAUD_38400 = 8,
SM_BAUD_57600 = 9,
SM_BAUD_115200 = 10,
SM_BAUD_230400 = 11,
SM_BAUD_460800 = 12,
SM_BAUD_921600 = 13,
};
Databits
enum
{
SM_DATABITS_5 = 5,
SM_DATABITS_6 = 6,
SM_DATABITS_7 = 7,
SM_DATABITS_8 = 8,
};
Parity
enum
{
SM_PARITY_NONE = 0,
SM_PARITY_ODD = 1,
SM_PARITY_EVEN = 2,
SM_PARITY_MARK = 3,
SM_PARITY_SPACE = 4,
};
Stopbits
enum
{
SM_STOPBITS_1 = 0,
SM_STOPBITS_1_5 = 1,
SM_STOPBITS_2 = 2,
};
Communications Type
enum
{
SM_COMTYPE_RS485 = 0,
SM_COMTYPE_ETHERNET = 1,
SM_COMTYPE_USB = 2,
SM_COMTYPE_RS232 = 3,
SM_COMTYPE_EXPANSION = 4,
SM_COMTYPE_RS422 = 5,
SM_COMTYPE_WIRELESS = 6,
SM_COMTYPE_INTELLIGENT = 7,
SM_COMTYPE_P_O_ETH = 8,
SM_COMTYPE_P_O_USB = 9,
SM_COMTYPE_CELLULAR = 10,
};
Analog to Digital Voltage Reference
enum
{
ANALOG = 0,
GROUND = 1,
AD_REFERENCE = 2,
FLOATING = 3,
DA_CHANNEL_1 = 4,
DA_CHANNEL_2 = 8,
};
Analog to Digital Channel Modes
enum
{
SINGLE_ENDED = 0,
DIFFERENTIAL = 1,
CURRENT_LOOP = 2,
MULTI_MODE = 3,
};
Channel Range Values
enum
{
ZERO_TO_FIVE = 0,
ZERO_TO_TWENTYFOUR_MA = 0,
PLUS_MINUS_FIVE = 1,
ZERO_TO_TEN = 2,
PLUS_MINUS_TEN = 3,
ZERO_TO_FIFTEEN = 2,
PLUS_MINUS_FIFTEEN = 3,
PLUS_MINUS_ONE = 4,
PLUS_MINUS_HALF = 5,
PLUS_MINUS_150MILLI = 6,
INLINE_RESISTOR_200 = 7,
};
Analog Channel Configuration Flags
enum
{
IS_OUTPUT = 0x0001,
IS_INPUT = 0x0002,
IS_SINGLE_ENDED = 0x0004,
IS_DOUBLE_ENDED = 0x0008,
IS_DIFFERENTIAL = 0x000C,
IS_VOLTAGE = 0x0010,
IS_CURRENT = 0x0020,
IS_POWER = 0x0040,
IS_FREQUENCY = 0x0080,
USES_FLOATING_GND = 0x0100,
USES_EXTERNAL_GND = 0x0200,
USES_INTERNAL_GND = 0x0400,
AMP_MODE_0 = 0x0000,
AMP_MODE_1 = 0x1000,
AMP_MODE_2 = 0x2000,
AMP_MODE_3 = 0x3000,
AMP_MODE_4 = 0x4000,
AMP_MODE_5 = 0x5000,
AMP_MODE_6 = 0x6000,
AMP_MODE_7 = 0x7000,
AMP_MODE_8 = 0x8000,
AMP_MODE_9 = 0x9000,
AMP_MODE_10 = 0xA000,
AMP_MODE_11 = 0xB000,
AMP_MODE_12 = 0xC000,
AMP_MODE_13 = 0xD000,
AMP_MODE_14 = 0xE000,
AMP_MODE_15 = 0xF000,
};
SeaMAX Ethernet Enumerations
Network Types
enum
{
NETWORK_INFRASTRUCTURE = 0,
NETWORK_ADHOC = 1,
};
Wireless Security Type
enum
{
SECURITY_NONE = 0,
SECURITY_WEP_OPEN_64 = 1,
SECURITY_WEP_SHARED_64 = 2,
SECURITY_WEP_OPEN_128 = 3,
SECURITY_WEP_SHARED_128 = 4,
SECURITY_WPA_TKIP = 5,
SECURITY_WPA2_AES = 6,
SECURITY_UNKNOWN = 0xFF,
};
Wireless Key Type
enum
{
HEX_KEY = 0,
PASSPHRASE_KEY = 1,
};
Security Type
enum
{
UNSECURED = 0,
AES_128 = 1,
AES_256 = 2,
};
Error Code
enum ErrorCodes
{
SM_SUCCESS = 0,
SM_HANDLE_INVALID_ERR = 1,
SM_WIN32_ERR = 2,
SM_FTDI_ERR = 3,
SM_PARAM_INVALID_ERR = 4,
SM_NOT_CONNECTED_ERR = 5,
SM_MODBUS_ILLEGAL_FUNC_01_ERR = 6,
SM_MODBUS_ILLEGAL_ADDR_02_ERR = 7,
SM_MODBUS_ILLEGAL_DATA_03_ERR = 8,
SM_MODBUS_UNKOWN_ERR = 9,
SM_CRC_ERR = 10,
SM_WRITE_ERR = 11,
SM_TIMEOUT_ERR = 12,
SM_CMD_NOT_SUPPORTED_ERR = 13,
SM_MUTEX_ERR = 14,
SM_NO_MODULES_FOUND_ERR = 15,
SM_END_DISC_MODULES_ERR = 16,
SM_MODULE_NOT_FOUND_ERR = 17,
SM_SET_SERIAL_PARAM_ERR = 18,
SM_NON_SERIAL_ERR = 19,
SM_INVALID_RESPONSE_ERR = 20,
SM_DEVICE_NOT_SUPPORTED_ERR = 21,
SM_BIND_SOCKET_ERR = 22,
SM_FREE_SOCKET_ERR = 23,
SM_HOST_ADDRESS_ERR = 24,
SM_GET_CONFIG_ERR = 25,
SM_NET_INTERFACES_ERR = 26,
SM_BROADCAST_ERR = 27,
SM_SET_CONNECTION_PARAMS_ERR = 28,
SM_CBX_DLL_ERR = 29,
SM_THREAD_NOT_STARTED_ERR = 30,
SM_THREAD_UNKNOWN_ERR = 31,
SM_THREAD_CANCELLED_ERR = 32,
SM_THREAD_PENDING_ERR = 33,
SM_THREAD_INPUT_CHANGED = 34,
SM_THREAD_READ_FAILED = 35,
};
|