Determining the structure of the remote control codes