Detect device id first
Split out device.[hc]