OBD has built in codes to check for support of PIDs (0x00, 0x20, 0x40, 0x60 and 0x80). Each command returns as 32 bit result indicating support for the next 32 PIDs (or not). The OBD library uses these PIDs and stores the results in pidmap, which is a public variable of the COBD class. This is done when COD::init is executed, so you can get all the information you need without having to send a command yourself (I haven't tested the below code, but it does compile and I went through the logic on the whiteboard...)
yes i can see that bit in init now, thanks for pointing it out.
the reason i did it my way is that i had already tried those pid supported requests with a elm327 and they dont seem to work correctly with my car. thus my manual method.