Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: added md discovery method
  • Loading branch information
PawelKorsak committed Mar 23, 2026
commit bea76f69fa627e1504aba56fbdcac0470179aa74
17 changes: 17 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"cStandard": "c17",
"cppStandard": "gnu++20",
"intelliSenseMode": "linux-gcc-x64",
"configurationProvider": "ms-vscode.cmake-tools",
"compileCommands": "${workspaceFolder}/build/compile_commands.json"
}
],
"version": 4
}
4 changes: 3 additions & 1 deletion examples/py/md_impedance.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
# Initialize CANdle on the USB bus (SPI bus not supported yet)
candle = pc.attachCandle(pc.CANdleDatarate_E.CAN_DATARATE_1M, pc.busTypes_t.USB)

md_id = pc.discoverMDs(candle)[0] # Discover MDs and take the first one

# Create virual MD representation
md = pc.MD(100, candle)
md = pc.MD(md_id, candle)

# Initialize it to see if it connects
err = md.init()
Expand Down
2 changes: 2 additions & 0 deletions pycandle/src/bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,8 @@ PYBIND11_MODULE(pyCandle, m)
py::arg("regName"),
py::arg("value"),
"Write a register to the MD device.");
m.def("discoverMDs", &mab::MD::discoverMDs, "Discover MD devices connected to the system.");


// Logger
py::enum_<Logger::Verbosity_E>(m, "Verbosity_E")
Expand Down