convert device code to hex