示例#1
0
        public Boolean SetParameter(int nChannel, DeviceParam devParam)
        {
            AD101NativeMethods.AD101DEVICEPARAMETER nativeParam = new AD101NativeMethods.AD101DEVICEPARAMETER();

            nativeParam.nHookOff = devParam.HookOff;
            nativeParam.nHookOn = devParam.HookOn;
            nativeParam.nNoLine = devParam.NoLine;
            nativeParam.nRingOff = devParam.RingOff;
            nativeParam.nRingOn = devParam.RingOn;
            nativeParam.nStopCID = devParam.StopCallerId;

            int retVal = AD101NativeMethods.AD101_SetParameter(nChannel, ref nativeParam);

            return (retVal == OK);
        }
示例#2
0
        /// <summary>
        /// Get Device parameter list
        /// <para>Interrelated : ReadParam() method</para>
        /// </summary>
        /// <param name="nChannel"></param>
        /// <param name="outparam">Output Device Parameters</param>
        /// <returns></returns>
        public Boolean GetParameter(int nChannel, out DeviceParam outparam)
        {
            AD101NativeMethods.AD101DEVICEPARAMETER inParam = new AD101NativeMethods.AD101DEVICEPARAMETER();

            int retVal = AD101NativeMethods.AD101_GetParameter(nChannel, ref inParam);

            outparam = new DeviceParam();

            if (retVal == OK)
            {
                outparam.HookOff = inParam.nHookOff;
                outparam.HookOn = inParam.nHookOn;
                outparam.RingOff = inParam.nRingOff;
                outparam.RingOn = inParam.nRingOn;
                outparam.StopCallerId = inParam.nStopCID;
                outparam.NoLine = inParam.nNoLine;
            }

            return (retVal == OK);
        }