This package is a shim that returns a Swift-TouCAN interface on macOS and a Swift-SocketCAN interface on Linux, both conforming to the Swift-CAN interface protocol.
This is a Swift Package Manager (SPM) compliant package. Add
.package(url: "https://github.com/AutomotiveSwift/Swift-SocketCAN.git", from: "0.9.0")to your Package.swift.
Create the interface by using the static factory method:
import Swift_CAN_Anywhere
let can = CAN.attachToInterface("can0")Feel free to use this under the obligations of the MIT license. Contributions are always welcome. Stay safe and sound!