Best way to distinguish between BBB vs BBAI in C

What’s the best way, at runtime, in C, to know whether we’re executing on a Beaglebone Black vs Beaglebone AI?

Don't try to get too fancy, just read /proc/device-tree/model to
detect what board you have..

Regards,

So I’m doing this, but I have a BeagleBone Black that shows /proc/device-tree/model as BeagleBone Green. Any ideas why this would be the case? Is it safe to assume that a green or black would behave the same assuming I’m not using HDMI?