CANBUS / MCP2515 - How to poll for auto DTC's?

I’m using the Seeed CANBUS Shield v2 for a car project which involves an engine swap. I need to trigger the ‘check engine’ / MIL light when there are DTC / fault codes set on the engine ECU.

I’m currently reading all of the operational data no problem (RPM, temperature etc) but can’t figure out how to get at the DTC codes and MIL light status. I know these are defined in the OBD2 standard and it looks like I might have to poll for these ? Which I have never done …

Does anybody have working code that is specifically for the Seeed CANBUS Shield v2 or MCP2515 in general which can be used to poll for DTC codes or MIL light status ?