Reply to thread

Just got it working. I had to make some modifications in order for it to work on my D10-200. I guess it uses the same command set, but formats it a little differently. Still needs some testing (which I intend to do now..), but here is the code.


And did I mention how nice it is to be blaster-less?




        private const byte COMMAND_PARSER_RESET = 0xFF;

        private const byte D10_200_DEVICE_TYPE = 0x0D;


        public bool TuneD10_200(Int32 channelNum)

        {

            string hexString = channelNum.ToString("x4");

            byte[] bytes = new byte[7]{COMMAND_PREFIX, COMMAND_CHANNEL_SET, getByte(hexString, 0), getByte(hexString, 2), COMMAND_PARSER_RESET, COMMAND_PARSER_RESET, D10_200_DEVICE_TYPE};


            _serialPort.Write(bytes, 0,7);


            byte returnVal = (byte)_serialPort.ReadByte();


            if (returnVal == RETURN_PROCESSING)

            {

                returnVal = (byte)_serialPort.ReadByte();

            }



            if (returnVal == RETURN_COMPLETE)

            {

                return true;

            }


            return false;

        }




Top Bottom