added get port function to device and resource