API: Add icsneoc2

This commit is contained in:
Thomas Stoddard
2026-03-24 21:08:40 -04:00
committed by Kyle Schwarz
parent 294e707924
commit 682299cb8c
40 changed files with 9015 additions and 369 deletions
+8 -6
View File
@@ -1,6 +1,8 @@
#ifndef __ICSNEO_IO_H_
#define __ICSNEO_IO_H_
#include <icsneo/icsneoc2types.h>
typedef struct _neomiscio_t {
size_t number;
bool supportsDigitalIn;
@@ -19,12 +21,12 @@ namespace icsneo {
using MiscIO = neomiscio_t;
enum class IO {
EthernetActivation = 0, // The DoIP activation line, 0 is HiZ and 1 is pulled up to VBAT
USBHostPower = 1,
BackupPowerEnabled = 2, // The FIRE 2's backup super capacitor
BackupPowerGood = 3, // Whether or not the FIRE 2's backup super capacitor is charged (read only)
Misc = 4, // General purpose IO on the device
EMisc = 5, // Extended general purpose IO on the device
EthernetActivation = icsneoc2_io_type_eth_activation, // The DoIP activation line, 0 is HiZ and 1 is pulled up to VBAT
USBHostPower = icsneoc2_io_type_usb_host_power,
BackupPowerEnabled = icsneoc2_io_type_backup_power_en, // The FIRE 2's backup super capacitor
BackupPowerGood = icsneoc2_io_type_backup_power_good, // Whether or not the FIRE 2's backup super capacitor is charged (read only)
Misc = icsneoc2_io_type_misc, // General purpose IO on the device
EMisc = icsneoc2_io_type_emisc, // Extended general purpose IO on the device
};
// Note that the C API does a static cast between this and neoio_t so keep them in sync!
+179 -174
View File
@@ -2,6 +2,7 @@
#define __NETWORKID_H_
#include <stdint.h>
#include <icsneo/icsneoc2types.h>
typedef uint16_t neonetid_t;
typedef uint8_t neonettype_t;
@@ -24,188 +25,192 @@ class Network {
public:
enum class NetID : neonetid_t {
Device = 0,
DWCAN_01 = 1, // previously HSCAN
DWCAN_08 = 2, // previously MSCAN
SWCAN_01 = 3, // previously SWCAN
LSFTCAN_01 = 4, // previously LSFTCAN
FordSCP = 5,
J1708 = 6,
Aux = 7,
J1850VPW = 8,
ISO9141_01 = 9, // previously ISO9141
DiskData = 10,
Main51 = 11,
RED = 12,
SCI = 13,
ISO9141_02 = 14, // previously ISO9141_2
ISO14230 = 15,
LIN_01 = 16, // previously LIN
AE_01 = 17, // previously OP_Ethernet1
AE_02 = 18, // previously OP_Ethernet2
AE_03 = 19, // previously OP_Ethernet3
Device = icsneoc2_netid_device,
DWCAN_01 = icsneoc2_netid_dwcan_01, // previously HSCAN
DWCAN_08 = icsneoc2_netid_dwcan_08, // previously MSCAN
SWCAN_01 = icsneoc2_netid_swcan_01, // previously SWCAN
LSFTCAN_01 = icsneoc2_netid_lsftcan_01, // previously LSFTCAN
FordSCP = icsneoc2_netid_fordscp,
J1708 = icsneoc2_netid_j1708,
Aux = icsneoc2_netid_aux,
J1850VPW = icsneoc2_netid_j1850vpw,
ISO9141_01 = icsneoc2_netid_iso9141, // previously ISO9141
DiskData = icsneoc2_netid_disk_data,
Main51 = icsneoc2_netid_main51,
RED = icsneoc2_netid_red,
SCI = icsneoc2_netid_sci,
ISO9141_02 = icsneoc2_netid_iso9141_02, // previously ISO9141_2
ISO14230 = icsneoc2_netid_iso14230,
LIN_01 = icsneoc2_netid_lin_01, // previously LIN
AE_01 = icsneoc2_netid_ae_01, // previously OP_Ethernet1
AE_02 = icsneoc2_netid_ae_02, // previously OP_Ethernet2
AE_03 = icsneoc2_netid_ae_03, // previously OP_Ethernet3
// START Device Command Returns
// When we send a command, the device returns on one of these, depending on command
RED_EXT_MEMORYREAD = 20,
RED_INT_MEMORYREAD = 21,
RED_DFLASH_READ = 22,
NeoMemorySDRead = 23, // Response from NeoMemory (MemoryTypeSD)
CAN_ERRBITS = 24,
NeoMemoryWriteDone = 25,
RED_WAVE_CAN1_LOGICAL = 26,
RED_WAVE_CAN2_LOGICAL = 27,
RED_WAVE_LIN1_LOGICAL = 28,
RED_WAVE_LIN2_LOGICAL = 29,
RED_WAVE_LIN1_ANALOG = 30,
RED_WAVE_LIN2_ANALOG = 31,
RED_WAVE_MISC_ANALOG = 32,
RED_WAVE_MISCDIO2_LOGICAL = 33,
RED_NETWORK_COM_ENABLE_EX = 34,
RED_NEOVI_NETWORK = 35,
RED_READ_BAUD_SETTINGS = 36,
RED_OLDFORMAT = 37,
RED_SCOPE_CAPTURE = 38,
RED_HARDWARE_EXCEP = 39,
RED_GET_RTC = 40,
RED_EXT_MEMORYREAD = icsneoc2_netid_red_ext_memoryread,
RED_INT_MEMORYREAD = icsneoc2_netid_red_int_memoryread,
RED_DFLASH_READ = icsneoc2_netid_red_dflash_read,
NeoMemorySDRead = icsneoc2_netid_neo_memory_sdread, // Response from NeoMemory (MemoryTypeSD)
CAN_ERRBITS = icsneoc2_netid_can_errbits,
NeoMemoryWriteDone = icsneoc2_netid_neo_memory_write_done,
RED_WAVE_CAN1_LOGICAL = icsneoc2_netid_red_wave_can1_logical,
RED_WAVE_CAN2_LOGICAL = icsneoc2_netid_red_wave_can2_logical,
RED_WAVE_LIN1_LOGICAL = icsneoc2_netid_red_wave_lin1_logical,
RED_WAVE_LIN2_LOGICAL = icsneoc2_netid_red_wave_lin2_logical,
RED_WAVE_LIN1_ANALOG = icsneoc2_netid_red_wave_lin1_analog,
RED_WAVE_LIN2_ANALOG = icsneoc2_netid_red_wave_lin2_analog,
RED_WAVE_MISC_ANALOG = icsneoc2_netid_red_wave_misc_analog,
RED_WAVE_MISCDIO2_LOGICAL = icsneoc2_netid_red_wave_miscdio2_logical,
RED_NETWORK_COM_ENABLE_EX = icsneoc2_netid_red_network_com_enable_ex,
RED_NEOVI_NETWORK = icsneoc2_netid_red_neovi_network,
RED_READ_BAUD_SETTINGS = icsneoc2_netid_red_read_baud_settings,
RED_OLDFORMAT = icsneoc2_netid_red_oldformat,
RED_SCOPE_CAPTURE = icsneoc2_netid_red_scope_capture,
RED_HARDWARE_EXCEP = icsneoc2_netid_red_hardware_excep,
RED_GET_RTC = icsneoc2_netid_red_get_rtc,
// END Device Command Returns
ISO9141_03 = 41, // previously ISO9141_3
DWCAN_02 = 42, // previously HSCAN2
DWCAN_03 = 44, // previously HSCAN3
AE_04 = 45, // previously OP_Ethernet4
AE_05 = 46, // previously OP_Ethernet5
ISO9141_04 = 47, // previously ISO9141_4
LIN_02 = 48, // previously LIN2
LIN_03 = 49, // previously LIN3
LIN_04 = 50, // previously LIN4
ISO9141_03 = icsneoc2_netid_iso9141_03, // previously ISO9141_3
DWCAN_02 = icsneoc2_netid_dwcan_02, // previously HSCAN2
DWCAN_03 = icsneoc2_netid_dwcan_03, // previously HSCAN3
AE_04 = icsneoc2_netid_ae_04, // previously OP_Ethernet4
AE_05 = icsneoc2_netid_ae_05, // previously OP_Ethernet5
ISO9141_04 = icsneoc2_netid_iso9141_04, // previously ISO9141_4
LIN_02 = icsneoc2_netid_lin_02, // previously LIN2
LIN_03 = icsneoc2_netid_lin_03, // previously LIN3
LIN_04 = icsneoc2_netid_lin_04, // previously LIN4
// MOST = 51, Old and unused
RED_App_Error = 52,
CGI = 53,
Reset_Status = 54,
FB_Status = 55,
App_Signal_Status = 56,
Read_Datalink_Cm_Tx_Msg = 57,
Read_Datalink_Cm_Rx_Msg = 58,
Logging_Overflow = 59,
ReadSettings = 60,
DWCAN_04 = 61, // previously HSCAN4
DWCAN_05 = 62, // previously HSCAN5
RS232 = 63,
UART_01 = 64, // previously UART
UART_02 = 65, // previously UART2
UART_03 = 66, // previously UART3
UART_04 = 67, // previously UART4
SWCAN_02 = 68, // previously SWCAN2
ETHERNET_DAQ = 69, // previously Ethernet_DAQ
Data_To_Host = 70,
TextAPI_To_Host = 71,
SPI_01 = 72, // previously SPI1
AE_06 = 73, // previously OP_Ethernet6
Red_VBat = 74,
AE_07 = 75, // previously OP_Ethernet7
AE_08 = 76, // previously OP_Ethernet8
AE_09 = 77, // previously OP_Ethernet9
AE_10 = 78, // previously OP_Ethernet10
AE_11 = 79, // previously OP_Ethernet11
FLEXRAY_01A = 80, // previously FlexRay1a
FLEXRAY_01B = 81, // previously FlexRay1b
FLEXRAY_02A = 82, // previously FlexRay2a
FLEXRAY_02B = 83, // previously FlexRay2b
LIN_05 = 84, // previously LIN5
FLEXRAY_01 = 85, // previously FlexRay
FLEXRAY_02 = 86, // previously FlexRay2
AE_12 = 87, // previously OP_Ethernet12
I2C_01 = 88, // previously I2C
MOST_25 = 90, // previously MOST25
MOST_50 = 91, // previously MOST50
MOST_150 = 92, // previously MOST150
ETHERNET_01 = 93, // previously Ethernet
GMFSA = 94,
TCP = 95,
DWCAN_06 = 96, // previously HSCAN6
DWCAN_07 = 97, // previously HSCAN7
LIN_06 = 98, // previously LIN6
LSFTCAN_02 = 99, // previously LSFTCAN2
LogicalDiskInfo = 187,
WiVICommand = 221,
ScriptStatus = 224,
EthPHYControl = 239,
ExtendedCommand = 240,
ExtendedData = 242,
FlexRayControl = 243,
CoreMiniPreLoad = 244,
HW_COM_Latency_Test = 512,
DeviceStatus = 513,
UDP = 514,
ForwardedMessage = 516,
I2C_02 = 517, // previously I2C2
I2C_03 = 518, // previously I2C3
I2C_04 = 519, // previously I2C4
ETHERNET_02 = 520, // previously Ethernet2
ETHERNET_TX_WRAP = 521,
A2B_01 = 522, // previously A2B1
A2B_02 = 523, // previously A2B2
ETHERNET_03 = 524, // previously Ethernet3
WBMS_01 = 532, // previously WBMS
DWCAN_09 = 534, // previously DWCAN9
DWCAN_10 = 535, // previously DWCAN10
DWCAN_11 = 536, // previously DWCAN11
DWCAN_12 = 537, // previously DWCAN12
DWCAN_13 = 538, // previously DWCAN13
DWCAN_14 = 539, // previously DWCAN14
DWCAN_15 = 540, // previously DWCAN15
DWCAN_16 = 541, // previously DWCAN16
LIN_07 = 542, // previously LIN7
LIN_08 = 543, // previously LIN8
SPI_02 = 544, // previously SPI2
MDIO_01 = 545, // previously MDIO1
MDIO_02 = 546, // previously MDIO2
MDIO_03 = 547, // previously MDIO3
MDIO_04 = 548, // previously MDIO4
MDIO_05 = 549, // previously MDIO5
MDIO_06 = 550, // previously MDIO6
MDIO_07 = 551, // previously MDIO7
MDIO_08 = 552, // previously MDIO8
AE_13 = 553, // previously OP_Ethernet13
AE_14 = 554, // previously OP_Ethernet14
AE_15 = 555, // previously OP_Ethernet15
AE_16 = 556, // previously OP_Ethernet16
SPI_03 = 557, // previously SPI3
SPI_04 = 558, // previously SPI4
SPI_05 = 559, // previously SPI5
SPI_06 = 560, // previously SPI6
SPI_07 = 561, // previously SPI7
SPI_08 = 562, // previously SPI8
LIN_09 = 563, // previously LIN9
LIN_10 = 564, // previously LIN10
LIN_11 = 565, // previously LIN11
LIN_12 = 566, // previously LIN12
LIN_13 = 567, // previously LIN13
LIN_14 = 568, // previously LIN14
LIN_15 = 569, // previously LIN15
LIN_16 = 570, // previously LIN16
Any = 0xfffe, // Never actually set as type, but used as flag for filtering
Invalid = 0xffff
RED_App_Error = icsneoc2_netid_red_app_error,
CGI = icsneoc2_netid_cgi,
Reset_Status = icsneoc2_netid_reset_status,
FB_Status = icsneoc2_netid_fb_status,
App_Signal_Status = icsneoc2_netid_app_signal_status,
Read_Datalink_Cm_Tx_Msg = icsneoc2_netid_read_datalink_cm_tx_msg,
Read_Datalink_Cm_Rx_Msg = icsneoc2_netid_read_datalink_cm_rx_msg,
Logging_Overflow = icsneoc2_netid_logging_overflow,
ReadSettings = icsneoc2_netid_read_settings,
DWCAN_04 = icsneoc2_netid_dwcan_04, // previously HSCAN4
DWCAN_05 = icsneoc2_netid_dwcan_05, // previously HSCAN5
RS232 = icsneoc2_netid_rs232,
UART_01 = icsneoc2_netid_uart_01, // previously UART
UART_02 = icsneoc2_netid_uart_02, // previously UART2
UART_03 = icsneoc2_netid_uart_03, // previously UART3
UART_04 = icsneoc2_netid_uart_04, // previously UART4
SWCAN_02 = icsneoc2_netid_swcan_02, // previously SWCAN2
ETHERNET_DAQ = icsneoc2_netid_ethernet_daq, // previously Ethernet_DAQ
Data_To_Host = icsneoc2_netid_data_to_host,
TextAPI_To_Host = icsneoc2_netid_textapi_to_host,
SPI_01 = icsneoc2_netid_spi_01, // previously SPI1
AE_06 = icsneoc2_netid_ae_06, // previously OP_Ethernet6
Red_VBat = icsneoc2_netid_red_vbat,
AE_07 = icsneoc2_netid_ae_07, // previously OP_Ethernet7
AE_08 = icsneoc2_netid_ae_08, // previously OP_Ethernet8
AE_09 = icsneoc2_netid_ae_09, // previously OP_Ethernet9
AE_10 = icsneoc2_netid_ae_10, // previously OP_Ethernet10
AE_11 = icsneoc2_netid_ae_11, // previously OP_Ethernet11
FLEXRAY_01A = icsneoc2_netid_flexray_01a, // previously FlexRay1a
FLEXRAY_01B = icsneoc2_netid_flexray_01b, // previously FlexRay1b
FLEXRAY_02A = icsneoc2_netid_flexray_02a, // previously FlexRay2a
FLEXRAY_02B = icsneoc2_netid_flexray_02b, // previously FlexRay2b
LIN_05 = icsneoc2_netid_lin_05, // previously LIN5
FLEXRAY_01 = icsneoc2_netid_flexray_01, // previously FlexRay
FLEXRAY_02 = icsneoc2_netid_flexray_02, // previously FlexRay2
AE_12 = icsneoc2_netid_ae_12, // previously OP_Ethernet12
I2C_01 = icsneoc2_netid_i2c_01, // previously I2C
MOST_25 = icsneoc2_netid_most_25, // previously MOST25
MOST_50 = icsneoc2_netid_most_50, // previously MOST50
MOST_150 = icsneoc2_netid_most_150, // previously MOST150
ETHERNET_01 = icsneoc2_netid_ethernet_01, // previously Ethernet
GMFSA = icsneoc2_netid_gmfsa,
TCP = icsneoc2_netid_tcp,
DWCAN_06 = icsneoc2_netid_dwcan_06, // previously HSCAN6
DWCAN_07 = icsneoc2_netid_dwcan_07, // previously HSCAN7
LIN_06 = icsneoc2_netid_lin_06, // previously LIN6
LSFTCAN_02 = icsneoc2_netid_lsftcan_02, // previously LSFTCAN2
LogicalDiskInfo = icsneoc2_netid_logical_disk_info,
WiVICommand = icsneoc2_netid_wivi_command,
ScriptStatus = icsneoc2_netid_script_status,
EthPHYControl = icsneoc2_netid_eth_phy_control,
ExtendedCommand = icsneoc2_netid_extended_command,
ExtendedData = icsneoc2_netid_extended_data,
FlexRayControl = icsneoc2_netid_flexray_control,
CoreMiniPreLoad = icsneoc2_netid_coremini_preload,
HW_COM_Latency_Test = icsneoc2_netid_hw_com_latency_test,
DeviceStatus = icsneoc2_netid_device_status,
UDP = icsneoc2_netid_udp,
ForwardedMessage = icsneoc2_netid_forwarded_message,
I2C_02 = icsneoc2_netid_i2c_02, // previously I2C2
I2C_03 = icsneoc2_netid_i2c_03, // previously I2C3
I2C_04 = icsneoc2_netid_i2c_04, // previously I2C4
ETHERNET_02 = icsneoc2_netid_ethernet_02, // previously Ethernet2
ETHERNET_TX_WRAP = icsneoc2_netid_ethernet_tx_wrap,
A2B_01 = icsneoc2_netid_a2b_01, // previously A2B1
A2B_02 = icsneoc2_netid_a2b_02, // previously A2B2
ETHERNET_03 = icsneoc2_netid_ethernet_03, // previously Ethernet3
WBMS_01 = icsneoc2_netid_wbms_01, // previously WBMS
DWCAN_09 = icsneoc2_netid_dwcan_09, // previously DWCAN9
DWCAN_10 = icsneoc2_netid_dwcan_10, // previously DWCAN10
DWCAN_11 = icsneoc2_netid_dwcan_11, // previously DWCAN11
DWCAN_12 = icsneoc2_netid_dwcan_12, // previously DWCAN12
DWCAN_13 = icsneoc2_netid_dwcan_13, // previously DWCAN13
DWCAN_14 = icsneoc2_netid_dwcan_14, // previously DWCAN14
DWCAN_15 = icsneoc2_netid_dwcan_15, // previously DWCAN15
DWCAN_16 = icsneoc2_netid_dwcan_16, // previously DWCAN16
LIN_07 = icsneoc2_netid_lin_07, // previously LIN7
LIN_08 = icsneoc2_netid_lin_08, // previously LIN8
SPI_02 = icsneoc2_netid_spi_02, // previously SPI2
MDIO_01 = icsneoc2_netid_mdio_01, // previously MDIO1
MDIO_02 = icsneoc2_netid_mdio_02, // previously MDIO2
MDIO_03 = icsneoc2_netid_mdio_03, // previously MDIO3
MDIO_04 = icsneoc2_netid_mdio_04, // previously MDIO4
MDIO_05 = icsneoc2_netid_mdio_05, // previously MDIO5
MDIO_06 = icsneoc2_netid_mdio_06, // previously MDIO6
MDIO_07 = icsneoc2_netid_mdio_07, // previously MDIO7
MDIO_08 = icsneoc2_netid_mdio_08, // previously MDIO8
AE_13 = icsneoc2_netid_ae_13, // previously OP_Ethernet13
AE_14 = icsneoc2_netid_ae_14, // previously OP_Ethernet14
AE_15 = icsneoc2_netid_ae_15, // previously OP_Ethernet15
AE_16 = icsneoc2_netid_ae_16, // previously OP_Ethernet16
SPI_03 = icsneoc2_netid_spi_03, // previously SPI3
SPI_04 = icsneoc2_netid_spi_04, // previously SPI4
SPI_05 = icsneoc2_netid_spi_05, // previously SPI5
SPI_06 = icsneoc2_netid_spi_06, // previously SPI6
SPI_07 = icsneoc2_netid_spi_07, // previously SPI7
SPI_08 = icsneoc2_netid_spi_08, // previously SPI8
LIN_09 = icsneoc2_netid_lin_09, // previously LIN9
LIN_10 = icsneoc2_netid_lin_10, // previously LIN10
LIN_11 = icsneoc2_netid_lin_11, // previously LIN11
LIN_12 = icsneoc2_netid_lin_12, // previously LIN12
LIN_13 = icsneoc2_netid_lin_13, // previously LIN13
LIN_14 = icsneoc2_netid_lin_14, // previously LIN14
LIN_15 = icsneoc2_netid_lin_15, // previously LIN15
LIN_16 = icsneoc2_netid_lin_16, // previously LIN16
Any = icsneoc2_netid_any, // Never actually set as type, but used as flag for filtering
Invalid = icsneoc2_netid_invalid
};
enum class Type : neonettype_t {
Invalid = 0,
Internal = 1, // Used for statuses that don't actually need to be transferred to the client application
CAN = 2,
LIN = 3,
FlexRay = 4,
MOST = 5,
Ethernet = 6,
LSFTCAN = 7,
SWCAN = 8,
ISO9141 = 9,
I2C = 10,
A2B = 11,
SPI = 12,
MDIO = 13,
AutomotiveEthernet = 14,
Any = 0xFE, // Never actually set as type, but used as flag for filtering
Other = 0xFF
Invalid = icsneoc2_network_type_invalid,
Internal = icsneoc2_network_type_internal, // Used for statuses that don't actually need to be transferred to the client application
CAN = icsneoc2_network_type_can,
LIN = icsneoc2_network_type_lin,
FlexRay = icsneoc2_network_type_flexray,
MOST = icsneoc2_network_type_most,
Ethernet = icsneoc2_network_type_ethernet,
LSFTCAN = icsneoc2_network_type_lsftcan,
SWCAN = icsneoc2_network_type_swcan,
ISO9141 = icsneoc2_network_type_iso9141,
I2C = icsneoc2_network_type_i2c,
A2B = icsneoc2_network_type_a2b,
SPI = icsneoc2_network_type_spi,
MDIO = icsneoc2_network_type_mdio,
AutomotiveEthernet = icsneoc2_network_type_automotive_ethernet,
// This must always be last entry
Maxsize = icsneoc2_network_type_maxsize,
Any = icsneoc2_network_type_any, // Never actually set as type, but used as flag for filtering
Other = icsneoc2_network_type_other
};
enum class CoreMini : uint8_t {
DWCAN_01 = 0,
@@ -5,12 +5,15 @@
#include "icsneo/communication/message/canmessage.h"
#include "icsneo/api/eventmanager.h"
#include <cstddef>
#include <cstdint>
#include <memory>
#include <optional>
namespace icsneo {
std::optional<uint8_t> CAN_LengthToDLC(size_t dataLength, bool fd);
typedef uint16_t icscm_bitfield;
#pragma pack(push,2)
+2 -2
View File
@@ -735,8 +735,8 @@ public:
bool setValueLiveData(std::shared_ptr<LiveDataSetValueMessage> message);
enum class DiskFormatDirective : uint8_t {
Continue,
Stop
Continue = icsneoc2_disk_format_directive_continue,
Stop = icsneoc2_disk_format_directive_stop,
};
using DiskFormatProgress = std::function<DiskFormatDirective(uint64_t sectorsFormatted, uint64_t sectorsTotal)>;
+123 -120
View File
@@ -1,11 +1,14 @@
#ifndef __DEVICETYPE_H_
#define __DEVICETYPE_H_
#include "icsneo/icsneoc2types.h"
// Hold the length of the longest name, so that C applications can allocate memory accordingly
// Currently the longest is "Intrepid Ethernet Evaluation Board"
#define ICSNEO_DEVICETYPE_LONGEST_NAME (35 + 1) // Add 1 so that if someone forgets, they still have space for null terminator
#define ICSNEO_DEVICETYPE_LONGEST_DESCRIPTION (ICSNEO_DEVICETYPE_LONGEST_NAME + 7) // 6 character serial, plus space
#ifndef __cplusplus
#include <stdint.h>
@@ -23,68 +26,68 @@ public:
// This enum used to be a bitfield, but has since become an enum as we have more than 32 devices
// Adding something? Make sure you update the type string and C-compatible defines below!
enum Enum : devicetype_t {
Unknown = (0x00000000),
BLUE = (0x00000001),
ECU_AVB = (0x00000002),
RADSupermoon = (0x00000003),
DW_VCAN = (0x00000004),
RADMoon2 = (0x00000005),
RADMars = (0x00000006),
VCAN4_1 = (0x00000007),
FIRE = (0x00000008),
RADPluto = (0x00000009),
VCAN4_2EL = (0x0000000a),
RADIO_CANHUB = (0x0000000b),
NEOECU12 = (0x0000000c),
OBD2_LCBADGE = (0x0000000d),
RADMoonDuo = (0x0000000e),
FIRE3 = (0x0000000f),
VCAN3 = (0x00000010),
RADJupiter = (0x00000011),
VCAN4_IND = (0x00000012),
RADGigastar = (0x00000013),
RED2 = (0x00000014),
EtherBADGE = (0x00000016),
RAD_A2B = (0x00000017),
RADEpsilon = (0x00000018),
RADEpsilonXL = (0x0000001e),
RADGalaxy2 = (0x00000021),
RADMoon3 = (0x00000023),
RADComet = (0x00000024),
FIRE3_FlexRay = (0x00000025),
Connect = (0x00000026),
RADComet3 = (0x00000027),
RADMoonT1S = (0x00000028),
RADGigastar2 = (0x00000029),
FIRE3_T1S_LIN = (0x0000002A),
FIRE3_T1S_SENT = (0x0000002B),
RADGemini = (0x0000002C),
RED = (0x00000040),
ECU = (0x00000080),
IEVB = (0x00000100),
Pendant = (0x00000200),
OBD2_PRO = (0x00000400),
ECUChip_UART = (0x00000800),
PLASMA = (0x00001000),
DONT_REUSE0 = (0x00002000), // Previously FIRE_VNET
NEOAnalog = (0x00004000),
CT_OBD = (0x00008000),
DONT_REUSE1 = (0x00010000), // Previously PLASMA_1_12
DONT_REUSE2 = (0x00020000), // Previously PLASMA_1_13
ION = (0x00040000),
RADStar = (0x00080000),
DONT_REUSE3 = (0x00100000), // Previously ION3
VCAN4_4 = (0x00200000),
VCAN4_2 = (0x00400000),
CMProbe = (0x00800000),
EEVB = (0x01000000),
VCANrf = (0x02000000),
FIRE2 = (0x04000000),
Flex = (0x08000000),
RADGalaxy = (0x10000000),
RADStar2 = (0x20000000),
VividCAN = (0x40000000),
OBD2_SIM = (0x80000000)
Unknown = icsneoc2_devicetype_unknown,
BLUE = icsneoc2_devicetype_blue,
ECU_AVB = icsneoc2_devicetype_ecu_avb,
RADSupermoon = icsneoc2_devicetype_rad_supermoon,
DW_VCAN = icsneoc2_devicetype_dw_vcan,
RADMoon2 = icsneoc2_devicetype_rad_moon2,
RADMars = icsneoc2_devicetype_rad_mars,
VCAN4_1 = icsneoc2_devicetype_vcan41,
FIRE = icsneoc2_devicetype_fire,
RADPluto = icsneoc2_devicetype_rad_pluto,
VCAN4_2EL = icsneoc2_devicetype_vcan42_el,
RADIO_CANHUB = icsneoc2_devicetype_radio_canhub,
NEOECU12 = icsneoc2_devicetype_neo_ecu12,
OBD2_LCBADGE = icsneoc2_devicetype_obd2_lc_badge,
RADMoonDuo = icsneoc2_devicetype_rad_moon_duo,
FIRE3 = icsneoc2_devicetype_fire3,
VCAN3 = icsneoc2_devicetype_vcan3,
RADJupiter = icsneoc2_devicetype_rad_jupiter,
VCAN4_IND = icsneoc2_devicetype_vcan4_industrial,
RADGigastar = icsneoc2_devicetype_rad_gigastar,
RED2 = icsneoc2_devicetype_red2,
EtherBADGE = icsneoc2_devicetype_etherbadge,
RAD_A2B = icsneoc2_devicetype_rad_a2b,
RADEpsilon = icsneoc2_devicetype_rad_epsilon,
RADEpsilonXL = icsneoc2_devicetype_rad_epsilon_xl,
RADGalaxy2 = icsneoc2_devicetype_rad_galaxy2,
RADMoon3 = icsneoc2_devicetype_rad_moon3,
RADComet = icsneoc2_devicetype_rad_comet,
FIRE3_FlexRay = icsneoc2_devicetype_fire3_flexray,
Connect = icsneoc2_devicetype_connect,
RADComet3 = icsneoc2_devicetype_rad_comet3,
RADMoonT1S = icsneoc2_devicetype_rad_moon_t1s,
RADGigastar2 = icsneoc2_devicetype_rad_gigastar2,
FIRE3_T1S_LIN = icsneoc2_devicetype_fire3_t1s_lin,
FIRE3_T1S_SENT = icsneoc2_devicetype_fire3_t1s_sent,
RADGemini = icsneoc2_devicetype_rad_gemini,
RED = icsneoc2_devicetype_red,
ECU = icsneoc2_devicetype_ecu,
IEVB = icsneoc2_devicetype_ievb,
Pendant = icsneoc2_devicetype_pendant,
OBD2_PRO = icsneoc2_devicetype_obd2_pro,
ECUChip_UART = icsneoc2_devicetype_ecuchip_uart,
PLASMA = icsneoc2_devicetype_plasma,
DONT_REUSE0 = 0x00002000, // Previously FIRE_VNET
NEOAnalog = icsneoc2_devicetype_neo_analog,
CT_OBD = icsneoc2_devicetype_ct_obd,
DONT_REUSE1 = 0x00010000, // Previously PLASMA_1_12
DONT_REUSE2 = 0x00020000, // Previously PLASMA_1_13
ION = icsneoc2_devicetype_ion,
RADStar = icsneoc2_devicetype_rad_star,
DONT_REUSE3 = 0x00100000, // Previously ION3
VCAN4_4 = icsneoc2_devicetype_vcan44,
VCAN4_2 = icsneoc2_devicetype_vcan42,
CMProbe = icsneoc2_devicetype_cm_probe,
EEVB = icsneoc2_devicetype_eevb,
VCANrf = icsneoc2_devicetype_vcan_rf,
FIRE2 = icsneoc2_devicetype_fire2,
Flex = icsneoc2_devicetype_flex,
RADGalaxy = icsneoc2_devicetype_rad_galaxy,
RADStar2 = icsneoc2_devicetype_rad_star2,
VividCAN = icsneoc2_devicetype_vividcan,
OBD2_SIM = devicetype_t(icsneoc2_devicetype_obd2_sim)
};
/**
@@ -239,68 +242,68 @@ private:
#endif // __cplusplus
#ifdef __ICSNEOC_H_ // We are using the C API, so we want C-compatible defines
#define ICSNEO_DEVICETYPE_UNKNOWN ((devicetype_t)0x00000000)
#define ICSNEO_DEVICETYPE_BLUE ((devicetype_t)0x00000001)
#define ICSNEO_DEVICETYPE_ECU_AVB ((devicetype_t)0x00000002)
#define ICSNEO_DEVICETYPE_RADSUPERMOON ((devicetype_t)0x00000003)
#define ICSNEO_DEVICETYPE_DW_VCAN ((devicetype_t)0x00000004)
#define ICSNEO_DEVICETYPE_RADMOON2 ((devicetype_t)0x00000005)
#define ICSNEO_DEVICETYPE_RADMARS ((devicetype_t)0x00000006)
#define ICSNEO_DEVICETYPE_VCAN4_1 ((devicetype_t)0x00000007)
#define ICSNEO_DEVICETYPE_FIRE ((devicetype_t)0x00000008)
#define ICSNEO_DEVICETYPE_RADPLUTO ((devicetype_t)0x00000009)
#define ICSNEO_DEVICETYPE_VCAN4_2EL ((devicetype_t)0x0000000a)
#define ICSNEO_DEVICETYPE_RADIO_CANHUB ((devicetype_t)0x0000000b)
#define ICSNEO_DEVICETYPE_NEOECU12 ((devicetype_t)0x0000000c)
#define ICSNEO_DEVICETYPE_OBD2_LCBADGE ((devicetype_t)0x0000000d)
#define ICSNEO_DEVICETYPE_RADMOONDUO ((devicetype_t)0x0000000e)
#define ICSNEO_DEVICETYPE_FIRE3 ((devicetype_t)0x0000000f)
#define ICSNEO_DEVICETYPE_VCAN3 ((devicetype_t)0x00000010)
#define ICSNEO_DEVICETYPE_RADJUPITER ((devicetype_t)0x00000011)
#define ICSNEO_DEVICETYPE_VCAN4_IND ((devicetype_t)0x00000012)
#define ICSNEO_DEVICETYPE_RADGIGASTAR ((devicetype_t)0x00000013)
#define ICSNEO_DEVICETYPE_RED2 ((devicetype_t)0x00000014)
#define ICSNEO_DEVICETYPE_ETHERBADGE ((devicetype_t)0x00000016)
#define ICSNEO_DEVICETYPE_RAD_A2B ((devicetype_t)0x00000017)
#define ICSNEO_DEVICETYPE_RADEPSILON ((devicetype_t)0x00000018)
#define ICSNEO_DEVICETYPE_RADEPSILONXL ((devicetype_t)0x0000001e)
#define ICSNEO_DEVICETYPE_RADGALAXY2 ((devicetype_t)0x00000021)
#define ICSNEO_DEVICETYPE_RADMoon3 ((devicetype_t)0x00000023)
#define ICSNEO_DEVICETYPE_RADCOMET ((devicetype_t)0x00000024)
#define ICSNEO_DEVICETYPE_FIRE3FLEXRAY ((devicetype_t)0x00000025)
#define ICSNEO_DEVICETYPE_CONNECT ((devicetype_t)0x00000026)
#define ICSNEO_DEVICETYPE_RADCOMET3 ((devicetype_t)0x00000027)
#define ICSNEO_DEVICETYPE_RADMOONT1S ((devicetype_t)0x00000028)
#define ICSNEO_DEVICETYPE_RADGIGASTAR2 ((devicetype_t)0x00000029)
#define ICSNEO_DEVICETYPE_FIRE3_T1S_LIN ((devicetype_t)0x0000002A)
#define ICSNEO_DEVICETYPE_FIRE3_T1S_SENT ((devicetype_t)0x0000002B)
#define ICSNEO_DEVICETYPE_RADGEMINI ((devicetype_t)0x0000002C)
#define ICSNEO_DEVICETYPE_RED ((devicetype_t)0x00000040)
#define ICSNEO_DEVICETYPE_ECU ((devicetype_t)0x00000080)
#define ICSNEO_DEVICETYPE_IEVB ((devicetype_t)0x00000100)
#define ICSNEO_DEVICETYPE_PENDANT ((devicetype_t)0x00000200)
#define ICSNEO_DEVICETYPE_OBD2_PRO ((devicetype_t)0x00000400)
#define ICSNEO_DEVICETYPE_ECUCHIP_UART ((devicetype_t)0x00000800)
#define ICSNEO_DEVICETYPE_PLASMA ((devicetype_t)0x00001000)
#define ICSNEO_DEVICETYPE_UNKNOWN ((devicetype_t)icsneoc2_devicetype_unknown)
#define ICSNEO_DEVICETYPE_BLUE ((devicetype_t)icsneoc2_devicetype_blue)
#define ICSNEO_DEVICETYPE_ECU_AVB ((devicetype_t)icsneoc2_devicetype_ecu_avb)
#define ICSNEO_DEVICETYPE_RADSUPERMOON ((devicetype_t)icsneoc2_devicetype_rad_supermoon)
#define ICSNEO_DEVICETYPE_DW_VCAN ((devicetype_t)icsneoc2_devicetype_dw_vcan)
#define ICSNEO_DEVICETYPE_RADMOON2 ((devicetype_t)icsneoc2_devicetype_rad_moon2)
#define ICSNEO_DEVICETYPE_RADMARS ((devicetype_t)icsneoc2_devicetype_rad_mars)
#define ICSNEO_DEVICETYPE_VCAN4_1 ((devicetype_t)icsneoc2_devicetype_vcan41)
#define ICSNEO_DEVICETYPE_FIRE ((devicetype_t)icsneoc2_devicetype_fire)
#define ICSNEO_DEVICETYPE_RADPLUTO ((devicetype_t)icsneoc2_devicetype_rad_pluto)
#define ICSNEO_DEVICETYPE_VCAN4_2EL ((devicetype_t)icsneoc2_devicetype_vcan42_el)
#define ICSNEO_DEVICETYPE_RADIO_CANHUB ((devicetype_t)icsneoc2_devicetype_radio_canhub)
#define ICSNEO_DEVICETYPE_NEOECU12 ((devicetype_t)icsneoc2_devicetype_neo_ecu12)
#define ICSNEO_DEVICETYPE_OBD2_LCBADGE ((devicetype_t)icsneoc2_devicetype_obd2_lc_badge)
#define ICSNEO_DEVICETYPE_RADMOONDUO ((devicetype_t)icsneoc2_devicetype_rad_moon_duo)
#define ICSNEO_DEVICETYPE_FIRE3 ((devicetype_t)icsneoc2_devicetype_fire3)
#define ICSNEO_DEVICETYPE_VCAN3 ((devicetype_t)icsneoc2_devicetype_vcan3)
#define ICSNEO_DEVICETYPE_RADJUPITER ((devicetype_t)icsneoc2_devicetype_rad_jupiter)
#define ICSNEO_DEVICETYPE_VCAN4_IND ((devicetype_t)icsneoc2_devicetype_vcan4_industrial)
#define ICSNEO_DEVICETYPE_RADGIGASTAR ((devicetype_t)icsneoc2_devicetype_rad_gigastar)
#define ICSNEO_DEVICETYPE_RED2 ((devicetype_t)icsneoc2_devicetype_red2)
#define ICSNEO_DEVICETYPE_ETHERBADGE ((devicetype_t)icsneoc2_devicetype_etherbadge)
#define ICSNEO_DEVICETYPE_RAD_A2B ((devicetype_t)icsneoc2_devicetype_rad_a2b)
#define ICSNEO_DEVICETYPE_RADEPSILON ((devicetype_t)icsneoc2_devicetype_rad_epsilon)
#define ICSNEO_DEVICETYPE_RADEPSILONXL ((devicetype_t)icsneoc2_devicetype_rad_epsilon_xl)
#define ICSNEO_DEVICETYPE_RADGALAXY2 ((devicetype_t)icsneoc2_devicetype_rad_galaxy2)
#define ICSNEO_DEVICETYPE_RADMoon3 ((devicetype_t)icsneoc2_devicetype_rad_moon3)
#define ICSNEO_DEVICETYPE_RADCOMET ((devicetype_t)icsneoc2_devicetype_rad_comet)
#define ICSNEO_DEVICETYPE_FIRE3FLEXRAY ((devicetype_t)icsneoc2_devicetype_fire3_flexray)
#define ICSNEO_DEVICETYPE_CONNECT ((devicetype_t)icsneoc2_devicetype_connect)
#define ICSNEO_DEVICETYPE_RADCOMET3 ((devicetype_t)icsneoc2_devicetype_rad_comet3)
#define ICSNEO_DEVICETYPE_RADMOONT1S ((devicetype_t)icsneoc2_devicetype_rad_moon_t1s)
#define ICSNEO_DEVICETYPE_RADGIGASTAR2 ((devicetype_t)icsneoc2_devicetype_rad_gigastar2)
#define ICSNEO_DEVICETYPE_FIRE3_T1S_LIN ((devicetype_t)icsneoc2_devicetype_fire3_t1s_lin)
#define ICSNEO_DEVICETYPE_FIRE3_T1S_SENT ((devicetype_t)icsneoc2_devicetype_fire3_t1s_sent)
#define ICSNEO_DEVICETYPE_RADGEMINI ((devicetype_t)icsneoc2_devicetype_rad_gemini)
#define ICSNEO_DEVICETYPE_RED ((devicetype_t)icsneoc2_devicetype_red)
#define ICSNEO_DEVICETYPE_ECU ((devicetype_t)icsneoc2_devicetype_ecu)
#define ICSNEO_DEVICETYPE_IEVB ((devicetype_t)icsneoc2_devicetype_ievb)
#define ICSNEO_DEVICETYPE_PENDANT ((devicetype_t)icsneoc2_devicetype_pendant)
#define ICSNEO_DEVICETYPE_OBD2_PRO ((devicetype_t)icsneoc2_devicetype_obd2_pro)
#define ICSNEO_DEVICETYPE_ECUCHIP_UART ((devicetype_t)icsneoc2_devicetype_ecuchip_uart)
#define ICSNEO_DEVICETYPE_PLASMA ((devicetype_t)icsneoc2_devicetype_plasma)
#define ICSNEO_DEVICETYPE_DONT_REUSE0 ((devicetype_t)0x00002000) // Previously FIRE_VNET
#define ICSNEO_DEVICETYPE_NEOANALOG ((devicetype_t)0x00004000)
#define ICSNEO_DEVICETYPE_CT_OBD ((devicetype_t)0x00008000)
#define ICSNEO_DEVICETYPE_NEOANALOG ((devicetype_t)icsneoc2_devicetype_neo_analog)
#define ICSNEO_DEVICETYPE_CT_OBD ((devicetype_t)icsneoc2_devicetype_ct_obd)
#define ICSNEO_DEVICETYPE_DONT_REUSE1 ((devicetype_t)0x00010000) // Previously PLASMA_1_12
#define ICSNEO_DEVICETYPE_DONT_REUSE2 ((devicetype_t)0x00020000) // Previously PLASMA_1_13
#define ICSNEO_DEVICETYPE_ION ((devicetype_t)0x00040000)
#define ICSNEO_DEVICETYPE_RADSTAR ((devicetype_t)0x00080000)
#define ICSNEO_DEVICETYPE_ION ((devicetype_t)icsneoc2_devicetype_ion)
#define ICSNEO_DEVICETYPE_RADSTAR ((devicetype_t)icsneoc2_devicetype_rad_star)
#define ICSNEO_DEVICETYPE_DONT_REUSE3 ((devicetype_t)0x00100000) // Previously ION3
#define ICSNEO_DEVICETYPE_VCAN4_4 ((devicetype_t)0x00200000)
#define ICSNEO_DEVICETYPE_VCAN4_2 ((devicetype_t)0x00400000)
#define ICSNEO_DEVICETYPE_CMPROBE ((devicetype_t)0x00800000)
#define ICSNEO_DEVICETYPE_EEVB ((devicetype_t)0x01000000)
#define ICSNEO_DEVICETYPE_VCANRF ((devicetype_t)0x02000000)
#define ICSNEO_DEVICETYPE_FIRE2 ((devicetype_t)0x04000000)
#define ICSNEO_DEVICETYPE_FLEX ((devicetype_t)0x08000000)
#define ICSNEO_DEVICETYPE_RADGALAXY ((devicetype_t)0x10000000)
#define ICSNEO_DEVICETYPE_RADSTAR2 ((devicetype_t)0x20000000)
#define ICSNEO_DEVICETYPE_VIVIDCAN ((devicetype_t)0x40000000)
#define ICSNEO_DEVICETYPE_OBD2_SIM ((devicetype_t)0x80000000)
#define ICSNEO_DEVICETYPE_VCAN4_4 ((devicetype_t)icsneoc2_devicetype_vcan44)
#define ICSNEO_DEVICETYPE_VCAN4_2 ((devicetype_t)icsneoc2_devicetype_vcan42)
#define ICSNEO_DEVICETYPE_CMPROBE ((devicetype_t)icsneoc2_devicetype_cm_probe)
#define ICSNEO_DEVICETYPE_EEVB ((devicetype_t)icsneoc2_devicetype_eevb)
#define ICSNEO_DEVICETYPE_VCANRF ((devicetype_t)icsneoc2_devicetype_vcan_rf)
#define ICSNEO_DEVICETYPE_FIRE2 ((devicetype_t)icsneoc2_devicetype_fire2)
#define ICSNEO_DEVICETYPE_FLEX ((devicetype_t)icsneoc2_devicetype_flex)
#define ICSNEO_DEVICETYPE_RADGALAXY ((devicetype_t)icsneoc2_devicetype_rad_galaxy)
#define ICSNEO_DEVICETYPE_RADSTAR2 ((devicetype_t)icsneoc2_devicetype_rad_star2)
#define ICSNEO_DEVICETYPE_VIVIDCAN ((devicetype_t)icsneoc2_devicetype_vividcan)
#define ICSNEO_DEVICETYPE_OBD2_SIM ((devicetype_t)icsneoc2_devicetype_obd2_sim)
#endif
#endif
+25 -24
View File
@@ -3,6 +3,7 @@
#include <stdint.h>
#include "icsneo/platform/unaligned.h"
#include "icsneo/icsneoc2types.h"
#pragma pack(push, 2)
@@ -48,24 +49,24 @@ enum
enum AELinkMode
{
AE_LINK_INVALID = -1,
AE_LINK_AUTO = 0,
AE_LINK_MASTER,
AE_LINK_SLAVE
AE_LINK_INVALID = icsneoc2_ae_link_mode_invalid,
AE_LINK_AUTO = icsneoc2_ae_link_mode_auto,
AE_LINK_MASTER = icsneoc2_ae_link_mode_master,
AE_LINK_SLAVE = icsneoc2_ae_link_mode_slave
};
enum EthPhyLinkMode
{
ETH_LINK_MODE_AUTO_NEGOTIATION = 0,
ETH_LINK_MODE_10MBPS_HALFDUPLEX,
ETH_LINK_MODE_10MBPS_FULLDUPLEX,
ETH_LINK_MODE_100MBPS_HALFDUPLEX,
ETH_LINK_MODE_100MBPS_FULLDUPLEX,
ETH_LINK_MODE_1GBPS_HALFDUPLEX,
ETH_LINK_MODE_1GBPS_FULLDUPLEX,
ETH_LINK_MODE_2_5GBPS_FULLDUPLEX,
ETH_LINK_MODE_5GBPS_FULLDUPLEX,
ETH_LINK_MODE_10GBPS_FULLDUPLEX
ETH_LINK_MODE_AUTO_NEGOTIATION = icsneoc2_eth_phy_link_mode_auto_negotiation,
ETH_LINK_MODE_10MBPS_HALFDUPLEX = icsneoc2_eth_phy_link_mode_10mbps_halfduplex,
ETH_LINK_MODE_10MBPS_FULLDUPLEX = icsneoc2_eth_phy_link_mode_10mbps_full_duplex,
ETH_LINK_MODE_100MBPS_HALFDUPLEX = icsneoc2_eth_phy_link_mode_100mbps_half_duplex,
ETH_LINK_MODE_100MBPS_FULLDUPLEX = icsneoc2_eth_phy_link_mode_100mbps_full_duplex,
ETH_LINK_MODE_1GBPS_HALFDUPLEX = icsneoc2_eth_phy_link_mode_1gbps_half_duplex,
ETH_LINK_MODE_1GBPS_FULLDUPLEX = icsneoc2_eth_phy_link_mode_1gbps_full_duplex,
ETH_LINK_MODE_2_5GBPS_FULLDUPLEX = icsneoc2_eth_phy_link_mode_2_5gbps_full_duplex,
ETH_LINK_MODE_5GBPS_FULLDUPLEX = icsneoc2_eth_phy_link_mode_5gbps_full_duplex,
ETH_LINK_MODE_10GBPS_FULLDUPLEX = icsneoc2_eth_phy_link_mode_10gbps_full_duplex
};
typedef struct
@@ -615,10 +616,10 @@ enum : uint8_t
/* Mode in LIN_SETTINGS */
enum LINMode
{
SLEEP_MODE,
SLOW_MODE,
NORMAL_MODE,
FAST_MODE
SLEEP_MODE = icsneoc2_lin_mode_sleep,
SLOW_MODE = icsneoc2_lin_mode_slow,
NORMAL_MODE = icsneoc2_lin_mode_normal,
FAST_MODE = icsneoc2_lin_mode_fast
};
typedef struct _LIN_SETTINGS
@@ -752,12 +753,12 @@ namespace icsneo {
enum class MiscIOAnalogVoltage : uint8_t
{
V0 = 0,
V1 = 1,
V2 = 2,
V3 = 3,
V4 = 4,
V5 = 5
V0 = icsneoc2_misc_io_analog_voltage_v0,
V1 = icsneoc2_misc_io_analog_voltage_v1,
V2 = icsneoc2_misc_io_analog_voltage_v2,
V3 = icsneoc2_misc_io_analog_voltage_v3,
V4 = icsneoc2_misc_io_analog_voltage_v4,
V5 = icsneoc2_misc_io_analog_voltage_v5
};
class IDeviceSettings {
+3 -2
View File
@@ -6,12 +6,13 @@
#include <cstdint>
#include <vector>
#include <icsneo/api/eventmanager.h>
#include <icsneo/icsneoc2types.h>
namespace icsneo {
enum class DiskLayout : uint8_t {
Spanned = 0,
RAID0 = 1
Spanned = icsneoc2_disk_layout_spanned,
RAID0 = icsneoc2_disk_layout_raid0
};
struct DiskInfo {
+919
View File
@@ -0,0 +1,919 @@
#ifndef __ICSNEOC2_H_
#define __ICSNEOC2_H_
#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
#include <icsneo/icsneoc2types.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct icsneoc2_device_info_t icsneoc2_device_info_t;
typedef struct icsneoc2_device_t icsneoc2_device_t;
typedef struct icsneoc2_message_t icsneoc2_message_t;
typedef struct icsneoc2_event_t icsneoc2_event_t;
typedef enum _icsneoc2_error_t {
icsneoc2_error_success, // Function was successful
icsneoc2_error_invalid_parameters, // Invalid parameters, typically because of a NULL reference.
icsneoc2_error_open_failed, // Error opening the device.
icsneoc2_error_go_online_failed, // Error going online.
icsneoc2_error_enable_message_polling_failed, // Error enabling message polling.
icsneoc2_error_sync_rtc_failed, // Error syncing RTC.
icsneoc2_error_get_messages_failed, // Error getting messages.
icsneoc2_error_invalid_type, // Generic invalid type error
icsneoc2_error_rtc_failure, // Generic RTC error code
icsneoc2_error_get_settings_failure, // Error getting settings
icsneoc2_error_set_settings_failure, // Error setting settings
icsneoc2_error_transmit_message_failed, // Failed to transmit message
icsneoc2_error_string_copy_failed, // Failed to copy string to buffer
icsneoc2_error_invalid_device, // Invalid device parameter
icsneoc2_error_invalid_message, // Invalid message parameter
icsneoc2_error_out_of_memory, // Out of memory
icsneoc2_error_format_disk_failed, // Failed to format disk
icsneoc2_error_script_start_failed, // Failed to start script
icsneoc2_error_script_stop_failed, // Failed to stop script
icsneoc2_error_script_clear_failed, // Failed to clear script
icsneoc2_error_script_upload_failed, // Failed to upload coremini script
icsneoc2_error_script_load_prepare_failed, // Failed to prepare script load
// NOTE: Any new values added here should be updated in icsneoc2_error_code_get
icsneoc2_error_maxsize
} _icsneoc2_error_t;
typedef uint32_t icsneoc2_error_t;
static const icsneoc2_open_options_t icsneoc2_open_options_default =
ICSNEOC2_OPEN_OPTIONS_GO_ONLINE | ICSNEOC2_OPEN_OPTIONS_SYNC_RTC | ICSNEOC2_OPEN_OPTIONS_ENABLE_AUTO_UPDATE;
/**
* Get the error string for an error code.
*
* @param[in] error_code The error code to get the description of.
* @param[out] value Pointer to a buffer to copy the description into. Null terminated.
* @param[in,out] value_length Size of the value buffer. Modified with the length of the description.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_error_code_get(icsneoc2_error_t error_code, char* value, size_t* value_length);
/**
* Get the device type string for a icsneoc2_devicetype_t.
*
* @param[in] device_type The device type to get the description of.
* @param[out] value Pointer to a buffer to copy the description into. Null terminated.
* @param[in,out] value_length Size of the value buffer. Modified with the length of the description.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_device_type_name_get(icsneoc2_devicetype_t device_type, char* value, size_t* value_length);
/**
* Enumerate connected devices. Returns head of an opaque linked list.
* Pass 0 for device_type to enumerate all devices, or a specific type to filter.
*
* @param[in] device_type The device type to filter by, or 0 for all devices.
* @param[out] devices Pointer to receive the head of the device info linked list.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful.
*
* @see icsneoc2_enumeration_free
*/
icsneoc2_error_t icsneoc2_device_enumerate(icsneoc2_devicetype_t device_type, icsneoc2_device_info_t** devices);
/**
* Free an enumeration list returned by icsneoc2_device_enumerate().
* Safe to call after opening devices from the list.
*
* @param[in] devices The head of the device info linked list to free.
*/
void icsneoc2_enumeration_free(icsneoc2_device_info_t* devices);
/**
* Advance to the next device in an enumeration list.
*
* @param[in] device_info The current device info node.
*
* @return The next device info node, or NULL at the end of the list.
*/
icsneoc2_device_info_t* icsneoc2_device_info_next(const icsneoc2_device_info_t* device_info);
/**
* Get the serial number of an enumerated device.
*
* @param[in] device_info The device info node.
* @param[out] serial Buffer to copy the serial string into. Null terminated.
* @param[in,out] serial_length Size of the serial buffer. Modified with the length of the serial.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful.
*/
icsneoc2_error_t icsneoc2_device_info_serial_get(const icsneoc2_device_info_t* device_info, char* serial, size_t* serial_length);
/**
* Get the device type of an enumerated device.
*
* @param[in] device_info The device info node.
* @param[out] type Pointer to receive the device type.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful.
*/
icsneoc2_error_t icsneoc2_device_info_type_get(const icsneoc2_device_info_t* device_info, icsneoc2_devicetype_t* type);
/**
* Get the human-readable type name of an enumerated device.
*
* @param[in] device_info The device info node.
* @param[out] type_name Buffer to copy the type name into. Null terminated.
* @param[in,out] type_name_length Size of the buffer. Modified with the length of the name.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful.
*/
icsneoc2_error_t icsneoc2_device_info_type_name_get(const icsneoc2_device_info_t* device_info, char* type_name, size_t* type_name_length);
/**
* Get the full description of an enumerated device (e.g. "neoVI FIRE 3 RS2043").
*
* @param[in] device_info The device info node.
* @param[out] description Buffer to copy the description into. Null terminated.
* @param[in,out] description_length Size of the buffer. Modified with the length of the description.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful.
*/
icsneoc2_error_t icsneoc2_device_info_description_get(const icsneoc2_device_info_t* device_info, char* description, size_t* description_length);
/**
* Check to make sure a device is valid.
*
* @param[in] device The device to check.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_device_is_valid(const icsneoc2_device_t* device);
/**
* Check to make sure a device is open.
*
* @param[in] device The device to check.
* @param[out] is_open true if the device is open, false otherwise
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_device_is_open(const icsneoc2_device_t* device, bool* is_open);
/**
* Check if a device is disconnected.
*
* @param[in] device The device to check.
* @param[out] is_disconnected true if the device is disconnected, false otherwise
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_device_is_disconnected(const icsneoc2_device_t* device, bool* is_disconnected);
/**
* Open a device from an enumeration node.
*
* After a successful call, icsneoc2_device_close() must be called to close the device.
*
* @param[in] device_info The device info node to open.
* @param[in] options Open options (e.g. icsneoc2_open_options_default).
* @param[out] device Pointer to receive the opened device handle.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_open_failed otherwise.
*
* @see icsneoc2_device_close
*/
icsneoc2_error_t icsneoc2_device_open(const icsneoc2_device_info_t* device_info, icsneoc2_open_options_t options, icsneoc2_device_t** device);
/**
* Convenience: enumerate, find by serial, open, and free enumeration.
*
* @param[in] serial Serial number string to match (e.g. "RS2043").
* @param[in] options Open options (e.g. icsneoc2_open_options_default).
* @param[out] device Pointer to receive the opened device handle.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful.
*
* @see icsneoc2_device_close
*/
icsneoc2_error_t icsneoc2_device_open_serial(const char* serial, icsneoc2_open_options_t options, icsneoc2_device_t** device);
/**
* Convenience: enumerate, find first available device (optionally filtered by type), open, and free enumeration.
* Pass 0 for device_type to match any device.
*
* @param[in] device_type The device type to match, or 0 for any.
* @param[in] options Open options (e.g. icsneoc2_open_options_default).
* @param[out] device Pointer to receive the opened device handle.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful.
*
* @see icsneoc2_device_close
*/
icsneoc2_error_t icsneoc2_device_open_first(icsneoc2_devicetype_t device_type, icsneoc2_open_options_t options, icsneoc2_device_t** device);
/**
* Close a connection to a previously opened device.
*
* After a successful call to icsneoc2_device_open(), this function must be called to close the device.
* An already closed device will still succeed. All messages and events related to the device will be freed.
*
* @param[in,out] device Pointer to the device to close.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_device_is_valid() errors otherwise.
*
* @see icsneoc2_device_open icsneoc2_device_is_valid
*/
icsneoc2_error_t icsneoc2_device_close(icsneoc2_device_t* device);
/**
* Get the description of a device
*
* @param[in] device The device to get the description of.
* @param[out] value Pointer to a buffer to copy the description into. Null terminated.
* @param[in,out] value_length Size of the value buffer. Modified with the length of the description.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_device_description_get(const icsneoc2_device_t* device, char* value, size_t* value_length);
/**
* Get the type of a device
*
* @param[in] device The device to get the type of.
* @param[out] value Pointer to an icsneoc2_devicetype_t to copy the type into.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_device_type_get(const icsneoc2_device_t* device, icsneoc2_devicetype_t* value);
/**
* Get the serial of a device
*
* @param[in] device The device to get the serial of.
* @param[out] value Pointer to a buffer to copy the serial into. Null terminated.
* @param[in,out] value_length Size of the value buffer. Modified with the length of the serial.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_device_serial_get(const icsneoc2_device_t* device, char* value, size_t* value_length);
/**
* Set the online state of a device.
*
* @param[in] device The device to set the online state of.
* @param[in] go_online true to go online, false to go offline.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters or icsneoc2_error_go_online_failed otherwise.
*/
icsneoc2_error_t icsneoc2_device_go_online(const icsneoc2_device_t* device, bool go_online);
/**
* Get the online state of a device.
*
* @param[in] device The device to get the online state of.
* @param[out] is_online true if online, false if offline.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_device_is_online(const icsneoc2_device_t* device, bool* is_online);
/**
* Get the online supported state of a device.
*
* @param[in] device The device to get the online supported state of.
* @param[out] is_online_supported true if online supported, false if not.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_device_is_online_supported(const icsneoc2_device_t* device, bool* is_online_supported);
/**
* Set the message polling limit of a device.
*
* This will truncate the message queue to the specified limit.
*
* @param[in] device The device to enforce the message polling limit.
* @param[in] limit The limit to enforce.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_device_message_polling_limit_set(const icsneoc2_device_t* device, uint32_t limit);
/**
* Get the message polling limit of a device.
*
* @see icsneoc2_device_message_polling_limit_set
*
* @param[in] device The device to get the message polling limit from.
* @param[out] limit The limit to get.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_device_message_polling_limit_get(const icsneoc2_device_t* device, uint32_t* limit);
/**
* Get the timestamp resolution (nanoseconds) of a device
*
* @param[in] device The device to get the timestamp resolution of.
* @param[out] resolution Pointer to a uint32_t to copy the timestamp resolution in nanoseconds into.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_device_timestamp_resolution_get(icsneoc2_device_t* device, uint32_t* resolution);
/**
* Get a message from a device
*
* @param[in] device The device to get the message from.
* @param[out] message Pointer to a icsneoc2_message_t to copy the message into.
* @param[in] timeout_ms The timeout in milliseconds to wait for a message. A value of 0 indicates a non-blocking call.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*
* @see icsneoc2_message_free
*/
icsneoc2_error_t icsneoc2_device_message_get(const icsneoc2_device_t* device, icsneoc2_message_t** message, uint32_t timeout_ms);
/**
* Transmit messages from a device
*
* @param[in] device The device to transmit the message from.
* @param[in] messages Pointer to an icsneoc2_message_t to transmit.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters or icsneoc2_error_transmit_message_failed otherwise.
*/
icsneoc2_error_t icsneoc2_device_message_transmit(const icsneoc2_device_t* device, const icsneoc2_message_t* messages);
/**
* Get the network type string for a icsneoc2_network_type_t.
*
* @param[in] network_type The network type to get the description of.
* @param[out] value Pointer to a buffer to copy the description into. Null terminated.
* @param[in,out] value_length Size of the value buffer. Modified with the length of the description.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_network_type_name_get(icsneoc2_network_type_t network_type, char* value, size_t* value_length);
/**
* Get the last event to occur, with an optional device filter.
*
* @param[out] event Pointer to an icsneoc2_event_t to copy the event into.
* @param[in] device Optional device filter to get event for.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*
* @see icsneoc2_event_free
*/
icsneoc2_error_t icsneoc2_event_get(icsneoc2_event_t** event, const icsneoc2_device_t* device);
/**
* Pop the last event not related to a specific device.
*
* @param[out] event Pointer to an icsneoc2_event_t to copy the event into.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_event_free(icsneoc2_event_t* event);
/**
* Get the description of an event.
*
* @param[in] event The event to get the description of.
* @param[out] value Pointer to a buffer to copy the description into. Null terminated.
* @param[in,out] value_length Size of the value buffer. Modified with the length of the description.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_event_description_get(const icsneoc2_event_t* event, char* value, size_t* value_length);
/**
* Get the RTC (Real time clock) of a device.
*
* @param[in] device The device to get the RTC of.
* @param[out] unix_epoch Pointer to an int64_t to copy the RTC into.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_device_rtc_get(const icsneoc2_device_t* device, int64_t* unix_epoch);
/**
* Set the RTC (Real time clock) of a device.
*
* @param[in] device The device to set the RTC of.
* @param[in] unix_epoch int64_t to set the RTC to.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_device_rtc_set(const icsneoc2_device_t* device, int64_t unix_epoch);
/**
* Check if the device supports TC10.
*
* @param[in] device The device to check against.
* @param[out] supported Pointer to a bool to copy the value into.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_device_supports_tc10(const icsneoc2_device_t* device, bool* supported);
/**
* Get the current state of a digital I/O pin.
*
* @param[in] device The device to query.
* @param[in] type The I/O pin type.
* @param[in] number The pin number (for misc/emisc types).
* @param[out] value Pointer to store the current pin state.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_device_digital_io_get(const icsneoc2_device_t* device, icsneoc2_io_type_t type, uint32_t number, bool* value);
/**
* Set the state of a digital I/O pin.
*
* @param[in] device The device to configure.
* @param[in] type The I/O pin type.
* @param[in] number The pin number (for misc/emisc types).
* @param[in] value The desired pin state.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters or icsneoc2_error_set_settings_failure otherwise.
*/
icsneoc2_error_t icsneoc2_device_digital_io_set(const icsneoc2_device_t* device, icsneoc2_io_type_t type, uint32_t number, bool value);
/**
* Get the version of the icsneoc2 API.
*
* @param[out] value Pointer to a buffer to copy the version string into. Null terminated.
* @param[in,out] value_length Size of the value buffer. Modified with the length of the version string.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_version_get(char* value, size_t* value_length);
/**
* Convert a device serial number to a string.
*
* @param[in] num The serial number to convert.
* @param[out] str Pointer to a buffer to copy the serial string into. Null terminated.
* @param[in,out] str_length Size of the str buffer. Modified with the length of the serial string.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters or icsneoc2_error_string_copy_failed otherwise.
*/
icsneoc2_error_t icsneoc2_serial_num_to_string(uint32_t num, char* str, size_t* str_length);
/**
* Convert a device serial string to a number.
*
* @param[in] str The serial string to convert (e.g., "GS1128").
* @param[in] str_length The length of the serial string. This should match strlen(str).
* @param[out] num Pointer to store the converted serial number.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_serial_string_to_num(char* str, size_t str_length, uint32_t* num);
/**
* Get the number of disk slots on a device.
*
* @param[in] device The device to query.
* @param[out] count Pointer to receive the number of disk slots.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_device_disk_count_get(const icsneoc2_device_t* device, size_t* count);
/**
* Check if a device supports disk formatting.
*
* @param[in] device The device to query.
* @param[out] supported Pointer to receive true if the device supports disk formatting, false otherwise.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_device_supports_disk_formatting(const icsneoc2_device_t* device, bool* supported);
/**
* Query the current disk details from a device.
*
* On success, the caller owns the returned icsneoc2_disk_details_t and must free it
* with icsneoc2_disk_details_free() when done.
*
* @param[in] device The device to query.
* @param[out] disk_details Pointer to receive the allocated disk details handle.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful.
*
* @see icsneoc2_disk_details_free
*/
icsneoc2_error_t icsneoc2_device_disk_details_get(const icsneoc2_device_t* device, icsneoc2_disk_details_t** disk_details);
/**
* Free a disk details handle returned by icsneoc2_device_disk_details_get().
*
* @param[in] disk_details The disk details handle to free. May be NULL.
*/
void icsneoc2_disk_details_free(icsneoc2_disk_details_t* disk_details);
/**
* Get the number of disks described in a disk details handle.
*
* @param[in] disk_details The disk details handle.
* @param[out] count Pointer to receive the disk count.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_disk_details_count_get(const icsneoc2_disk_details_t* disk_details, size_t* count);
/**
* Get the layout of the disks (e.g. spanned or RAID0).
*
* @param[in] disk_details The disk details handle.
* @param[out] layout Pointer to receive the layout.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_disk_details_layout_get(const icsneoc2_disk_details_t* disk_details, icsneoc2_disk_layout_t* layout);
/**
* Set the layout of the disks (e.g. spanned or RAID0).
*
* @param[in] disk_details The disk details handle.
* @param[in] layout The layout to set.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_disk_details_layout_set(const icsneoc2_disk_details_t* disk_details, icsneoc2_disk_layout_t layout);
/**
* Get the status flags for a specific disk by index.
*
* Flags are a bitmask of icsneoc2_disk_format_flag_present, icsneoc2_disk_format_flag_initialized,
* and icsneoc2_disk_format_flag_formatted.
*
* @param[in] disk_details The disk details handle.
* @param[in] index Zero-based disk index.
* @param[out] flags Pointer to receive the flags bitmask.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters if out of range.
*/
icsneoc2_error_t icsneoc2_disk_details_flags_get(const icsneoc2_disk_details_t* disk_details, size_t index, icsneoc2_disk_format_flags_t* flags);
/**
* Set the status flags for a specific disk by index.
*
* Flags are a bitmask of icsneoc2_disk_format_flag_present, icsneoc2_disk_format_flag_initialized,
* and icsneoc2_disk_format_flag_formatted.
*
* @param[in] disk_details The disk details handle.
* @param[in] index Zero-based disk index.
* @param[in] flags Flags bitmask to apply.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters if out of range.
*/
icsneoc2_error_t icsneoc2_disk_details_flags_set(const icsneoc2_disk_details_t* disk_details, size_t index, icsneoc2_disk_format_flags_t flags);
/**
* Get the size of a specific disk by index.
*
* @param[in] disk_details The disk details handle.
* @param[in] index Zero-based disk index.
* @param[out] sectors Pointer to receive the number of sectors.
* @param[out] bytes_per_sector Pointer to receive the number of bytes per sector.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters if out of range.
*/
icsneoc2_error_t icsneoc2_disk_details_size_get(const icsneoc2_disk_details_t* disk_details, size_t index, uint64_t* sectors, uint64_t* bytes_per_sector);
/**
* Get whether a full format is configured.
*
* @param[in] disk_details The disk details handle.
* @param[out] full_format Pointer to receive true for full format, false for quick format.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_disk_details_full_format_get(const icsneoc2_disk_details_t* disk_details, bool* full_format);
/**
* Set whether to perform a full format.
*
* @param[in] disk_details The disk details handle.
* @param[in] full_format true for a full (slow) format, false for a quick format.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_disk_details_full_format_set(const icsneoc2_disk_details_t* disk_details, bool full_format);
/**
* Format the disk(s) on a device.
*
* This is a blocking call that runs until formatting completes or the progress callback
* returns icsneoc2_disk_format_directive_stop.
*
* @param[in] device The device whose disks should be formatted.
* @param[in] disk_details A disk details handle describing the format configuration.
* Use icsneoc2_device_disk_details_get() to obtain a handle, then modify flags
* (set icsneoc2_disk_format_flag_formatted on disks you want to format).
* @param[in] progress_callback Optional callback invoked periodically with progress.
* Return icsneoc2_disk_format_directive_continue to keep going, or
* icsneoc2_disk_format_directive_stop to cancel. May be NULL.
* @param[in] user_data Opaque pointer passed through to the progress callback.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_format_disk_failed otherwise.
*/
icsneoc2_error_t icsneoc2_device_format_disk(const icsneoc2_device_t* device, icsneoc2_disk_details_t* disk_details, icsneoc2_disk_format_progress_fn progress_callback, void* user_data);
/**
* Get the list of networks this device supports for receiving.
*
* If networks is NULL, only the count is written. Otherwise, up to *count network IDs
* are copied into the caller-provided buffer and *count is set to the number written.
*
* @param[in] device The device to query.
* @param[out] networks Caller-allocated array to receive network IDs, or NULL to query count only.
* @param[in,out] count On input, the maximum number of entries the buffer can hold.
* On output, the number of entries written (or total available if networks is NULL).
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_device_supported_rx_networks_get(const icsneoc2_device_t* device, icsneoc2_netid_t* networks, size_t* count);
/**
* Get the list of networks this device supports for transmitting.
*
* If networks is NULL, only the count is written. Otherwise, up to *count network IDs
* are copied into the caller-provided buffer and *count is set to the number written.
*
* @param[in] device The device to query.
* @param[out] networks Caller-allocated array to receive network IDs, or NULL to query count only.
* @param[in,out] count On input, the maximum number of entries the buffer can hold.
* On output, the number of entries written (or total available if networks is NULL).
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_device_supported_tx_networks_get(const icsneoc2_device_t* device, icsneoc2_netid_t* networks, size_t* count);
/**
* Check whether this device supports CoreMini scripts.
*
* @param[in] device The device to query.
* @param[out] supported Set to true if the device supports CoreMini scripts, false otherwise.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_device_supports_coremini_script(const icsneoc2_device_t* device, bool* supported);
/**
* Start a CoreMini script on the device.
*
* @param[in] device The device to start the script on.
* @param[in] memory_type The memory location of the script (flash or SD).
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_script_start_failed otherwise.
*/
icsneoc2_error_t icsneoc2_device_script_start(const icsneoc2_device_t* device, icsneoc2_memory_type_t memory_type);
/**
* Stop a running CoreMini script on the device.
*
* @param[in] device The device to stop the script on.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_script_stop_failed otherwise.
*/
icsneoc2_error_t icsneoc2_device_script_stop(const icsneoc2_device_t* device);
/**
* Clear a CoreMini script from the device.
*
* @param[in] device The device to clear the script from.
* @param[in] memory_type The memory location to clear the script from (flash or SD).
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_script_clear_failed otherwise.
*/
icsneoc2_error_t icsneoc2_device_script_clear(const icsneoc2_device_t* device, icsneoc2_memory_type_t memory_type);
/**
* Prepare the device for a script load operation.
*
* @param[in] device The device to prepare.
* @param[out] status Receives the prepare status code from the device.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_script_load_prepare_failed otherwise.
*/
icsneoc2_error_t icsneoc2_device_script_prepare_load(const icsneoc2_device_t* device, int8_t* status);
/**
* Upload a CoreMini script to the device from a file path.
*
* @param[in] device The device to upload to.
* @param[in] path Null-terminated file path to the CoreMini binary.
* @param[in] memory_type The memory location to upload to (flash or SD).
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_script_upload_failed otherwise.
*/
icsneoc2_error_t icsneoc2_device_coremini_upload_file(const icsneoc2_device_t* device, const char* path, icsneoc2_memory_type_t memory_type);
/**
* Upload a CoreMini script to the device from a memory buffer.
*
* @param[in] device The device to upload to.
* @param[in] data Pointer to the CoreMini binary data.
* @param[in] length Length of the data in bytes.
* @param[in] memory_type The memory location to upload to (flash or SD).
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_script_upload_failed otherwise.
*/
icsneoc2_error_t icsneoc2_device_coremini_upload(const icsneoc2_device_t* device, const uint8_t* data, size_t length, icsneoc2_memory_type_t memory_type);
/**
* Get the current script status from the device.
*
* Returns an opaque handle that must be freed with icsneoc2_script_status_free() when done.
*
* @param[in] device The device to query.
* @param[out] script_status Receives a newly allocated script status handle.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful.
* @see icsneoc2_script_status_free
*/
icsneoc2_error_t icsneoc2_device_script_status_get(const icsneoc2_device_t* device, icsneoc2_script_status_t** script_status);
/**
* Free a script status handle returned by icsneoc2_device_script_status_get().
*
* @param[in] script_status The handle to free. May be NULL.
*/
void icsneoc2_script_status_free(icsneoc2_script_status_t* script_status);
/**
* Get whether the CoreMini script is currently running.
*
* @param[in] script_status The script status handle.
* @param[out] value Set to true if a script is running, false otherwise.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_script_status_is_coremini_running(const icsneoc2_script_status_t* script_status, bool* value);
/**
* Get whether the script is encrypted.
*
* @param[in] script_status The script status handle.
* @param[out] value Set to true if the script is encrypted, false otherwise.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_script_status_is_encrypted(const icsneoc2_script_status_t* script_status, bool* value);
/**
* Get the number of sector overflows.
*
* @param[in] script_status The script status handle.
* @param[out] value Receives the sector overflow count.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_script_status_sector_overflows_get(const icsneoc2_script_status_t* script_status, uint32_t* value);
/**
* Get the number of remaining sector buffers.
*
* @param[in] script_status The script status handle.
* @param[out] value Receives the remaining sector buffer count.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_script_status_remaining_sector_buffers_get(const icsneoc2_script_status_t* script_status, uint32_t* value);
/**
* Get the last sector written.
*
* @param[in] script_status The script status handle.
* @param[out] value Receives the last sector value.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_script_status_last_sector_get(const icsneoc2_script_status_t* script_status, uint32_t* value);
/**
* Get the read binary size.
*
* @param[in] script_status The script status handle.
* @param[out] value Receives the read binary size in bytes.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_script_status_read_bin_size_get(const icsneoc2_script_status_t* script_status, uint32_t* value);
/**
* Get the minimum sector.
*
* @param[in] script_status The script status handle.
* @param[out] value Receives the minimum sector value.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_script_status_min_sector_get(const icsneoc2_script_status_t* script_status, uint32_t* value);
/**
* Get the maximum sector.
*
* @param[in] script_status The script status handle.
* @param[out] value Receives the maximum sector value.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_script_status_max_sector_get(const icsneoc2_script_status_t* script_status, uint32_t* value);
/**
* Get the current sector.
*
* @param[in] script_status The script status handle.
* @param[out] value Receives the current sector value.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_script_status_current_sector_get(const icsneoc2_script_status_t* script_status, uint32_t* value);
/**
* Get the CoreMini creation timestamp.
*
* @param[in] script_status The script status handle.
* @param[out] value Receives the creation timestamp as a Unix epoch value.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_script_status_coremini_create_time_get(const icsneoc2_script_status_t* script_status, uint64_t* value);
/**
* Get the file checksum.
*
* @param[in] script_status The script status handle.
* @param[out] value Receives the file checksum.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_script_status_file_checksum_get(const icsneoc2_script_status_t* script_status, uint16_t* value);
/**
* Get the CoreMini version.
*
* @param[in] script_status The script status handle.
* @param[out] value Receives the CoreMini version.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_script_status_coremini_version_get(const icsneoc2_script_status_t* script_status, uint16_t* value);
/**
* Get the CoreMini header size.
*
* @param[in] script_status The script status handle.
* @param[out] value Receives the CoreMini header size in bytes.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_script_status_coremini_header_size_get(const icsneoc2_script_status_t* script_status, uint16_t* value);
/**
* Get the diagnostic error code.
*
* @param[in] script_status The script status handle.
* @param[out] value Receives the diagnostic error code.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_script_status_diagnostic_error_code_get(const icsneoc2_script_status_t* script_status, uint8_t* value);
/**
* Get the diagnostic error code count.
*
* @param[in] script_status The script status handle.
* @param[out] value Receives the diagnostic error code count.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_script_status_diagnostic_error_code_count_get(const icsneoc2_script_status_t* script_status, uint8_t* value);
/**
* Get the maximum CoreMini size in kilobytes.
*
* @param[in] script_status The script status handle.
* @param[out] value Receives the maximum CoreMini size in KB.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_script_status_max_coremini_size_kb_get(const icsneoc2_script_status_t* script_status, uint16_t* value);
#ifdef __cplusplus
}
#endif
#endif // __ICSNEOC2_H_
+190
View File
@@ -0,0 +1,190 @@
#ifndef __ICSNEOC2MESSAGES_H_
#define __ICSNEOC2MESSAGES_H_
#include <icsneo/icsneoc2.h>
#include <icsneo/icsneoc2types.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* Create CAN message
*
* @param[out] message Pointer to icsneoc2_message_t to copy the message into.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_message_can_create(icsneoc2_message_t** message);
/**
* Free message
*
* @param[in] message The message to free.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*
* @see icsneoc2_message_can_create icsneoc2_device_message_get
*/
icsneoc2_error_t icsneoc2_message_free(icsneoc2_message_t* message);
/**
* Get the transmission status of a message.
*
* When a message is transmitted from the device, it will be returned in the receive buffer.
* @see icsneoc2_device_messages_transmit
*
* @param[in] message The message to check.
* @param[out] value Pointer to a bool to copy the transmission status into.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_message_is_transmit(icsneoc2_message_t* message, bool* value);
/**
* Get the Network ID (netid) of a bus message
*
* @param[in] message The message to check.
* @param[out] netid Pointer to a icsneoc2_netid_t to copy the netid into.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters or icsneoc2_error_invalid_type otherwise.
*
* @see icsneoc2_netid_t, icsneoc2_netid_name_get
*/
icsneoc2_error_t icsneoc2_message_netid_get(icsneoc2_message_t* message, icsneoc2_netid_t* netid);
/**
* Get the netid string for a icsneoc2_netid_t.
*
* @param[in] netid The network id to get the description of.
* @param[out] value Pointer to a buffer to copy the description into. Null terminated.
* @param[in,out] value_length Size of the value buffer. Modified with the length of the description.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_netid_name_get(icsneoc2_netid_t netid, char* value, size_t* value_length);
/**
* Set the Network ID (netid) of a bus message
*
* @param[in] device The device to check against.
* @param[in] message The message to modify.
* @param[in] netid The netid to set.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_message_netid_set(icsneoc2_message_t* message, icsneoc2_netid_t netid);
/**
* Set the data bytes of a message
*
* @param[in] message The message to copy the data into.
* @param[in] data Pointer to a uint8_t array to copy from.
* @param[in] data_length length of the data.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_message_data_set(icsneoc2_message_t* message, uint8_t* data, size_t data_length);
/**
* Get the data bytes of a message
*
* @param[in] message The message to check.
* @param[out] data Pointer to a uint8_t to copy the data bytes into.
* @param[in,out] data_length Pointer to a size_t to copy the length of the data into.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_message_data_get(icsneoc2_message_t* message, uint8_t* data, size_t* data_length);
#define ICSNEOC2_MESSAGE_CAN_FLAGS_RTR UINT64_C(0x01) // Remote Transmission Request
#define ICSNEOC2_MESSAGE_CAN_FLAGS_IDE UINT64_C(0x02) // Identifier Extension
#define ICSNEOC2_MESSAGE_CAN_FLAGS_FDF UINT64_C(0x04) // FD Format Indicator
#define ICSNEOC2_MESSAGE_CAN_FLAGS_BRS UINT64_C(0x08) // Bit Rate Switch (FD only)
#define ICSNEOC2_MESSAGE_CAN_FLAGS_ESI UINT64_C(0x10) // Error State Indicator (FD only)
typedef uint64_t icsneoc2_message_can_flags_t;
/**
* Set the CAN specific properties of a message
*
* @param[in] message The message to modify.
* @param[in] arb_id Pointer to a uint64_t containing the arbitration ID to set. If NULL, it's ignored.
* @param[in] flags Pointer to a icsneoc2_message_can_flags_t containing the flags to set. If NULL, it's ignored. See icsneoc2_message_can_flags_t for details.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters or icsneoc2_error_invalid_type otherwise.
*/
icsneoc2_error_t icsneoc2_message_can_props_set(icsneoc2_message_t* message, const uint64_t* arb_id, const icsneoc2_message_can_flags_t* flags);
/**
* Get the CAN specific properties of a message
*
* @param[in] message The message to check.
* @param[out] arb_id Pointer to a uint64_t to copy the arbitration ID into. If NULL, it's ignored.
* @param[out] flags Pointer to a series of flags. If NULL, it's ignored. See icsneoc2_message_can_flags_t for details.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters or icsneoc2_error_invalid_type otherwise.
*/
icsneoc2_error_t icsneoc2_message_can_props_get(icsneoc2_message_t* message, uint64_t* arb_id, icsneoc2_message_can_flags_t* flags);
/**
* Check if a message is valid
*
* @param[in] device The device to check against.
* @param[in] message The message to check.
* @param[out] is_valid Pointer to a bool to copy the validity of the message into.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_message_is_valid(icsneoc2_message_t* message, bool* is_valid);
/**
* Check if a message is a raw message (message with data)
*
* @param[in] device The device to check against.
* @param[in] message The message to check.
* @param[out] is_raw Pointer to a bool to copy the raw status of the message into.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_message_is_raw(icsneoc2_message_t* message, bool* is_raw);
/**
* Check if a message is a frame message (message with data)
*
* @param[in] device The device to check against.
* @param[in] message The message to check.
* @param[out] is_frame Pointer to a bool to copy the frame status of the message into.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_message_is_frame(icsneoc2_message_t* message, bool* is_frame);
/**
* Check if a message is a CAN message
*
* @param[in] device The device to check against.
* @param[in] message The message to check.
* @param[out] is_can Pointer to a bool to copy the CAN status of the message into.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_message_is_can(icsneoc2_message_t* message, bool* is_can);
/**
* Get the network type of a message
*
* @param[in] message The message to check.
* @param[out] network_type Pointer to a icsneoc2_network_type_t to copy the network type into.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters or icsneoc2_error_invalid_type otherwise.
*
* @see icsneoc2_network_type_t, icsneoc2_network_type_name_get
*/
icsneoc2_error_t icsneoc2_message_network_type_get(icsneoc2_message_t* message, icsneoc2_network_type_t* network_type);
#ifdef __cplusplus
}
#endif
#endif // __ICSNEOC2MESSAGES_H_
+527
View File
@@ -0,0 +1,527 @@
#ifndef __ICSNEOC2SETTINGS_H_
#define __ICSNEOC2SETTINGS_H_
#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
#include <icsneo/icsneoc2.h>
#include <icsneo/icsneoc2types.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* Apply the default settings for a device
*
* @param[in] device The device to apply the settings for.
* @param[in] save True to make the settings permanent, false will be reverted on power cycle.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters or icsneoc2_error_set_settings_failure otherwise.
*/
icsneoc2_error_t icsneoc2_settings_apply_defaults(icsneoc2_device_t* device, bool save);
/**
* Apply the current settings for a device.
*
* This makes all settings persistent across power cycles.
*
* @param[in] device The device to apply the settings for.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters or icsneoc2_error_set_settings_failure otherwise.
*/
icsneoc2_error_t icsneoc2_settings_apply(icsneoc2_device_t* device);
/**
* Refresh the settings for a device. This reads the current settings from the device,
* overwriting any unsaved local changes.
*
* @param[in] device The device to refresh the settings for.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters or icsneoc2_error_get_settings_failure otherwise.
*/
icsneoc2_error_t icsneoc2_settings_refresh(icsneoc2_device_t* device);
/**
* Get the baudrate for a network
*
* @note @see icsneoc2_settings_canfd_baudrate_get for CANFD.
*
* @param[in] device The device to get the baudrate value.
* @param[in] netid The network to get the baudrate value.
* @param[out] baudrate Pointer to store the baudrate value.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_settings_baudrate_get(icsneoc2_device_t* device, icsneoc2_netid_t netid, int64_t* baudrate);
/**
* Set the baudrate for a network
*
* @note @see icsneoc2_settings_canfd_baudrate_set for CANFD.
*
* @param[in] device The device to set the baudrate for.
* @param[in] netid The network to set the baudrate for.
* @param[in] baudrate The baudrate to set the network to.
* @param[in] save True to make the settings permanent, false will be reverted on power cycle.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_settings_baudrate_set(icsneoc2_device_t* device, icsneoc2_netid_t netid, int64_t baudrate);
/**
* Get the baudrate for a CAN FD network
*
* @param[in] device The device to get the baudrate value.
* @param[in] netid The network to get the baudrate value.
* @param[out] baudrate Pointer to store the baudrate value.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_settings_canfd_baudrate_get(icsneoc2_device_t* device, icsneoc2_netid_t netid, int64_t* baudrate);
/**
* Set the baudrate for a CANFD network
*
* @param[in] device The device to set the baudrate for.
* @param[in] netid The network to set the baudrate for.
* @param[in] baudrate The baudrate to set the network to.
* @param[in] save True to make the settings permanent, false will be reverted on power cycle.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_settings_canfd_baudrate_set(icsneoc2_device_t* device, icsneoc2_netid_t netid, int64_t baudrate);
/**
* Check if termination is supported for a network.
*
* @param[in] device The device to check.
* @param[in] netid The network ID to check termination support for.
* @param[out] supported Pointer to store whether termination is supported.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_settings_termination_is_supported(icsneoc2_device_t* device, icsneoc2_netid_t netid, bool* supported);
/**
* Check if termination can be enabled for a network.
*
* Termination may be supported but not currently able to be enabled (e.g., due to hardware constraints).
*
* @param[in] device The device to check.
* @param[in] netid The network ID to check.
* @param[out] can_enable Pointer to store whether termination can be enabled.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_settings_termination_can_enable(icsneoc2_device_t* device, icsneoc2_netid_t netid, bool* can_enable);
/**
* Check if termination is currently enabled for a network.
*
* @param[in] device The device to check.
* @param[in] netid The network ID to check.
* @param[out] enabled Pointer to store whether termination is currently enabled.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_settings_termination_is_enabled(icsneoc2_device_t* device, icsneoc2_netid_t netid, bool* enabled);
/**
* Enable or disable termination for a network.
*
* @param[in] device The device to configure.
* @param[in] netid The network ID to configure termination for.
* @param[in] enable True to enable termination, false to disable.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters or icsneoc2_error_set_settings_failure otherwise.
*/
icsneoc2_error_t icsneoc2_settings_termination_set(icsneoc2_device_t* device, icsneoc2_netid_t netid, bool enable);
// TODO: getTerminationGroups
/**
* Check if the commander resistor is currently enabled for a network.
*
* @param[in] device The device to check.
* @param[in] netid The network ID to check.
* @param[out] enabled Pointer to store whether the commander resistor is currently enabled.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_settings_commander_resistor_enabled(icsneoc2_device_t* device, icsneoc2_netid_t netid, bool* enabled);
/**
* Enable or disable the commander resistor for a network.
*
* @param[in] device The device to configure.
* @param[in] netid The network ID to configure the commander resistor for.
* @param[in] enable True to enable the commander resistor, false to disable.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters or icsneoc2_error_set_settings_failure otherwise.
*/
icsneoc2_error_t icsneoc2_settings_commander_resistor_set(icsneoc2_device_t* device, icsneoc2_netid_t netid, bool enable);
/**
* Get the LIN mode for a given network in the currently active device settings.
*
* @param[in] device The device to check.
* @param[in] netid The network ID to check.
* @param[out] value Pointer to store the LIN mode.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_settings_lin_mode_get(icsneoc2_device_t* device, icsneoc2_netid_t netid, icsneoc2_lin_mode_t* value);
// TODO: setLINModeFor
/**
* Set the LIN mode for a given network in the currently active device settings.
*
* @param[in] device The device to configure.
* @param[in] netid The network ID to configure.
* @param[in] value The LIN mode to set.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_settings_lin_mode_set(icsneoc2_device_t* device, icsneoc2_netid_t netid, icsneoc2_lin_mode_t value);
/**
* Get number of bit delays between commander ID and first responder byte for
* a given network in the currently active device settings.
*
* @param[in] device The device to check.
* @param[in] netid The network ID to check.
* @param[out] value Pointer to store the number of bit delays.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_settings_lin_commander_response_time_get(icsneoc2_device_t* device, icsneoc2_netid_t netid, uint8_t* value);
/**
* Set number of bit delays between commander ID and first responder byte for
* a given network in the currently active device settings.
*
* @param[in] device The device to configure.
* @param[in] netid The network ID to configure.
* @param[in] value The number of bit delays to set.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_settings_lin_commander_response_time_set(icsneoc2_device_t* device, icsneoc2_netid_t netid, uint8_t value);
/**
* Get PHY enable state for switch devices (Epsilon/XL, Jupiter, etc) using port index.
* For all other devices, use icsneoc2_settings_phy_enable_for_get() instead.
*
* @param[in] device The device to check.
* @param[in] index The port index to check.
* @param[out] value Pointer to store the PHY enable state.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_settings_phy_enable_get(icsneoc2_device_t* device, uint8_t index, bool* value);
/**
* Enable/disable PHY for switch devices (Epsilon/XL, Jupiter, etc) using port index.
* For all other devices, use icsneoc2_settings_phy_enable_for_set() instead.
*
* @param[in] device The device to configure.
* @param[in] index The port index to configure.
* @param[in] value bool to set the PHY enable state.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_settings_phy_enable_set(icsneoc2_device_t* device, uint8_t index, bool value);
/**
* Get PHY role (Master/Slave/Auto) for switch devices (Epsilon/XL, Jupiter, etc) using port index.
* For all other devices, use icsneoc2_settings_phy_role_for_get() instead.
*
* @param[in] device The device to check.
* @param[in] index The port index to check.
* @param[out] value Pointer to store the link mode state.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_settings_phy_mode_get(icsneoc2_device_t* device, uint8_t index, icsneoc2_ae_link_mode_t* value);
/**
* Set PHY role (Master/Slave/Auto) for switch devices (Epsilon/XL, Jupiter, etc) using port index.
* For all other devices, use icsneoc2_settings_phy_role_for_set() instead.
*
* @param[in] device The device to configure.
* @param[in] index The port index to configure.
* @param[in] value The link mode state to set.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_settings_phy_mode_set(icsneoc2_device_t* device, uint8_t index, icsneoc2_ae_link_mode_t value);
/**
* Get PHY link mode (speed and duplex) for switch devices (Epsilon/XL, Jupiter, etc) using port index.
* For all other devices, use icsneoc2_settings_phy_link_mode_for_get() instead.
*
* @param[in] device The device to check.
* @param[in] index The port index to check.
* @param[out] value Pointer to store the link mode state.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_settings_phy_speed_get(icsneoc2_device_t* device, uint8_t index, icsneoc2_eth_phy_link_mode_t* value);
/**
* Set PHY link mode (speed and duplex) for switch devices (Epsilon/XL, Jupiter, etc) using port index.
* For all other devices, use icsneoc2_settings_phy_link_mode_for_set() instead.
*
* @param[in] device The device to configure.
* @param[in] index The port index to configure.
* @param[in] value The link mode state to set.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_settings_phy_speed_set(icsneoc2_device_t* device, uint8_t index, icsneoc2_eth_phy_link_mode_t value);
/**
* Get PHY role (Master/Slave/Auto) for network-based devices.
* For switch devices, use icsneoc2_settings_phy_mode_get() with port index instead.
*
* @param[in] device The device to check.
* @param[in] netid The network ID to check.
* @param[out] value Pointer to store the PHY role state.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_settings_phy_role_for_get(icsneoc2_device_t* device, icsneoc2_netid_t netid, icsneoc2_ae_link_mode_t* value);
/**
* Set PHY role (Master/Slave/Auto) for network-based devices.
* For switch devices, use icsneoc2_settings_phy_mode_set() with port index instead.
*
* @param[in] device The device to configure.
* @param[in] netid The network ID to configure.
* @param[in] value The PHY role state to set.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_settings_phy_role_for_set(icsneoc2_device_t* device, icsneoc2_netid_t netid, icsneoc2_ae_link_mode_t value);
/**
* Get PHY link mode (speed and duplex) for network-based devices.
* For switch devices, use icsneoc2_settings_phy_speed_get() with port index instead.
*
* @param[in] device The device to check.
* @param[in] netid The network ID to check.
* @param[out] value Pointer to store the PHY link mode state.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_settings_phy_link_mode_for_get(icsneoc2_device_t* device, icsneoc2_netid_t netid, icsneoc2_eth_phy_link_mode_t* value);
/**
* Set PHY link mode (speed and duplex) for network-based devices.
* For switch devices, use icsneoc2_settings_phy_speed_set() with port index instead.
*
* @param[in] device The device to configure.
* @param[in] netid The network ID to configure.
* @param[in] value The PHY link mode to set.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters or icsneoc2_error_set_settings_failure otherwise.
*/
icsneoc2_error_t icsneoc2_settings_phy_link_mode_for_set(icsneoc2_device_t* device, icsneoc2_netid_t netid, icsneoc2_eth_phy_link_mode_t value);
/**
* Get PHY enable state for network-based devices.
* For switch devices, use icsneoc2_settings_phy_enable_get() with port index instead.
*
* @param[in] device The device to check.
* @param[in] netid The network ID to check.
* @param[out] value Pointer to store the PHY enable state.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_settings_phy_enable_for_get(icsneoc2_device_t* device, icsneoc2_netid_t netid, bool* value);
/**
* Enable/disable PHY for network-based devices.
* For switch devices, use icsneoc2_settings_phy_enable_set() with port index instead.
*
* @param[in] device The device to configure.
* @param[in] netid The network ID to configure.
* @param[in] value The PHY enable state to set.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_settings_phy_enable_for_set(icsneoc2_device_t* device, icsneoc2_netid_t netid, bool value);
/**
* Get supported PHY link modes (combined speed+duplex) for a network.
* Each mode represents a valid hardware configuration.
*
* @param[in] device The device to check.
* @param[in] netid The network ID to check.
* @param[out] link_modes Pointer to store the supported PHY link modes. Should be at least the size of icsneoc2_eth_phy_link_mode_maxsize.
* @param[in,out] link_modes_count Pointer to the size of link_modes array. Updated with the number of link modes written to the array.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_settings_supported_phy_link_modes_for(icsneoc2_device_t* device, icsneoc2_netid_t netid, icsneoc2_eth_phy_link_mode_t** link_modes, size_t* link_modes_count);
/**
* Check if PLCA is enabled for a network that supports 10BASE-T1S.
*
* @param[in] device The device to check.
* @param[in] netid The network ID to check.
* @param[out] value Pointer to store the PLCA enable state.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_settings_t1s_is_plca_enabled_for(icsneoc2_device_t* device, icsneoc2_netid_t netid, bool* value);
/**
* Set PLCA enabled for a network that supports 10BASE-T1S.
*
* @param[in] device The device to configure.
* @param[in] netid The network ID to configure.
* @param[in] value The PLCA enable state to set.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_settings_t1s_plca_enabled_for_set(icsneoc2_device_t* device, icsneoc2_netid_t netid, bool value);
/**
* Get the local ID for a network that supports 10BASE-T1S.
*
* @param[in] device The device to check.
* @param[in] netid The network ID to check.
* @param[out] value Pointer to store the local ID.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_settings_t1s_local_id_get(icsneoc2_device_t* device, icsneoc2_netid_t netid, uint8_t* value);
/**
* Set the local ID for a network that supports 10BASE-T1S.
*
* @param[in] device The device to configure.
* @param[in] netid The network ID to configure.
* @param[in] value The local ID to set.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_settings_t1s_local_id_set(icsneoc2_device_t* device, icsneoc2_netid_t netid, uint8_t value);
/**
* Get the maximum number of nodes for a network that supports 10BASE-T1S.
*
* @param[in] device The device to check.
* @param[in] netid The network ID to check.
* @param[out] value Pointer to store the maximum number of nodes.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_settings_t1s_max_nodes_get(icsneoc2_device_t* device, icsneoc2_netid_t netid, uint8_t* value);
/**
* Set the maximum number of nodes for a network that supports 10BASE-T1S.
*
* @param[in] device The device to configure.
* @param[in] netid The network ID to configure.
* @param[in] value The maximum number of nodes to set.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_settings_t1s_max_nodes_set(icsneoc2_device_t* device, icsneoc2_netid_t netid, uint8_t value);
/**
* Get the OOP Timer for a network that supports 10BASE-T1S.
*
* @param[in] device The device to check.
* @param[in] netid The network ID to check.
* @param[out] value Pointer to store the OOP Timer value.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_settings_t1s_tx_opp_timer_get(icsneoc2_device_t* device, icsneoc2_netid_t netid, uint8_t* value);
/**
* Set the OOP Timer for a network that supports 10BASE-T1S.
*
* @param[in] device The device to configure.
* @param[in] netid The network ID to configure.
* @param[in] value The OOP Timer value to set.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_settings_t1s_tx_opp_timer_set(icsneoc2_device_t* device, icsneoc2_netid_t netid, uint8_t value);
/**
* Get the Max burst timer for a network that supports 10BASE-T1S.
*
* @param[in] device The device to check.
* @param[in] netid The network ID to check.
* @param[out] value Pointer to store the Max burst timer value.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_settings_t1s_max_burst_timer_for_get(icsneoc2_device_t* device, icsneoc2_netid_t netid, uint8_t* value);
/**
* Set the Max burst timer for a network that supports 10BASE-T1S.
*
* @param[in] device The device to configure.
* @param[in] netid The network ID to configure.
* @param[in] value The Max burst timer value to set.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_settings_t1s_max_burst_timer_for_set(icsneoc2_device_t* device, icsneoc2_netid_t netid, uint8_t value);
/**
* Set the analog output enabled.
*
* @param[in] device The device to configure.
* @param[in] pin The analog output pin to configure.
* @param[in] value The analog output value to set.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_settings_misc_io_analog_output_enabled_set(icsneoc2_device_t* device, uint8_t pin, uint8_t value);
/**
* Set the analog output voltage for a misc IO pin.
*
* @param[in] device The device to configure.
* @param[in] pin The analog output pin to configure.
* @param[in] value The analog output voltage to set.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_settings_misc_io_analog_output_set(icsneoc2_device_t* device, uint8_t pin, icsneoc2_misc_io_analog_voltage_t value);
/**
* Check if settings are disabled.
*
* @param[in] device The device to check.
* @param[out] value Pointer to store the disabled state.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_settings_disabled_get(icsneoc2_device_t* device, bool* value);
/**
* Check if settings are read-only.
*
* @param[in] device The device to check.
* @param[out] value Pointer to store the read-only state.
*
* @return icsneoc2_error_t icsneoc2_error_success if successful, icsneoc2_error_invalid_parameters otherwise.
*/
icsneoc2_error_t icsneoc2_settings_readonly_get(icsneoc2_device_t* device, bool* value);
#ifdef __cplusplus
}
#endif
#endif // __ICSNEOC2SETTINGS_H_
+405
View File
@@ -0,0 +1,405 @@
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#define ICSNEOC2_OPEN_OPTIONS_NONE UINT32_C(0x0) // No options
#define ICSNEOC2_OPEN_OPTIONS_GO_ONLINE UINT32_C(0x1) // After opening, go online
#define ICSNEOC2_OPEN_OPTIONS_SYNC_RTC UINT32_C(0x2) // After opening, sync RTC
#define ICSNEOC2_OPEN_OPTIONS_ENABLE_AUTO_UPDATE UINT32_C(0x4) // After opening, enable auto update
#define ICSNEOC2_OPEN_OPTIONS_FORCE_UPDATE UINT32_C(0x8) // After opening, force update
typedef uint32_t icsneoc2_open_options_t;
typedef enum _icsneoc2_devicetype_t {
// Ordered by numeric value to keep bitmask values grouped and predictable.
icsneoc2_devicetype_unknown = 0x00000000,
icsneoc2_devicetype_blue = 0x00000001,
icsneoc2_devicetype_ecu_avb = 0x00000002,
icsneoc2_devicetype_rad_supermoon = 0x00000003,
icsneoc2_devicetype_dw_vcan = 0x00000004,
icsneoc2_devicetype_rad_moon2 = 0x00000005,
icsneoc2_devicetype_rad_mars = 0x00000006,
icsneoc2_devicetype_vcan41 = 0x00000007,
icsneoc2_devicetype_fire = 0x00000008,
icsneoc2_devicetype_rad_pluto = 0x00000009,
icsneoc2_devicetype_vcan42_el = 0x0000000a,
icsneoc2_devicetype_radio_canhub = 0x0000000b,
icsneoc2_devicetype_neo_ecu12 = 0x0000000c,
icsneoc2_devicetype_obd2_lc_badge = 0x0000000d,
icsneoc2_devicetype_rad_moon_duo = 0x0000000e,
icsneoc2_devicetype_fire3 = 0x0000000f,
icsneoc2_devicetype_vcan3 = 0x00000010,
icsneoc2_devicetype_rad_jupiter = 0x00000011,
icsneoc2_devicetype_vcan4_industrial = 0x00000012,
icsneoc2_devicetype_rad_gigastar = 0x00000013,
icsneoc2_devicetype_red2 = 0x00000014,
icsneoc2_devicetype_etherbadge = 0x00000016,
icsneoc2_devicetype_rad_a2b = 0x00000017,
icsneoc2_devicetype_rad_epsilon = 0x00000018,
icsneoc2_devicetype_rad_epsilon_xl = 0x0000001e,
icsneoc2_devicetype_rad_galaxy2 = 0x00000021,
icsneoc2_devicetype_rad_moon3 = 0x00000023,
icsneoc2_devicetype_rad_comet = 0x00000024,
icsneoc2_devicetype_fire3_flexray = 0x00000025,
icsneoc2_devicetype_connect = 0x00000026,
icsneoc2_devicetype_rad_comet3 = 0x00000027,
icsneoc2_devicetype_rad_moon_t1s = 0x00000028,
icsneoc2_devicetype_rad_gigastar2 = 0x00000029,
icsneoc2_devicetype_fire3_t1s_lin = 0x0000002a,
icsneoc2_devicetype_fire3_t1s_sent = 0x0000002b,
icsneoc2_devicetype_rad_gemini = 0x0000002c,
icsneoc2_devicetype_red = 0x00000040,
icsneoc2_devicetype_ecu = 0x00000080,
icsneoc2_devicetype_ievb = 0x00000100,
icsneoc2_devicetype_pendant = 0x00000200,
icsneoc2_devicetype_obd2_pro = 0x00000400,
icsneoc2_devicetype_ecuchip_uart = 0x00000800,
icsneoc2_devicetype_plasma = 0x00001000,
icsneoc2_devicetype_neo_analog = 0x00004000,
icsneoc2_devicetype_ct_obd = 0x00008000,
icsneoc2_devicetype_ion = 0x00040000,
icsneoc2_devicetype_rad_star = 0x00080000,
icsneoc2_devicetype_vcan44 = 0x00200000,
icsneoc2_devicetype_vcan42 = 0x00400000,
icsneoc2_devicetype_cm_probe = 0x00800000,
icsneoc2_devicetype_eevb = 0x01000000,
icsneoc2_devicetype_vcan_rf = 0x02000000,
icsneoc2_devicetype_fire2 = 0x04000000,
icsneoc2_devicetype_flex = 0x08000000,
icsneoc2_devicetype_rad_galaxy = 0x10000000,
icsneoc2_devicetype_rad_star2 = 0x20000000,
icsneoc2_devicetype_vividcan = 0x40000000,
icsneoc2_devicetype_obd2_sim = 0x80000000,
icsneoc2_devicetype_maxsize // Must be last entry
} _icsneoc2_devicetype_t;
typedef uint32_t icsneoc2_devicetype_t;
typedef enum _icsneoc2_network_type_t {
icsneoc2_network_type_invalid = 0, // Invalid network type, used for error checking
icsneoc2_network_type_internal = 1, // Used for statuses that don't actually need to be transferred to the client application
icsneoc2_network_type_can = 2, // CAN (Controller Area Network)
icsneoc2_network_type_lin = 3, // LIN (Local Interconnect Network)
icsneoc2_network_type_flexray = 4, // FlexRay
icsneoc2_network_type_most = 5, // MOST (Media Oriented Systems Transport)
icsneoc2_network_type_ethernet = 6, // Ethernet
icsneoc2_network_type_lsftcan = 7, // LSFTCAN (Low Speed/Fault Tolerant CAN)
icsneoc2_network_type_swcan = 8, // SWCAN (Single-Wire CAN)
icsneoc2_network_type_iso9141 = 9, // ISO 9141-2 (K-Line)
icsneoc2_network_type_i2c = 10, // I2C (Inter-Integrated Circuit)
icsneoc2_network_type_a2b = 11, // A2B (Automotive Audio Bus)
icsneoc2_network_type_spi = 12, // SPI (Serial Peripheral Interface)
icsneoc2_network_type_mdio = 13, // MDIO (Management Data Input/Output)
icsneoc2_network_type_automotive_ethernet = 14, // Automotive Ethernet
// Must be the last entry, Don't use as a network type.
icsneoc2_network_type_maxsize,
// Used as a wildcard for filtering, never actually set as a type
icsneoc2_network_type_any = 0xFE,
// Used for unknown or other network types
icsneoc2_network_type_other = 0xFF
} _icsneoc2_network_type_t;
typedef uint8_t icsneoc2_network_type_t;
typedef enum _icsneoc2_netid_t {
icsneoc2_netid_device = 0,
icsneoc2_netid_dwcan_01 = 1,
icsneoc2_netid_dwcan_08 = 2,
icsneoc2_netid_swcan_01 = 3,
icsneoc2_netid_lsftcan_01 = 4,
icsneoc2_netid_fordscp = 5,
icsneoc2_netid_j1708 = 6,
icsneoc2_netid_aux = 7,
icsneoc2_netid_j1850vpw = 8,
icsneoc2_netid_iso9141 = 9,
icsneoc2_netid_disk_data = 10,
icsneoc2_netid_main51 = 11,
icsneoc2_netid_red = 12,
icsneoc2_netid_sci = 13,
icsneoc2_netid_iso9141_02 = 14,
icsneoc2_netid_iso14230 = 15,
icsneoc2_netid_lin_01 = 16,
icsneoc2_netid_ae_01 = 17,
icsneoc2_netid_ae_02 = 18,
icsneoc2_netid_ae_03 = 19,
// START Device Command Returns
// When we send a command, the device returns on one of these, depending on command
icsneoc2_netid_red_ext_memoryread = 20,
icsneoc2_netid_red_int_memoryread = 21,
icsneoc2_netid_red_dflash_read = 22,
icsneoc2_netid_neo_memory_sdread = 23,
icsneoc2_netid_can_errbits = 24,
icsneoc2_netid_neo_memory_write_done = 25,
icsneoc2_netid_red_wave_can1_logical = 26,
icsneoc2_netid_red_wave_can2_logical = 27,
icsneoc2_netid_red_wave_lin1_logical = 28,
icsneoc2_netid_red_wave_lin2_logical = 29,
icsneoc2_netid_red_wave_lin1_analog = 30,
icsneoc2_netid_red_wave_lin2_analog = 31,
icsneoc2_netid_red_wave_misc_analog = 32,
icsneoc2_netid_red_wave_miscdio2_logical = 33,
icsneoc2_netid_red_network_com_enable_ex = 34,
icsneoc2_netid_red_neovi_network = 35,
icsneoc2_netid_red_read_baud_settings = 36,
icsneoc2_netid_red_oldformat = 37,
icsneoc2_netid_red_scope_capture = 38,
icsneoc2_netid_red_hardware_excep = 39,
icsneoc2_netid_red_get_rtc = 40,
// END Device Command Returns
icsneoc2_netid_iso9141_03 = 41,
icsneoc2_netid_dwcan_02 = 42,
icsneoc2_netid_dwcan_03 = 44,
icsneoc2_netid_ae_04 = 45,
icsneoc2_netid_ae_05 = 46,
icsneoc2_netid_iso9141_04 = 47,
icsneoc2_netid_lin_02 = 48,
icsneoc2_netid_lin_03 = 49,
icsneoc2_netid_lin_04 = 50,
icsneoc2_netid_most_unused = 51,
icsneoc2_netid_red_app_error = 52,
icsneoc2_netid_cgi = 53,
icsneoc2_netid_reset_status = 54,
icsneoc2_netid_fb_status = 55,
icsneoc2_netid_app_signal_status = 56,
icsneoc2_netid_read_datalink_cm_tx_msg = 57,
icsneoc2_netid_read_datalink_cm_rx_msg = 58,
icsneoc2_netid_logging_overflow = 59,
icsneoc2_netid_read_settings = 60,
icsneoc2_netid_dwcan_04 = 61,
icsneoc2_netid_dwcan_05 = 62,
icsneoc2_netid_rs232 = 63,
icsneoc2_netid_uart_01 = 64,
icsneoc2_netid_uart_02 = 65,
icsneoc2_netid_uart_03 = 66,
icsneoc2_netid_uart_04 = 67,
icsneoc2_netid_swcan_02 = 68,
icsneoc2_netid_ethernet_daq = 69,
icsneoc2_netid_data_to_host = 70,
icsneoc2_netid_textapi_to_host = 71,
icsneoc2_netid_spi_01 = 72,
icsneoc2_netid_ae_06 = 73,
icsneoc2_netid_red_vbat = 74,
icsneoc2_netid_ae_07 = 75,
icsneoc2_netid_ae_08 = 76,
icsneoc2_netid_ae_09 = 77,
icsneoc2_netid_ae_10 = 78,
icsneoc2_netid_ae_11 = 79,
icsneoc2_netid_flexray_01a = 80,
icsneoc2_netid_flexray_01b = 81,
icsneoc2_netid_flexray_02a = 82,
icsneoc2_netid_flexray_02b = 83,
icsneoc2_netid_lin_05 = 84,
icsneoc2_netid_flexray_01 = 85,
icsneoc2_netid_flexray_02 = 86,
icsneoc2_netid_ae_12 = 87,
icsneoc2_netid_i2c_01 = 88,
icsneoc2_netid_most_25 = 90,
icsneoc2_netid_most_50 = 91,
icsneoc2_netid_most_150 = 92,
icsneoc2_netid_ethernet_01 = 93,
icsneoc2_netid_gmfsa = 94,
icsneoc2_netid_tcp = 95,
icsneoc2_netid_dwcan_06 = 96,
icsneoc2_netid_dwcan_07 = 97,
icsneoc2_netid_lin_06 = 98,
icsneoc2_netid_lsftcan_02 = 99,
icsneoc2_netid_logical_disk_info = 187,
icsneoc2_netid_wivi_command = 221,
icsneoc2_netid_script_status = 224,
icsneoc2_netid_eth_phy_control = 239,
icsneoc2_netid_extended_command = 240,
icsneoc2_netid_extended_data = 242,
icsneoc2_netid_flexray_control = 243,
icsneoc2_netid_coremini_preload = 244,
icsneoc2_netid_hw_com_latency_test = 512,
icsneoc2_netid_device_status = 513,
icsneoc2_netid_udp = 514,
icsneoc2_netid_forwarded_message = 516,
icsneoc2_netid_i2c_02 = 517,
icsneoc2_netid_i2c_03 = 518,
icsneoc2_netid_i2c_04 = 519,
icsneoc2_netid_ethernet_02 = 520,
icsneoc2_netid_ethernet_tx_wrap = 521,
icsneoc2_netid_a2b_01 = 522,
icsneoc2_netid_a2b_02 = 523,
icsneoc2_netid_ethernet_03 = 524,
icsneoc2_netid_wbms_01 = 532,
icsneoc2_netid_dwcan_09 = 534,
icsneoc2_netid_dwcan_10 = 535,
icsneoc2_netid_dwcan_11 = 536,
icsneoc2_netid_dwcan_12 = 537,
icsneoc2_netid_dwcan_13 = 538,
icsneoc2_netid_dwcan_14 = 539,
icsneoc2_netid_dwcan_15 = 540,
icsneoc2_netid_dwcan_16 = 541,
icsneoc2_netid_lin_07 = 542,
icsneoc2_netid_lin_08 = 543,
icsneoc2_netid_spi_02 = 544,
icsneoc2_netid_mdio_01 = 545,
icsneoc2_netid_mdio_02 = 546,
icsneoc2_netid_mdio_03 = 547,
icsneoc2_netid_mdio_04 = 548,
icsneoc2_netid_mdio_05 = 549,
icsneoc2_netid_mdio_06 = 550,
icsneoc2_netid_mdio_07 = 551,
icsneoc2_netid_mdio_08 = 552,
icsneoc2_netid_ae_13 = 553,
icsneoc2_netid_ae_14 = 554,
icsneoc2_netid_ae_15 = 555,
icsneoc2_netid_ae_16 = 556,
icsneoc2_netid_spi_03 = 557,
icsneoc2_netid_spi_04 = 558,
icsneoc2_netid_spi_05 = 559,
icsneoc2_netid_spi_06 = 560,
icsneoc2_netid_spi_07 = 561,
icsneoc2_netid_spi_08 = 562,
icsneoc2_netid_lin_09 = 563,
icsneoc2_netid_lin_10 = 564,
icsneoc2_netid_lin_11 = 565,
icsneoc2_netid_lin_12 = 566,
icsneoc2_netid_lin_13 = 567,
icsneoc2_netid_lin_14 = 568,
icsneoc2_netid_lin_15 = 569,
icsneoc2_netid_lin_16 = 570,
// Must be the last entry, Don't use as a NetID.
icsneoc2_netid_maxsize,
// Used as a wildcard for filtering, never actually set as a NetID
icsneoc2_netid_any = 0xfffe,
// Used for unknown or invalid NetID
icsneoc2_netid_invalid = 0xffff
} _icsneoc2_netid_t;
typedef uint16_t icsneoc2_netid_t;
typedef enum _icsneoc2_io_type_t {
icsneoc2_io_type_eth_activation = 0, // DoIP activation line (0=HiZ, 1=pulled up to VBAT)
icsneoc2_io_type_usb_host_power = 1, // USB host power control
icsneoc2_io_type_backup_power_en = 2, // Backup super capacitor enable (FIRE 2)
icsneoc2_io_type_backup_power_good = 3, // Backup super capacitor charged status (FIRE 2, read only)
icsneoc2_io_type_misc = 4, // General purpose I/O on the device
icsneoc2_io_type_emisc = 5, // Extended general purpose I/O on the device
// Must be last entry. Don't use as an IO type.
icsneoc2_io_type_maxsize
} _icsneoc2_io_type_t;
typedef uint32_t icsneoc2_io_type_t;
typedef enum _icsneoc2_lin_mode_t {
icsneoc2_lin_mode_sleep = 0,
icsneoc2_lin_mode_slow = 1,
icsneoc2_lin_mode_normal = 2,
icsneoc2_lin_mode_fast = 3,
// Must be last entry. Don't use as a LIN mode.
icsneoc2_lin_mode_maxsize
} _icsneoc2_lin_mode_t;
typedef uint32_t icsneoc2_lin_mode_t;
typedef enum _icsneoc2_ae_link_mode_t {
icsneoc2_ae_link_mode_invalid = -1, // Invalid/Unknown link mode
icsneoc2_ae_link_mode_auto = 0, // Auto select link mode
icsneoc2_ae_link_mode_master = 1, // Master mode
icsneoc2_ae_link_mode_slave = 2, // Slave mode
// Must be last entry. Don't use as an AE link mode.
icsneoc2_ae_link_mode_maxsize
} _icsneoc2_ae_link_mode_t;
typedef uint32_t icsneoc2_ae_link_mode_t;
typedef enum _icsneoc2_eth_phy_link_mode_t {
icsneoc2_eth_phy_link_mode_auto_negotiation = 1, // Auto negotiation mode
icsneoc2_eth_phy_link_mode_10mbps_halfduplex = 2, // 10 Mbps half duplex
icsneoc2_eth_phy_link_mode_10mbps_full_duplex = 3, // 10 Mbps full duplex
icsneoc2_eth_phy_link_mode_100mbps_half_duplex = 4, // 100 Mbps half duplex
icsneoc2_eth_phy_link_mode_100mbps_full_duplex = 5, // 100 Mbps full duplex
icsneoc2_eth_phy_link_mode_1gbps_half_duplex = 6, // 1 Gbps half duplex
icsneoc2_eth_phy_link_mode_1gbps_full_duplex = 7, // 1 Gbps full duplex
icsneoc2_eth_phy_link_mode_2_5gbps_full_duplex = 8, // 2.5 Gbps full duplex
icsneoc2_eth_phy_link_mode_5gbps_full_duplex = 9, // 5 Gbps full duplex
icsneoc2_eth_phy_link_mode_10gbps_full_duplex = 10, // 10 Gbps full duplex
// Must be last entry. Don't use as an Ethernet PHY link mode.
icsneoc2_eth_phy_link_mode_maxsize
} _icsneoc2_eth_phy_link_mode_t;
typedef uint32_t icsneoc2_eth_phy_link_mode_t;
typedef enum _icsneoc2_misc_io_analog_voltage_t {
icsneoc2_misc_io_analog_voltage_v0 = 0, // Analog voltage level 0V
icsneoc2_misc_io_analog_voltage_v1 = 1, // Analog voltage level 1V
icsneoc2_misc_io_analog_voltage_v2 = 2, // Analog voltage level 2V
icsneoc2_misc_io_analog_voltage_v3 = 3, // Analog voltage level 3V
icsneoc2_misc_io_analog_voltage_v4 = 4, // Analog voltage level 4V
icsneoc2_misc_io_analog_voltage_v5 = 5, // Analog voltage level 5V
// Must be last entry. Don't use as an analog voltage.
icsneoc2_misc_io_analog_voltage_maxsize
} _icsneoc2_misc_io_analog_voltage_t;
typedef uint8_t icsneoc2_misc_io_analog_voltage_t;
typedef struct icsneoc2_disk_details_t icsneoc2_disk_details_t;
typedef enum _icsneoc2_disk_layout_t {
// Spanned layout, where each disk is treated as one contiguous space and data is written to each disk until it's full before moving to the next.
icsneoc2_disk_layout_spanned = 0,
// RAID 0 layout, where data is striped across multiple disks.
icsneoc2_disk_layout_raid0 = 1,
// Must be last entry. Don't use as a disk layout.
icsneoc2_disk_layout_maxsize
} _icsneoc2_disk_layout_t;
typedef uint8_t icsneoc2_disk_layout_t;
#define ICSNEOC2_DISK_FORMAT_FLAGS_PRESENT UINT32_C(0x1) // Indicates that the disk is present
#define ICSNEOC2_DISK_FORMAT_FLAGS_INITIALIZED UINT32_C(0x2) // Indicates that the disk is initialized
#define ICSNEOC2_DISK_FORMAT_FLAGS_FORMATTED UINT32_C(0x4) // Indicates that the disk is already formatted
typedef uint32_t icsneoc2_disk_format_flags_t;
typedef enum _icsneoc2_disk_format_directive_t {
icsneoc2_disk_format_directive_continue = 0,
icsneoc2_disk_format_directive_stop = 1,
// Must be last entry. Don't use as a disk format directive.
icsneoc2_disk_format_directive_maxsize
} _icsneoc2_disk_format_directive_t;
typedef uint8_t icsneoc2_disk_format_directive_t;
typedef icsneoc2_disk_format_directive_t (*icsneoc2_disk_format_progress_fn)(
uint64_t sectors_formatted,
uint64_t total_sectors,
void* user_data
);
typedef struct icsneoc2_script_status_t icsneoc2_script_status_t;
typedef enum _icsneoc2_memory_type_t {
icsneoc2_memory_type_flash = 0, // Flash memory
icsneoc2_memory_type_sd = 1, // SD card memory
// Must be last entry. Don't use as a memory type.
icsneoc2_memory_type_maxsize
} _icsneoc2_memory_type_t;
typedef uint8_t icsneoc2_memory_type_t;
#ifdef __cplusplus
}
#endif