Esempio n. 1
0
        private int _I2cRead(byte devAddr, byte regAddr, byte length, byte[] data)
        {
            int rv;

            if (i2cMaster.connected == false)
            {
                if (_I2cMasterConnect() < 0)
                {
                    return(-1);
                }
            }

            rv = i2cMaster.ReadApi(devAddr, regAddr, length, data);
            if (rv < 0)
            {
                MessageBox.Show("QSFP+ module no response!!");
                _I2cMasterDisconnect();
            }
            else if (rv != length)
            {
                MessageBox.Show("Only read " + rv + " not " + length + " byte Error!!");
            }

            return(rv);
        }
Esempio n. 2
0
        private int _MeasuredObjectI2cRead(byte devAddr, byte regAddr, byte length, byte[] data)
        {
            int rv;

            if (measuredObjectI2cAdapter.connected == false)
            {
                return(0);
            }

            rv = measuredObjectI2cAdapter.ReadApi(devAddr, regAddr, length, data);
            if (rv < 0)
            {
                MessageBox.Show("QSFP+ module no response!!");
                return(-1);
            }

            return(rv);
        }
Esempio n. 3
0
        private int _PowerMeterQsfpI2cRead(byte devAddr, byte regAddr, byte length, byte[] data)
        {
            int rv;

            if (powerMeterQsfpI2cAdapter.connected == false)
            {
                return(0);
            }

            rv = powerMeterQsfpI2cAdapter.ReadApi(devAddr, regAddr, length, data);
            if (rv < 0)
            {
                MessageBox.Show("Power Meter QSFP module no response!!");
                return(-1);
            }

            return(rv);
        }
        private int _IM_LightSourceRead(byte devAddr, byte regAddr, byte length, byte[] data)
        {
            int rv;

            if (imLightSoutce.connected == false)
            {
                if (_IM_LightSourceConnect() < 0)
                {
                    return(-1);
                }
            }

            rv = imLightSoutce.ReadApi(devAddr, regAddr, length, data);
            if (rv < 0)
            {
                MessageBox.Show("QSFP+ module no response!!");
                _IM_LightSourceDisconnect();
            }

            return(rv);
        }
        private int _IM_BeAlignmentRead(byte devAddr, byte regAddr, byte length, byte[] data)
        {
            int rv;

            if (imBeAlignment.connected == false)
            {
                if (_IM_BeAlignmentConnect() < 0)
                {
                    return(-1);
                }
            }

            rv = imBeAlignment.ReadApi(devAddr, regAddr, length, data);
            if (rv < 0)
            {
                MessageBox.Show("QSFP+ module no response!!");
                _IM_BeAlignmentDisconnect();
            }

            return(rv);
        }
        private int _LightSourceI2cRead(byte devAddr, byte regAddr, byte length, byte[] data)
        {
            int rv;

            if (lightSourceI2cAdapter.connected == false)
            {
                if (_LightSourceI2cConnect() < 0)
                {
                    return(-1);
                }
            }

            rv = lightSourceI2cAdapter.ReadApi(devAddr, regAddr, length, data);
            if (rv < 0)
            {
                MessageBox.Show("Light Source module no response!!");
                return(-1);
            }

            return(rv);
        }
        private int _RssiMeasureI2cRead(byte devAddr, byte regAddr, byte length, byte[] data)
        {
            int rv;

            if (rssiMeasureI2cAdapter.connected == false)
            {
                if (_RssiMeasureI2cConnect() < 0)
                {
                    return(-1);
                }
            }

            rv = rssiMeasureI2cAdapter.ReadApi(devAddr, regAddr, length, data);
            if (rv < 0)
            {
                MessageBox.Show("RSSI Measure module no response!!");
                return(-1);
            }

            return(rv);
        }
Esempio n. 8
0
        private int _QsfpI2cRead(byte devAddr, byte regAddr, byte length, byte[] data)
        {
            int rv;

            if (qsfpI2cMaster.connected == false)
            {
                if (_QsfpI2cConnect() < 0)
                {
                    return(-1);
                }
            }

            rv = qsfpI2cMaster.ReadApi(devAddr, regAddr, length, data);
            if (rv < 0)
            {
                MessageBox.Show("QSFP+ module no response!!");
                _QsfpI2cDisconnect();
            }

            return(rv);
        }