Skip to content

Commit

Permalink
Begin writing inital UI setup code with ICED
Browse files Browse the repository at this point in the history
  • Loading branch information
rnd-ash committed Jun 28, 2021
1 parent e90f246 commit 46ac7b0
Show file tree
Hide file tree
Showing 16 changed files with 520 additions and 20 deletions.
1 change: 1 addition & 0 deletions diagnostics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
hardware = { path = "../hardware" }
253 changes: 253 additions & 0 deletions diagnostics/src/ecu_suppliers.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,253 @@

pub fn get_ecu_supplier_name(supplier_id: u16) -> &'static str {
match supplier_id {
0x01 => "Becker",
0x02 => "Blaupunkt",
0x03 => "Bosch",
0x04 => "MB",
0x05 => "HuF",
0x06 => "Kammerer",
0x07 => "Kostal",
0x08 => "Siemens",
0x09 => "Stribel",
0x0A => "MicroHeat",
0x0B => "JATCO",
0x0C => "Cummins",
0x0D => "Bosch Automotive Steering",
0x0E => "Nidec Motors & Actuators",
0x0F => "S&T Daewoo (Science & Technology Daewoo)",
0x10 => "SWF",
0x11 => "VDO",
0x12 => "Webasto",
0x13 => "Dornier",
0x14 => "TEG",
0x15 => "Hella",
0x16 => "Lucas",
0x17 => "GKR",
0x18 => "MBB",
0x19 => "Motometer",
0x1A => "Daimler",
0x1B => "Sanden",
0x1C => "IEE",
0x1D => "ASK",
0x1E => "U-Shin",
0x1F => "Volkswagen",
0x20 => "Borg",
0x21 => "Temic",
0x22 => "Teves",
0x23 => "Borg Warner",
0x24 => "MED S.P.A",
0x25 => "DENSO",
0x26 => "ZF",
0x27 => "TRW",
0x28 => "Dunlop",
0x29 => "LuK",
0x2A => "Hyundai Autonet",
0x2B => "Freightliner",
0x2C => "TAKATA-PETRI",
0x2D => "Haldex",
0x2E => "Hirschmann",
0x2F => "e2v Technology",
0x30 => "Magneti Marelli",
0x31 => "DODUCO",
0x32 => "Alpine",
0x33 => "AMC (AEG Mobile Com.)",
0x34 => "Bose",
0x35 => "DASA",
0x36 => "Motorola",
0x37 => "Nokia",
0x38 => "Panasonic",
0x39 => "APAG",
0x3A => "Rialtosoft",
0x3B => "Applicom",
0x3C => "Conti Temic",
0x3D => "Cherry",
0x3E => "TI Automotive",
0x3F => "Kongsberg Automotive",
0x40 => "Delphi",
0x41 => "Alfmeier",
0x42 => "Sidler",
0x43 => "Marquardt",
0x44 => "Wehrle",
0x45 => "megamos",
0x46 => "ADC",
0x47 => "BERU",
0x48 => "Valeo",
0x49 => "Magna",
0x4A => "Allison",
0x4B => "Isringhausen",
0x4C => "Grammer",
0x4D => "Funkwerk Dabendorf",
0x4E => "Hella-Behr",
0x4F => "Pollack",
0x50 => "AKG",
0x51 => "Automotive Lighting",
0x52 => "TAG",
0x53 => "UNITED PARTS",
0x54 => "catem",
0x55 => "Alge",
0x56 => "Pierburg",
0x57 => "Brusa",
0x58 => "Ecostar",
0x59 => "NuCellSys",
0x5A => "Wabco Automotive",
0x5B => "Voith",
0x5C => "Knorr",
0x5D => "TVI",
0x5E => "Stoneridge",
0x5F => "Telma",
0x60 => "STW",
0x61 => "Koyo",
0x62 => "Eberspaecher",
0x63 => "ADVICS",
0x64 => "OMRON",
0x65 => "Mitsubishi Heavy Industry",
0x66 => "Methode",
0x67 => "UNISIAJECS",
0x68 => "UNISIA JKC Steering Systems",
0x69 => "AISIN",
0x6A => "Zexel Valeo",
0x6B => "Schrader",
0x6C => "Ballard",
0x6D => "Alcoa Fujikura",
0x6E => "Transtron",
0x6F => "Iteris",
0x70 => "SFT",
0x71 => "Kieckert AG",
0x72 => "Behr",
0x73 => "MB Lenkungen",
0x74 => "Sachs Automotive",
0x75 => "Peiker",
0x76 => "Petri",
0x77 => "Autoliv",
0x78 => "Thien electronic",
0x79 => "Siemens VDO",
0x7A => "Dornier Consulting GmbH",
0x7B => "Alps",
0x7C => "PREH",
0x7D => "Hitachi Unisia",
0x7E => "Hitachi",
0x80 => "Huntsville",
0x81 => "Yazaki",
0x82 => "Lear",
0x83 => "Johnson Controls",
0x84 => "Harman / Becker",
0x85 => "Mitsubishi Electric",
0x86 => "Tokico USA Inc.",
0x87 => "Nippon Seiki (NS Intl)",
0x88 => "Inalfa",
0x89 => "Nippon Seiki (UK)",
0x8A => "GHSP",
0x8B => "Vector",
0x8C => "Gentex",
0x8D => "Visteon",
0x8E => "Tochigi Fuji",
0x8F => "Chrysler",
0x90 => "May and Scofield",
0x91 => "Mercedes-Benz Hamburg Plant",
0x92 => "AISIN AW",
0x93 => "TOYODA MACHINE WORKS",
0x94 => "Solectron-Invotronics",
0x95 => "KICKER",
0x96 => "American Axle Company",
0x97 => "GETRAG",
0x98 => "Promate",
0x99 => "ArvinMeritor",
0x9A => "Autometer",
0x9B => "Valeo Sylvania",
0x9C => "Cobasys",
0x9D => "Helbako",
0x9E => "Continental",
0xA2 => "FUSO",
0xA3 => "Autokabel",
0xA4 => "Hyundai Mobis",
0xA5 => "Festo",
0xA6 => "Schmidhauser",
0xA7 => "Sphere DesignGmbH",
0xA8 => "Deutsche Accumotive GmbH & Co KG",
0xA9 => "BRC Gas Equipment",
0xAA => "Delta Energy Systems",
0xAB => "A123 Systems",
0xAC => "Mercedes AMG",
0xAD => "Huber Automotive AG",
0xAE => "Witte Velbert",
0xAF => "MetaSystem",
0xB0 => "M/A-COM",
0xB1 => "TBK (Tokai Bussan Corp)",
0xB2 => "DDC (Detroit Diesel Corp)",
0xB3 => "3SOFT",
0xB4 => "MB-Tech",
0xB5 => "E-T-A",
0xB6 => "Ssangyong",
0xB7 => "Paragon",
0xB8 => "ThyssenKrupp",
0xB9 => "Hoerbiger",
0xBA => "Bang and Olufsen",
0xBB => "Hughes",
0xBC => "Flextronics",
0xBD => "Spheros",
0xBE => "Küster ACS",
0xBF => "Kromberg und Schubert",
0xC0 => "SB LiMotive",
0xC1 => "MAGNA E-Car Systems GmbH & Co OG",
0xC2 => "SK innovation",
0xC3 => "Renault",
0xC4 => "Bury",
0xC5 => "Digades",
0xC6 => "Claas",
0xC7 => "Widmaier",
0xC8 => "Garmin",
0xC9 => "Liebherr",
0xCA => "LAWO",
0xCB => "Poclain Hydraulics Industry",
0xCC => "Tesla",
0xCD => "Daimler Plant Mannheim",
0xCE => "Ametek VIS",
0xCF => "Phoenix International",
0xD0 => "Magna Reman",
0xD1 => "IHI",
0xD2 => "Bitron",
0xD3 => "Navis",
0xD4 => "Casco Schoeller GmbH",
0xD5 => "Tokyo R&D",
0xD6 => "Ortem",
0xD7 => "BHTC",
0xD8 => "Bergstrom",
0xD9 => "Daimler TSS",
0xDA => "LG Electronics",
0xDB => "AML",
0xDC => "Toyota Industries Corporation",
0xDD => "JTEKT",
0xDE => "Samsung SDI",
0xDF => "ITK Engineering AG",
0xE0 => "Kristronics",
0xE1 => "RaPa Rausch&Pausch",
0xE2 => "AKASOL GmbH",
0xE3 => "Gigatronik Austria",
0xE4 => "Westfalia Automotive",
0xE5 => "Mekra-Lang GmbH & Co. KG",
0xE6 => "Keboda Technology Co., Ltd.",
0xE7 => "Valeo-Siemens",
0xE8 => "Elektrobit",
0xE9 => "BEG",
0xEA => "Hofer",
0xEB => "Laird GmbH",
0xEC => "AAM",
0xED => "FMCP",
0xEE => "MBRDI",
0xEF => "Veoneer",
0xF0 => "XTRONIC GmbH",
0xF1 => "Japan Radio Co., Ltd.",
0xF2 => "Aptiv",
0xF3 => "BCS Automotive Interface Solutions",
0xF4 => "CATL",
0xF5 => "Brose",
0xF6 => "Munich Electrification",
0xF7 => "BBAC",
0xF8 => "Ficosa",
0xF9 => "MB AMG HPP",
0xFA => "CES",
0xFB => "Semikron",
_ => "UNKNOWN"
}
}
4 changes: 4 additions & 0 deletions diagnostics/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
pub mod ecu_suppliers;
pub mod protocols;


#[cfg(test)]
mod tests {
#[test]
Expand Down
10 changes: 10 additions & 0 deletions diagnostics/src/protocols/kwp2000/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@


pub enum KwpSession {

}


pub trait Kwp2000Server {

}
42 changes: 42 additions & 0 deletions diagnostics/src/protocols/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
pub mod uds;
pub mod kwp2000;

#[derive(Debug)]
pub enum ProtocolError {
ECUError(u8),
ServerError(String),
DeviceError(hardware::HardwareError)
}

impl Into<ProtocolError> for hardware::HardwareError {
fn into(self) -> ProtocolError {
ProtocolError::DeviceError(self)
}
}

#[derive(Debug, Clone)]
pub enum DTCState {
None,
Stored,
Pending,
Active
}

#[derive(Debug, Clone)]
pub struct DTC {
code: String,
state: DTCState,
mil_on: bool
}

pub type ProtocolResult<T> = std::result::Result<T, ProtocolError>;

pub trait GenericProtocolServer {
fn send_command_with_response(&mut self, send: &[u8]) -> ProtocolResult<Vec<u8>>;

fn send_command(&mut self, send: &[u8]) -> ProtocolResult<()>;

fn read_dtcs(&mut self) -> ProtocolResult<Vec<DTC>>;


}
Empty file.
13 changes: 12 additions & 1 deletion hardware/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,16 @@ j2534_rust = {git = "https://github.com/rnd-ash/J2534-Rust", branch="main" }
serde_json = "1.0.58"
libloading = "0.7.0"
lazy_static = "1.4.0"
serde = {version = "1.0.80", features = ["derive"]}

logger = { path = "../logger" }

[target.'cfg(windows)'.dependencies]
winreg = "0.8"

[target.'cfg(unix)'.dependencies]
shellexpand = "2.1.0"
serde = {version = "1.0.80", features = ["derive"]}

[target.'cfg(target_os = "linux")'.dependencies]
socketcan = "1.7.0"
socketcan-isotp = "0.1.1"
Loading

0 comments on commit 46ac7b0

Please sign in to comment.