示例#1
0
        public static bool Read(CSerialPort serial_port, byte port, SonarCommands command)
        {
            byte[] data = { 0x02, (byte)command };

            switch (command)
            {
                case SonarCommands.Version:
                case SonarCommands.ProductID:
                case SonarCommands.SensorType:
                    return LSWrite(serial_port, port, data, 8);
                case SonarCommands.MeasurementUnits:
                    return LSWrite(serial_port, port, data, 7);
                default:
                    return LSWrite(serial_port, port, data, 1);
            }
        }
示例#2
0
        public static bool Read(CSerialPort serial_port, byte port, SonarCommands command, ref byte[] reply)
        {
            if (!Read(serial_port, port, command))
                return false;

            return LSRead(serial_port, port, ref reply);
        }