/* automatically generated by rust-bindgen 0.72.1 */
pub const SERVICE_KERNEL_DRIVER: u32 = 1;
pub const SERVICE_FILE_SYSTEM_DRIVER: u32 = 2;
pub const SERVICE_ADAPTER: u32 = 4;
pub const SERVICE_RECOGNIZER_DRIVER: u32 = 8;
pub const SERVICE_DRIVER: u32 = 11;
pub const SERVICE_WIN32_OWN_PROCESS: u32 = 16;
pub const SERVICE_WIN32_SHARE_PROCESS: u32 = 32;
pub const SERVICE_WIN32: u32 = 48;
pub const SERVICE_INTERACTIVE_PROCESS: u32 = 256;
pub const SERVICE_TYPE_ALL: u32 = 319;
pub const SERVICE_BOOT_START: u32 = 0;
pub const SERVICE_SYSTEM_START: u32 = 1;
pub const SERVICE_AUTO_START: u32 = 2;
pub const SERVICE_DEMAND_START: u32 = 3;
pub const SERVICE_DISABLED: u32 = 4;
pub const SERVICE_ERROR_IGNORE: u32 = 0;
pub const SERVICE_ERROR_NORMAL: u32 = 1;
pub const SERVICE_ERROR_SEVERE: u32 = 2;
pub const SERVICE_ERROR_CRITICAL: u32 = 3;
pub const LOOKUP_STREAM_FROM_CLUSTER_ENTRY_ATTRIBUTE_MASK: u32 = 4278190080;
pub const LOOKUP_STREAM_FROM_CLUSTER_ENTRY_FLAG_PAGE_FILE: u32 = 1;
pub const LOOKUP_STREAM_FROM_CLUSTER_ENTRY_FLAG_DENY_DEFRAG_SET: u32 = 2;
pub const LOOKUP_STREAM_FROM_CLUSTER_ENTRY_FLAG_FS_SYSTEM_FILE: u32 = 4;
pub const LOOKUP_STREAM_FROM_CLUSTER_ENTRY_FLAG_TXF_SYSTEM_FILE: u32 = 8;
pub const LOOKUP_STREAM_FROM_CLUSTER_ENTRY_ATTRIBUTE_DATA: u32 = 16777216;
pub const LOOKUP_STREAM_FROM_CLUSTER_ENTRY_ATTRIBUTE_INDEX: u32 = 33554432;
pub const LOOKUP_STREAM_FROM_CLUSTER_ENTRY_ATTRIBUTE_SYSTEM: u32 = 50331648;
pub const SERVICE_NO_CHANGE: u32 = 4294967295;
pub const SERVICE_ACTIVE: u32 = 1;
pub const SERVICE_INACTIVE: u32 = 2;
pub const SERVICE_STATE_ALL: u32 = 3;
pub const SERVICE_CONTROL_STOP: u32 = 1;
pub const SERVICE_CONTROL_PAUSE: u32 = 2;
pub const SERVICE_CONTROL_CONTINUE: u32 = 3;
pub const SERVICE_CONTROL_INTERROGATE: u32 = 4;
pub const SERVICE_CONTROL_SHUTDOWN: u32 = 5;
pub const SERVICE_CONTROL_PARAMCHANGE: u32 = 6;
pub const SERVICE_CONTROL_NETBINDADD: u32 = 7;
pub const SERVICE_CONTROL_NETBINDREMOVE: u32 = 8;
pub const SERVICE_CONTROL_NETBINDENABLE: u32 = 9;
pub const SERVICE_CONTROL_NETBINDDISABLE: u32 = 10;
pub const SERVICE_CONTROL_DEVICEEVENT: u32 = 11;
pub const SERVICE_CONTROL_HARDWAREPROFILECHANGE: u32 = 12;
pub const SERVICE_CONTROL_POWEREVENT: u32 = 13;
pub const SERVICE_CONTROL_SESSIONCHANGE: u32 = 14;
pub const SERVICE_CONTROL_PRESHUTDOWN: u32 = 15;
pub const SERVICE_CONTROL_TIMECHANGE: u32 = 16;
pub const SERVICE_CONTROL_USER_LOGOFF: u32 = 17;
pub const SERVICE_CONTROL_TRIGGEREVENT: u32 = 32;
pub const SERVICE_CONTROL_LOWRESOURCES: u32 = 96;
pub const SERVICE_CONTROL_SYSTEMLOWRESOURCES: u32 = 97;
pub const SERVICE_STOPPED: u32 = 1;
pub const SERVICE_START_PENDING: u32 = 2;
pub const SERVICE_STOP_PENDING: u32 = 3;
pub const SERVICE_RUNNING: u32 = 4;
pub const SERVICE_CONTINUE_PENDING: u32 = 5;
pub const SERVICE_PAUSE_PENDING: u32 = 6;
pub const SERVICE_PAUSED: u32 = 7;
pub const SERVICE_ACCEPT_STOP: u32 = 1;
pub const SERVICE_ACCEPT_PAUSE_CONTINUE: u32 = 2;
pub const SERVICE_ACCEPT_SHUTDOWN: u32 = 4;
pub const SERVICE_ACCEPT_PARAMCHANGE: u32 = 8;
pub const SERVICE_ACCEPT_NETBINDCHANGE: u32 = 16;
pub const SERVICE_ACCEPT_HARDWAREPROFILECHANGE: u32 = 32;
pub const SERVICE_ACCEPT_POWEREVENT: u32 = 64;
pub const SERVICE_ACCEPT_SESSIONCHANGE: u32 = 128;
pub const SERVICE_ACCEPT_PRESHUTDOWN: u32 = 256;
pub const SERVICE_ACCEPT_TIMECHANGE: u32 = 512;
pub const SERVICE_ACCEPT_TRIGGEREVENT: u32 = 1024;
pub const SERVICE_ACCEPT_USER_LOGOFF: u32 = 2048;
pub const SERVICE_ACCEPT_LOWRESOURCES: u32 = 8192;
pub const SERVICE_ACCEPT_SYSTEMLOWRESOURCES: u32 = 16384;
pub const SERVICE_QUERY_CONFIG: u32 = 1;
pub const SERVICE_CHANGE_CONFIG: u32 = 2;
pub const SERVICE_QUERY_STATUS: u32 = 4;
pub const SERVICE_ENUMERATE_DEPENDENTS: u32 = 8;
pub const SERVICE_START: u32 = 16;
pub const SERVICE_STOP: u32 = 32;
pub const SERVICE_PAUSE_CONTINUE: u32 = 64;
pub const SERVICE_INTERROGATE: u32 = 128;
pub const SERVICE_USER_DEFINED_CONTROL: u32 = 256;
pub const SERVICE_RUNS_IN_SYSTEM_PROCESS: u32 = 1;
pub const SERVICE_CONFIG_DESCRIPTION: u32 = 1;
pub const SERVICE_CONFIG_FAILURE_ACTIONS: u32 = 2;
pub const SERVICE_CONFIG_DELAYED_AUTO_START_INFO: u32 = 3;
pub const SERVICE_CONFIG_FAILURE_ACTIONS_FLAG: u32 = 4;
pub const SERVICE_CONFIG_SERVICE_SID_INFO: u32 = 5;
pub const SERVICE_CONFIG_REQUIRED_PRIVILEGES_INFO: u32 = 6;
pub const SERVICE_CONFIG_PRESHUTDOWN_INFO: u32 = 7;
pub const SERVICE_CONFIG_TRIGGER_INFO: u32 = 8;
pub const SERVICE_CONFIG_PREFERRED_NODE: u32 = 9;
pub const SERVICE_CONFIG_LAUNCH_PROTECTED: u32 = 12;
pub const SERVICE_NOTIFY_STATUS_CHANGE_1: u32 = 1;
pub const SERVICE_NOTIFY_STATUS_CHANGE_2: u32 = 2;
pub const SERVICE_NOTIFY_STATUS_CHANGE: u32 = 2;
pub const SERVICE_NOTIFY_STOPPED: u32 = 1;
pub const SERVICE_NOTIFY_START_PENDING: u32 = 2;
pub const SERVICE_NOTIFY_STOP_PENDING: u32 = 4;
pub const SERVICE_NOTIFY_RUNNING: u32 = 8;
pub const SERVICE_NOTIFY_CONTINUE_PENDING: u32 = 16;
pub const SERVICE_NOTIFY_PAUSE_PENDING: u32 = 32;
pub const SERVICE_NOTIFY_PAUSED: u32 = 64;
pub const SERVICE_NOTIFY_CREATED: u32 = 128;
pub const SERVICE_NOTIFY_DELETED: u32 = 256;
pub const SERVICE_NOTIFY_DELETE_PENDING: u32 = 512;
pub const SERVICE_STOP_REASON_FLAG_MIN: u32 = 0;
pub const SERVICE_STOP_REASON_FLAG_UNPLANNED: u32 = 268435456;
pub const SERVICE_STOP_REASON_FLAG_CUSTOM: u32 = 536870912;
pub const SERVICE_STOP_REASON_FLAG_PLANNED: u32 = 1073741824;
pub const SERVICE_STOP_REASON_FLAG_MAX: u32 = 2147483648;
pub const SERVICE_STOP_REASON_MAJOR_MIN: u32 = 0;
pub const SERVICE_STOP_REASON_MAJOR_OTHER: u32 = 65536;
pub const SERVICE_STOP_REASON_MAJOR_HARDWARE: u32 = 131072;
pub const SERVICE_STOP_REASON_MAJOR_OPERATINGSYSTEM: u32 = 196608;
pub const SERVICE_STOP_REASON_MAJOR_SOFTWARE: u32 = 262144;
pub const SERVICE_STOP_REASON_MAJOR_APPLICATION: u32 = 327680;
pub const SERVICE_STOP_REASON_MAJOR_NONE: u32 = 393216;
pub const SERVICE_STOP_REASON_MAJOR_MAX: u32 = 458752;
pub const SERVICE_STOP_REASON_MAJOR_MIN_CUSTOM: u32 = 4194304;
pub const SERVICE_STOP_REASON_MAJOR_MAX_CUSTOM: u32 = 16711680;
pub const SERVICE_STOP_REASON_MINOR_MIN: u32 = 0;
pub const SERVICE_STOP_REASON_MINOR_OTHER: u32 = 1;
pub const SERVICE_STOP_REASON_MINOR_MAINTENANCE: u32 = 2;
pub const SERVICE_STOP_REASON_MINOR_INSTALLATION: u32 = 3;
pub const SERVICE_STOP_REASON_MINOR_UPGRADE: u32 = 4;
pub const SERVICE_STOP_REASON_MINOR_RECONFIG: u32 = 5;
pub const SERVICE_STOP_REASON_MINOR_HUNG: u32 = 6;
pub const SERVICE_STOP_REASON_MINOR_UNSTABLE: u32 = 7;
pub const SERVICE_STOP_REASON_MINOR_DISK: u32 = 8;
pub const SERVICE_STOP_REASON_MINOR_NETWORKCARD: u32 = 9;
pub const SERVICE_STOP_REASON_MINOR_ENVIRONMENT: u32 = 10;
pub const SERVICE_STOP_REASON_MINOR_HARDWARE_DRIVER: u32 = 11;
pub const SERVICE_STOP_REASON_MINOR_OTHERDRIVER: u32 = 12;
pub const SERVICE_STOP_REASON_MINOR_SERVICEPACK: u32 = 13;
pub const SERVICE_STOP_REASON_MINOR_SOFTWARE_UPDATE: u32 = 14;
pub const SERVICE_STOP_REASON_MINOR_SECURITYFIX: u32 = 15;
pub const SERVICE_STOP_REASON_MINOR_SECURITY: u32 = 16;
pub const SERVICE_STOP_REASON_MINOR_NETWORK_CONNECTIVITY: u32 = 17;
pub const SERVICE_STOP_REASON_MINOR_WMI: u32 = 18;
pub const SERVICE_STOP_REASON_MINOR_SERVICEPACK_UNINSTALL: u32 = 19;
pub const SERVICE_STOP_REASON_MINOR_SOFTWARE_UPDATE_UNINSTALL: u32 = 20;
pub const SERVICE_STOP_REASON_MINOR_SECURITYFIX_UNINSTALL: u32 = 21;
pub const SERVICE_STOP_REASON_MINOR_MMC: u32 = 22;
pub const SERVICE_STOP_REASON_MINOR_NONE: u32 = 23;
pub const SERVICE_STOP_REASON_MINOR_MEMOTYLIMIT: u32 = 24;
pub const SERVICE_STOP_REASON_MINOR_MAX: u32 = 25;
pub const SERVICE_STOP_REASON_MINOR_MIN_CUSTOM: u32 = 256;
pub const SERVICE_STOP_REASON_MINOR_MAX_CUSTOM: u32 = 65535;
pub const SERVICE_CONTROL_STATUS_REASON_INFO: u32 = 1;
pub const SERVICE_TRIGGER_TYPE_DEVICE_INTERFACE_ARRIVAL: u32 = 1;
pub const SERVICE_TRIGGER_TYPE_IP_ADDRESS_AVAILABILITY: u32 = 2;
pub const SERVICE_TRIGGER_TYPE_DOMAIN_JOIN: u32 = 3;
pub const SERVICE_TRIGGER_TYPE_FIREWALL_PORT_EVENT: u32 = 4;
pub const SERVICE_TRIGGER_TYPE_GROUP_POLICY: u32 = 5;
pub const SERVICE_TRIGGER_TYPE_NETWORK_ENDPOINT: u32 = 6;
pub const SERVICE_TRIGGER_TYPE_CUSTOM_SYSTEM_STATE_CHANGE: u32 = 7;
pub const SERVICE_TRIGGER_TYPE_CUSTOM: u32 = 20;
pub const SERVICE_TRIGGER_TYPE_AGGREGATE: u32 = 30;
pub const SERVICE_TRIGGER_DATA_TYPE_BINARY: u32 = 1;
pub const SERVICE_TRIGGER_DATA_TYPE_STRING: u32 = 2;
pub const SERVICE_TRIGGER_DATA_TYPE_LEVEL: u32 = 3;
pub const SERVICE_TRIGGER_DATA_TYPE_KEYWORD_ANY: u32 = 4;
pub const SERVICE_TRIGGER_DATA_TYPE_KEYWORD_ALL: u32 = 5;
pub const SERVICE_START_REASON_DEMAND: u32 = 1;
pub const SERVICE_START_REASON_AUTO: u32 = 2;
pub const SERVICE_START_REASON_TRIGGER: u32 = 4;
pub const SERVICE_START_REASON_RESTART_ON_FAILURE: u32 = 8;
pub const SERVICE_START_REASON_DELAYEDAUTO: u32 = 16;
pub const SERVICE_DYNAMIC_INFORMATION_LEVEL_START_REASON: u32 = 1;
pub const SERVICE_LAUNCH_PROTECTED_NONE: u32 = 0;
pub const SERVICE_LAUNCH_PROTECTED_WINDOWS: u32 = 1;
pub const SERVICE_LAUNCH_PROTECTED_WINDOWS_LIGHT: u32 = 2;
pub const SERVICE_LAUNCH_PROTECTED_ANTIMALWARE_LIGHT: u32 = 3;
pub const SERVICE_SID_TYPE_NONE: u32 = 0;
pub const SERVICE_SID_TYPE_RESTRICTED: u32 = 3;
pub const SERVICE_SID_TYPE_UNRESTRICTED: u32 = 1;
pub const PEAK_NONEBUS: u32 = 0;
pub const PEAK_ISABUS1: u32 = 33;
pub const PEAK_ISABUS2: u32 = 34;
pub const PEAK_ISABUS3: u32 = 35;
pub const PEAK_ISABUS4: u32 = 36;
pub const PEAK_ISABUS5: u32 = 37;
pub const PEAK_ISABUS6: u32 = 38;
pub const PEAK_ISABUS7: u32 = 39;
pub const PEAK_ISABUS8: u32 = 40;
pub const PEAK_DNGBUS1: u32 = 49;
pub const PEAK_PCIBUS1: u32 = 65;
pub const PEAK_PCIBUS2: u32 = 66;
pub const PEAK_PCIBUS3: u32 = 67;
pub const PEAK_PCIBUS4: u32 = 68;
pub const PEAK_PCIBUS5: u32 = 69;
pub const PEAK_PCIBUS6: u32 = 70;
pub const PEAK_PCIBUS7: u32 = 71;
pub const PEAK_PCIBUS8: u32 = 72;
pub const PEAK_PCIBUS9: u32 = 1033;
pub const PEAK_PCIBUS10: u32 = 1034;
pub const PEAK_PCIBUS11: u32 = 1035;
pub const PEAK_PCIBUS12: u32 = 1036;
pub const PEAK_PCIBUS13: u32 = 1037;
pub const PEAK_PCIBUS14: u32 = 1038;
pub const PEAK_PCIBUS15: u32 = 1039;
pub const PEAK_PCIBUS16: u32 = 1040;
pub const PEAK_USBBUS1: u32 = 81;
pub const PEAK_USBBUS2: u32 = 82;
pub const PEAK_USBBUS3: u32 = 83;
pub const PEAK_USBBUS4: u32 = 84;
pub const PEAK_USBBUS5: u32 = 85;
pub const PEAK_USBBUS6: u32 = 86;
pub const PEAK_USBBUS7: u32 = 87;
pub const PEAK_USBBUS8: u32 = 88;
pub const PEAK_USBBUS9: u32 = 1289;
pub const PEAK_USBBUS10: u32 = 1290;
pub const PEAK_USBBUS11: u32 = 1291;
pub const PEAK_USBBUS12: u32 = 1292;
pub const PEAK_USBBUS13: u32 = 1293;
pub const PEAK_USBBUS14: u32 = 1294;
pub const PEAK_USBBUS15: u32 = 1295;
pub const PEAK_USBBUS16: u32 = 1296;
pub const PEAK_PCCBUS1: u32 = 97;
pub const PEAK_PCCBUS2: u32 = 98;
pub const PEAK_LANBUS1: u32 = 2049;
pub const PEAK_LANBUS2: u32 = 2050;
pub const PEAK_LANBUS3: u32 = 2051;
pub const PEAK_LANBUS4: u32 = 2052;
pub const PEAK_LANBUS5: u32 = 2053;
pub const PEAK_LANBUS6: u32 = 2054;
pub const PEAK_LANBUS7: u32 = 2055;
pub const PEAK_LANBUS8: u32 = 2056;
pub const PEAK_LANBUS9: u32 = 2057;
pub const PEAK_LANBUS10: u32 = 2058;
pub const PEAK_LANBUS11: u32 = 2059;
pub const PEAK_LANBUS12: u32 = 2060;
pub const PEAK_LANBUS13: u32 = 2061;
pub const PEAK_LANBUS14: u32 = 2062;
pub const PEAK_LANBUS15: u32 = 2063;
pub const PEAK_LANBUS16: u32 = 2064;
pub const PEAK_ERROR_OK: u32 = 0;
pub const PEAK_ERROR_XMTFULL: u32 = 1;
pub const PEAK_ERROR_OVERRUN: u32 = 2;
pub const PEAK_ERROR_BUSLIGHT: u32 = 4;
pub const PEAK_ERROR_BUSHEAVY: u32 = 8;
pub const PEAK_ERROR_BUSWARNING: u32 = 8;
pub const PEAK_ERROR_BUSPASSIVE: u32 = 262144;
pub const PEAK_ERROR_BUSOFF: u32 = 16;
pub const PEAK_ERROR_ANYBUSERR: u32 = 262172;
pub const PEAK_ERROR_QRCVEMPTY: u32 = 32;
pub const PEAK_ERROR_QOVERRUN: u32 = 64;
pub const PEAK_ERROR_QXMTFULL: u32 = 128;
pub const PEAK_ERROR_REGTEST: u32 = 256;
pub const PEAK_ERROR_NODRIVER: u32 = 512;
pub const PEAK_ERROR_HWINUSE: u32 = 1024;
pub const PEAK_ERROR_NETINUSE: u32 = 2048;
pub const PEAK_ERROR_ILLHW: u32 = 5120;
pub const PEAK_ERROR_ILLNET: u32 = 6144;
pub const PEAK_ERROR_ILLCLIENT: u32 = 7168;
pub const PEAK_ERROR_ILLHANDLE: u32 = 7168;
pub const PEAK_ERROR_RESOURCE: u32 = 8192;
pub const PEAK_ERROR_ILLPARAMTYPE: u32 = 16384;
pub const PEAK_ERROR_ILLPARAMVAL: u32 = 32768;
pub const PEAK_ERROR_UNKNOWN: u32 = 65536;
pub const PEAK_ERROR_ILLDATA: u32 = 131072;
pub const PEAK_ERROR_ILLMODE: u32 = 524288;
pub const PEAK_ERROR_CAUTION: u32 = 33554432;
pub const PEAK_ERROR_INITIALIZE: u32 = 67108864;
pub const PEAK_ERROR_ILLOPERATION: u32 = 134217728;
pub const PEAK_NONE: u32 = 0;
pub const PEAK_PEAKCAN: u32 = 1;
pub const PEAK_ISA: u32 = 2;
pub const PEAK_DNG: u32 = 3;
pub const PEAK_PCI: u32 = 4;
pub const PEAK_USB: u32 = 5;
pub const PEAK_PCC: u32 = 6;
pub const PEAK_VIRTUAL: u32 = 7;
pub const PEAK_LAN: u32 = 8;
pub const PEAK_DEVICE_ID: u32 = 1;
pub const PEAK_5VOLTS_POWER: u32 = 2;
pub const PEAK_RECEIVE_EVENT: u32 = 3;
pub const PEAK_MESSAGE_FILTER: u32 = 4;
pub const PEAK_API_VERSION: u32 = 5;
pub const PEAK_CHANNEL_VERSION: u32 = 6;
pub const PEAK_BUSOFF_AUTORESET: u32 = 7;
pub const PEAK_LISTEN_ONLY: u32 = 8;
pub const PEAK_LOG_LOCATION: u32 = 9;
pub const PEAK_LOG_STATUS: u32 = 10;
pub const PEAK_LOG_CONFIGURE: u32 = 11;
pub const PEAK_LOG_TEXT: u32 = 12;
pub const PEAK_CHANNEL_CONDITION: u32 = 13;
pub const PEAK_HARDWARE_NAME: u32 = 14;
pub const PEAK_RECEIVE_STATUS: u32 = 15;
pub const PEAK_CONTROLLER_NUMBER: u32 = 16;
pub const PEAK_TRACE_LOCATION: u32 = 17;
pub const PEAK_TRACE_STATUS: u32 = 18;
pub const PEAK_TRACE_SIZE: u32 = 19;
pub const PEAK_TRACE_CONFIGURE: u32 = 20;
pub const PEAK_CHANNEL_IDENTIFYING: u32 = 21;
pub const PEAK_CHANNEL_FEATURES: u32 = 22;
pub const PEAK_BITRATE_ADAPTING: u32 = 23;
pub const PEAK_BITRATE_INFO: u32 = 24;
pub const PEAK_BITRATE_INFO_FD: u32 = 25;
pub const PEAK_BUSSPEED_NOMINAL: u32 = 26;
pub const PEAK_BUSSPEED_DATA: u32 = 27;
pub const PEAK_IP_ADDRESS: u32 = 28;
pub const PEAK_LAN_SERVICE_STATUS: u32 = 29;
pub const PEAK_ALLOW_STATUS_FRAMES: u32 = 30;
pub const PEAK_ALLOW_RTR_FRAMES: u32 = 31;
pub const PEAK_ALLOW_ERROR_FRAMES: u32 = 32;
pub const PEAK_INTERFRAME_DELAY: u32 = 33;
pub const PEAK_ACCEPTANCE_FILTER_11BIT: u32 = 34;
pub const PEAK_ACCEPTANCE_FILTER_29BIT: u32 = 35;
pub const PEAK_IO_DIGITAL_CONFIGURATION: u32 = 36;
pub const PEAK_IO_DIGITAL_VALUE: u32 = 37;
pub const PEAK_IO_DIGITAL_SET: u32 = 38;
pub const PEAK_IO_DIGITAL_CLEAR: u32 = 39;
pub const PEAK_IO_ANALOG_VALUE: u32 = 40;
pub const PEAK_FIRMWARE_VERSION: u32 = 41;
pub const PEAK_ATTACHED_CHANNELS_COUNT: u32 = 42;
pub const PEAK_ATTACHED_CHANNELS: u32 = 43;
pub const PEAK_ALLOW_ECHO_FRAMES: u32 = 44;
pub const PEAK_DEVICE_PART_NUMBER: u32 = 45;
pub const PEAK_DEVICE_NUMBER: u32 = 1;
pub const PEAK_PARAMETER_OFF: u32 = 0;
pub const PEAK_PARAMETER_ON: u32 = 1;
pub const PEAK_FILTER_CLOSE: u32 = 0;
pub const PEAK_FILTER_OPEN: u32 = 1;
pub const PEAK_FILTER_CUSTOM: u32 = 2;
pub const PEAK_CHANNEL_UNAVAILABLE: u32 = 0;
pub const PEAK_CHANNEL_AVAILABLE: u32 = 1;
pub const PEAK_CHANNEL_OCCUPIED: u32 = 2;
pub const PEAK_CHANNEL_PEAKVIEW: u32 = 3;
pub const LOG_FUNCTION_DEFAULT: u32 = 0;
pub const LOG_FUNCTION_ENTRY: u32 = 1;
pub const LOG_FUNCTION_PARAMETERS: u32 = 2;
pub const LOG_FUNCTION_LEAVE: u32 = 4;
pub const LOG_FUNCTION_WRITE: u32 = 8;
pub const LOG_FUNCTION_READ: u32 = 16;
pub const LOG_FUNCTION_ALL: u32 = 65535;
pub const TRACE_FILE_SINGLE: u32 = 0;
pub const TRACE_FILE_SEGMENTED: u32 = 1;
pub const TRACE_FILE_DATE: u32 = 2;
pub const TRACE_FILE_TIME: u32 = 4;
pub const TRACE_FILE_OVERWRITE: u32 = 128;
pub const TRACE_FILE_DATA_LENGTH: u32 = 256;
pub const FEATURE_FD_CAPABLE: u32 = 1;
pub const FEATURE_DELAY_CAPABLE: u32 = 2;
pub const FEATURE_IO_CAPABLE: u32 = 4;
pub const SERVICE_STATUS_STOPPED: u32 = 1;
pub const SERVICE_STATUS_RUNNING: u32 = 4;
pub const MAX_LENGTH_HARDWARE_NAME: u32 = 33;
pub const MAX_LENGTH_VERSION_STRING: u32 = 256;
pub const PEAK_MESSAGE_STANDARD: u32 = 0;
pub const PEAK_MESSAGE_RTR: u32 = 1;
pub const PEAK_MESSAGE_EXTENDED: u32 = 2;
pub const PEAK_MESSAGE_FD: u32 = 4;
pub const PEAK_MESSAGE_BRS: u32 = 8;
pub const PEAK_MESSAGE_ESI: u32 = 16;
pub const PEAK_MESSAGE_ECHO: u32 = 32;
pub const PEAK_MESSAGE_ERRFRAME: u32 = 64;
pub const PEAK_MESSAGE_STATUS: u32 = 128;
pub const PEAK_MODE_STANDARD: u32 = 0;
pub const PEAK_MODE_EXTENDED: u32 = 2;
pub const PEAK_BAUD_1M: u32 = 20;
pub const PEAK_BAUD_800K: u32 = 22;
pub const PEAK_BAUD_500K: u32 = 28;
pub const PEAK_BAUD_250K: u32 = 284;
pub const PEAK_BAUD_125K: u32 = 796;
pub const PEAK_BAUD_100K: u32 = 17199;
pub const PEAK_BAUD_95K: u32 = 49998;
pub const PEAK_BAUD_83K: u32 = 34091;
pub const PEAK_BAUD_50K: u32 = 18223;
pub const PEAK_BAUD_47K: u32 = 5140;
pub const PEAK_BAUD_33K: u32 = 35631;
pub const PEAK_BAUD_20K: u32 = 21295;
pub const PEAK_BAUD_10K: u32 = 26415;
pub const PEAK_BAUD_5K: u32 = 32639;
pub const PEAK_TYPE_ISA: u32 = 1;
pub const PEAK_TYPE_ISA_SJA: u32 = 9;
pub const PEAK_TYPE_ISA_PHYTEC: u32 = 4;
pub const PEAK_TYPE_DNG: u32 = 2;
pub const PEAK_TYPE_DNG_EPP: u32 = 3;
pub const PEAK_TYPE_DNG_SJA: u32 = 5;
pub const PEAK_TYPE_DNG_SJA_EPP: u32 = 6;
pub type BYTE = ::std::os::raw::c_uchar;
pub type WORD = ::std::os::raw::c_ushort;
pub type DWORD = ::std::os::raw::c_ulong;
pub type UINT64 = ::std::os::raw::c_ulonglong;
pub type CHAR = ::std::os::raw::c_char;
pub type LPSTR = *mut CHAR;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tagTPEAKMsg {
pub ID: DWORD,
pub MSGTYPE: BYTE,
pub LEN: BYTE,
pub DATA: [BYTE; 8usize],
}
pub type TPEAKMsg = tagTPEAKMsg;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tagTPEAKTimestamp {
pub millis: DWORD,
pub millis_overflow: WORD,
pub micros: WORD,
}
pub type TPEAKTimestamp = tagTPEAKTimestamp;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tagTPEAKMsgFD {
pub ID: DWORD,
pub MSGTYPE: BYTE,
pub DLC: BYTE,
pub DATA: [BYTE; 64usize],
}
pub type TPEAKMsgFD = tagTPEAKMsgFD;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tagTPEAKChannelInformation {
pub channel_handle: WORD,
pub device_type: BYTE,
pub controller_number: BYTE,
pub device_features: DWORD,
pub device_name: [::std::os::raw::c_char; 33usize],
pub device_id: DWORD,
pub channel_condition: DWORD,
}
pub type TPEAKChannelInformation = tagTPEAKChannelInformation;
pub struct Pcan {
__library: ::libloading::Library,
pub CAN_Initialize: Result<
unsafe extern "C" fn(
Channel: WORD,
Btr0Btr1: WORD,
HwType: BYTE,
IOPort: DWORD,
Interrupt: WORD,
) -> DWORD,
::libloading::Error,
>,
pub CAN_InitializeFD:
Result<unsafe extern "C" fn(Channel: WORD, BitrateFD: LPSTR) -> DWORD, ::libloading::Error>,
pub CAN_Uninitialize: Result<unsafe extern "C" fn(Channel: WORD) -> DWORD, ::libloading::Error>,
pub CAN_Reset: Result<unsafe extern "C" fn(Channel: WORD) -> DWORD, ::libloading::Error>,
pub CAN_GetStatus: Result<unsafe extern "C" fn(Channel: WORD) -> DWORD, ::libloading::Error>,
pub CAN_Read: Result<
unsafe extern "C" fn(
Channel: WORD,
MessageBuffer: *mut TPEAKMsg,
TimestampBuffer: *mut TPEAKTimestamp,
) -> DWORD,
::libloading::Error,
>,
pub CAN_ReadFD: Result<
unsafe extern "C" fn(
Channel: WORD,
MessageBuffer: *mut TPEAKMsgFD,
TimestampBuffer: *mut UINT64,
) -> DWORD,
::libloading::Error,
>,
pub CAN_Write: Result<
unsafe extern "C" fn(Channel: WORD, MessageBuffer: *mut TPEAKMsg) -> DWORD,
::libloading::Error,
>,
pub CAN_WriteFD: Result<
unsafe extern "C" fn(Channel: WORD, MessageBuffer: *mut TPEAKMsgFD) -> DWORD,
::libloading::Error,
>,
pub CAN_FilterMessages: Result<
unsafe extern "C" fn(Channel: WORD, FromID: DWORD, ToID: DWORD, Mode: BYTE) -> DWORD,
::libloading::Error,
>,
pub CAN_GetValue: Result<
unsafe extern "C" fn(
Channel: WORD,
Parameter: BYTE,
Buffer: *mut ::std::os::raw::c_void,
BufferLength: DWORD,
) -> DWORD,
::libloading::Error,
>,
pub CAN_SetValue: Result<
unsafe extern "C" fn(
Channel: WORD,
Parameter: BYTE,
Buffer: *mut ::std::os::raw::c_void,
BufferLength: DWORD,
) -> DWORD,
::libloading::Error,
>,
pub CAN_GetErrorText: Result<
unsafe extern "C" fn(Error: DWORD, Language: WORD, Buffer: LPSTR) -> DWORD,
::libloading::Error,
>,
pub CAN_LookUpChannel: Result<
unsafe extern "C" fn(Parameters: LPSTR, FoundChannel: *mut WORD) -> DWORD,
::libloading::Error,
>,
}
impl Pcan {
pub unsafe fn new<P>(path: P) -> Result<Self, ::libloading::Error>
where
P: AsRef<::std::ffi::OsStr>,
{
let library = ::libloading::Library::new(path)?;
Self::from_library(library)
}
pub unsafe fn from_library<L>(library: L) -> Result<Self, ::libloading::Error>
where
L: Into<::libloading::Library>,
{
let __library = library.into();
let CAN_Initialize = __library.get(b"CAN_Initialize\0").map(|sym| *sym);
let CAN_InitializeFD = __library.get(b"CAN_InitializeFD\0").map(|sym| *sym);
let CAN_Uninitialize = __library.get(b"CAN_Uninitialize\0").map(|sym| *sym);
let CAN_Reset = __library.get(b"CAN_Reset\0").map(|sym| *sym);
let CAN_GetStatus = __library.get(b"CAN_GetStatus\0").map(|sym| *sym);
let CAN_Read = __library.get(b"CAN_Read\0").map(|sym| *sym);
let CAN_ReadFD = __library.get(b"CAN_ReadFD\0").map(|sym| *sym);
let CAN_Write = __library.get(b"CAN_Write\0").map(|sym| *sym);
let CAN_WriteFD = __library.get(b"CAN_WriteFD\0").map(|sym| *sym);
let CAN_FilterMessages = __library.get(b"CAN_FilterMessages\0").map(|sym| *sym);
let CAN_GetValue = __library.get(b"CAN_GetValue\0").map(|sym| *sym);
let CAN_SetValue = __library.get(b"CAN_SetValue\0").map(|sym| *sym);
let CAN_GetErrorText = __library.get(b"CAN_GetErrorText\0").map(|sym| *sym);
let CAN_LookUpChannel = __library.get(b"CAN_LookUpChannel\0").map(|sym| *sym);
Ok(Pcan {
__library,
CAN_Initialize,
CAN_InitializeFD,
CAN_Uninitialize,
CAN_Reset,
CAN_GetStatus,
CAN_Read,
CAN_ReadFD,
CAN_Write,
CAN_WriteFD,
CAN_FilterMessages,
CAN_GetValue,
CAN_SetValue,
CAN_GetErrorText,
CAN_LookUpChannel,
})
}
#[doc = " <summary>\n Initializes a PEAK Channel\n </summary>\n <param name=\"Channel\">\"The handle of a PEAK Channel\"</param>\n <param name=\"Btr0Btr1\">\"The speed for the communication (BTR0BTR1 code)\"</param>\n <param name=\"HwType\">\"Non-PnP: The type of hardware and operation mode\"</param>\n <param name=\"IOPort\">\"Non-PnP: The I/O address for the parallel port\"</param>\n <param name=\"Interrupt\">\"Non-PnP: Interrupt number of the parallel port\"</param>\n <returns>\"A TPEAKStatus error code\"</returns>"]
pub unsafe fn CAN_Initialize(
&self,
Channel: WORD,
Btr0Btr1: WORD,
HwType: BYTE,
IOPort: DWORD,
Interrupt: WORD,
) -> DWORD {
(self
.CAN_Initialize
.as_ref()
.expect("Expected function, got error."))(
Channel, Btr0Btr1, HwType, IOPort, Interrupt
)
}
#[doc = " <example>f_clock=80000000,nom_brp=10,nom_tseg1=5,nom_tseg2=2,nom_sjw=1,data_brp=4,data_tseg1=7,data_tseg2=2,data_sjw=1</example>\n <returns>\"A TPEAKStatus error code\"</returns>"]
pub unsafe fn CAN_InitializeFD(&self, Channel: WORD, BitrateFD: LPSTR) -> DWORD {
(self
.CAN_InitializeFD
.as_ref()
.expect("Expected function, got error."))(Channel, BitrateFD)
}
#[doc = " <summary>\n Uninitializes one or all PEAK Channels initialized by CAN_Initialize\n </summary>\n <remarks>Giving the TPEAKHandle value \"PEAK_NONEBUS\",\n uninitialize all initialized channels</remarks>\n <param name=\"Channel\">\"The handle of a PEAK Channel\"</param>\n <returns>\"A TPEAKStatus error code\"</returns>"]
pub unsafe fn CAN_Uninitialize(&self, Channel: WORD) -> DWORD {
(self
.CAN_Uninitialize
.as_ref()
.expect("Expected function, got error."))(Channel)
}
#[doc = " <summary>\n Resets the receive and transmit queues of the PEAK Channel\n </summary>\n <remarks>\n A reset of the CAN controller is not performed.\n </remarks>\n <param name=\"Channel\">\"The handle of a PEAK Channel\"</param>\n <returns>\"A TPEAKStatus error code\"</returns>"]
pub unsafe fn CAN_Reset(&self, Channel: WORD) -> DWORD {
(self
.CAN_Reset
.as_ref()
.expect("Expected function, got error."))(Channel)
}
#[doc = " <summary>\n Gets the current status of a PEAK Channel\n </summary>\n <param name=\"Channel\">\"The handle of a PEAK Channel\"</param>\n <returns>\"A TPEAKStatus error code\"</returns>"]
pub unsafe fn CAN_GetStatus(&self, Channel: WORD) -> DWORD {
(self
.CAN_GetStatus
.as_ref()
.expect("Expected function, got error."))(Channel)
}
#[doc = " <summary>\n Reads a CAN message from the receive queue of a PEAK Channel\n </summary>\n <param name=\"Channel\">\"The handle of a PEAK Channel\"</param>\n <param name=\"MessageBuffer\">\"A TPEAKMsg structure buffer to store the CAN message\"</param>\n <param name=\"TimestampBuffer\">\"A TPEAKTimestamp structure buffer to get\n the reception time of the message. If this value is not desired, this parameter\n should be passed as NULL\"</param>\n <returns>\"A TPEAKStatus error code\"</returns>"]
pub unsafe fn CAN_Read(
&self,
Channel: WORD,
MessageBuffer: *mut TPEAKMsg,
TimestampBuffer: *mut TPEAKTimestamp,
) -> DWORD {
(self
.CAN_Read
.as_ref()
.expect("Expected function, got error."))(
Channel, MessageBuffer, TimestampBuffer
)
}
#[doc = " <summary>\n Reads a CAN message from the receive queue of a FD capable PEAK Channel\n </summary>\n <param name=\"Channel\">\"The handle of a FD capable PEAK Channel\"</param>\n <param name=\"MessageBuffer\">\"A TPEAKMsgFD structure buffer to store the CAN message\"</param>\n <param name=\"TimestampBuffer\">\"A TPEAKTimestampFD buffer to get\n the reception time of the message. If this value is not desired, this parameter\n should be passed as NULL\"</param>\n <returns>\"A TPEAKStatus error code\"</returns>"]
pub unsafe fn CAN_ReadFD(
&self,
Channel: WORD,
MessageBuffer: *mut TPEAKMsgFD,
TimestampBuffer: *mut UINT64,
) -> DWORD {
(self
.CAN_ReadFD
.as_ref()
.expect("Expected function, got error."))(
Channel, MessageBuffer, TimestampBuffer
)
}
#[doc = " <summary>\n Transmits a CAN message\n </summary>\n <param name=\"Channel\">\"The handle of a PEAK Channel\"</param>\n <param name=\"MessageBuffer\">\"A TPEAKMsg buffer with the message to be sent\"</param>\n <returns>\"A TPEAKStatus error code\"</returns>"]
pub unsafe fn CAN_Write(&self, Channel: WORD, MessageBuffer: *mut TPEAKMsg) -> DWORD {
(self
.CAN_Write
.as_ref()
.expect("Expected function, got error."))(Channel, MessageBuffer)
}
#[doc = " <summary>\n Transmits a CAN message over a FD capable PEAK Channel\n </summary>\n <param name=\"Channel\">\"The handle of a FD capable PEAK Channel\"</param>\n <param name=\"MessageBuffer\">\"A TPEAKMsgFD buffer with the message to be sent\"</param>\n <returns>\"A TPEAKStatus error code\"</returns>"]
pub unsafe fn CAN_WriteFD(&self, Channel: WORD, MessageBuffer: *mut TPEAKMsgFD) -> DWORD {
(self
.CAN_WriteFD
.as_ref()
.expect("Expected function, got error."))(Channel, MessageBuffer)
}
#[doc = " <summary>\n Configures the reception filter.\n </summary>\n <remarks>The message filter will be expanded with every call to\n this function. If it is desired to reset the filter, please use\n the CAN_SetValue function</remarks>\n <param name=\"Channel\">\"The handle of a PEAK Channel\"</param>\n <param name=\"FromID\">\"The lowest CAN ID to be received\"</param>\n <param name=\"ToID\">\"The highest CAN ID to be received\"</param>\n <param name=\"Mode\">\"Message type, Standard (11-bit identifier) or\n Extended (29-bit identifier)\"</param>\n <returns>\"A TPEAKStatus error code\"</returns>"]
pub unsafe fn CAN_FilterMessages(
&self,
Channel: WORD,
FromID: DWORD,
ToID: DWORD,
Mode: BYTE,
) -> DWORD {
(self
.CAN_FilterMessages
.as_ref()
.expect("Expected function, got error."))(Channel, FromID, ToID, Mode)
}
#[doc = " <summary>\n Retrieves a PEAK Channel value\n </summary>\n <remarks>Parameters can be present or not according with the kind\n of Hardware (PEAK Channel) being used. If a parameter is not available,\n a PEAK_ERROR_ILLPARAMTYPE error will be returned</remarks>\n <param name=\"Channel\">\"The handle of a PEAK Channel\"</param>\n <param name=\"Parameter\">\"The TPEAKParameter parameter to get\"</param>\n <param name=\"Buffer\">\"Buffer for the parameter value\"</param>\n <param name=\"BufferLength\">\"Size in bytes of the buffer\"</param>\n <returns>\"A TPEAKStatus error code\"</returns>"]
pub unsafe fn CAN_GetValue(
&self,
Channel: WORD,
Parameter: BYTE,
Buffer: *mut ::std::os::raw::c_void,
BufferLength: DWORD,
) -> DWORD {
(self
.CAN_GetValue
.as_ref()
.expect("Expected function, got error."))(
Channel, Parameter, Buffer, BufferLength
)
}
#[doc = " <summary>\n Configures or sets a PEAK Channel value\n </summary>\n <remarks>Parameters can be present or not according with the kind\n of Hardware (PEAK Channel) being used. If a parameter is not available,\n a PEAK_ERROR_ILLPARAMTYPE error will be returned</remarks>\n <param name=\"Channel\">\"The handle of a PEAK Channel\"</param>\n <param name=\"Parameter\">\"The TPEAKParameter parameter to set\"</param>\n <param name=\"Buffer\">\"Buffer with the value to be set\"</param>\n <param name=\"BufferLength\">\"Size in bytes of the buffer\"</param>\n <returns>\"A TPEAKStatus error code\"</returns>"]
pub unsafe fn CAN_SetValue(
&self,
Channel: WORD,
Parameter: BYTE,
Buffer: *mut ::std::os::raw::c_void,
BufferLength: DWORD,
) -> DWORD {
(self
.CAN_SetValue
.as_ref()
.expect("Expected function, got error."))(
Channel, Parameter, Buffer, BufferLength
)
}
#[doc = " <summary>\n Returns a descriptive text of a given TPEAKStatus error\n code, in any desired language\n </summary>\n <remarks>The current languages available for translation are:\n Neutral (0x00), German (0x07), English (0x09), Spanish (0x0A),\n Italian (0x10) and French (0x0C)</remarks>\n <param name=\"Error\">\"A TPEAKStatus error code\"</param>\n <param name=\"Language\">\"Indicates a 'Primary language ID'\"</param>\n <param name=\"Buffer\">\"Buffer for a null terminated char array\"</param>\n <returns>\"A TPEAKStatus error code\"</returns>"]
pub unsafe fn CAN_GetErrorText(&self, Error: DWORD, Language: WORD, Buffer: LPSTR) -> DWORD {
(self
.CAN_GetErrorText
.as_ref()
.expect("Expected function, got error."))(Error, Language, Buffer)
}
#[doc = " <summary>\n Finds a PEAK-Basic channel that matches with the given parameters\n </summary>\n <param name=\"Parameters\">A comma separated string contained pairs of\n parameter-name/value to be matched within a PEAK-Basic channel</param>\n <param name=\"FoundChannel\">Buffer for returning the PEAK-Basic channel,\n when found</param>\n <returns>A TPEAKStatus error code</returns>"]
pub unsafe fn CAN_LookUpChannel(&self, Parameters: LPSTR, FoundChannel: *mut WORD) -> DWORD {
(self
.CAN_LookUpChannel
.as_ref()
.expect("Expected function, got error."))(Parameters, FoundChannel)
}
}