[package]
name = "masterbus"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
description = "Idiomatic Rust client for the Mastervolt MasterBus CAN-bus protocol"
readme = "README.md"
keywords = ["mastervolt", "canbus", "nmea2000", "marine", "socketcan"]
categories = ["embedded", "hardware-support", "network-programming"]

[lib]
name = "masterbus"

[dependencies]
thiserror.workspace = true
crossbeam-channel.workspace = true
log.workspace = true
serde = { workspace = true }
serde_json = { workspace = true }

[dev-dependencies]
env_logger.workspace = true

# Cross-platform Mastervolt USB-link (HID) transport. On Linux use hidapi's
# pure-Rust hidraw backend (no libudev, no C toolchain) so cross-compiles stay
# clean; macOS/Windows use the default (IOKit / windows-sys) backends.
[target.'cfg(target_os = "linux")'.dependencies]
socketcan.workspace = true
hidapi = { version = "2", default-features = false, features = ["linux-native-basic-udev"] }

[target.'cfg(not(target_os = "linux"))'.dependencies]
hidapi = "2"
