With data speed I think it could be a little more complicated. Like OP was saying it would need access to some level of hardware information where it can see which pins are used by the cable. Since the connection 'speed' is still variable even when you DO have a supported cable.