示例#1
0
文件: Led.cs 项目: iseebi/EbIRC
 public static int GetLedCount()
 {
     NLED_COUNT_INFO countInfo = new NLED_COUNT_INFO();
     int LEDCount = 0;
     if (NLedGetDeviceInfo(NLED_COUNT_INFO_ID, ref countInfo))
     {
         LEDCount = (int)countInfo.cLeds;
     }
     return LEDCount;
 }
        // Methods
        public Led()
        {
            NLED_COUNT_INFO pOutput = new NLED_COUNT_INFO();

            if (!NativeMethods.NLedGetDeviceCount(0, ref pOutput))
            {
                throw new Win32Exception(Marshal.GetLastWin32Error(), "Error Initialising LED's");
            }
            this.m_count = (int)pOutput.cLeds;
        }
示例#3
0
		/// <summary>
		/// Initialise the LED collection
		/// </summary>
		public Led()
		{
			NLED_COUNT_INFO CountStruct = new NLED_COUNT_INFO(); 
			if(!NLedGetDeviceCount(NLED_COUNT_INFO_ID,ref CountStruct))
			{
				throw new Win32Exception(Marshal.GetLastWin32Error(), "Error Initialising LED's");
			}

			m_count = (int)CountStruct.cLeds;
		}
示例#4
0
        public static int GetLedCount()
        {
            NLED_COUNT_INFO countInfo = new NLED_COUNT_INFO();
            int             LEDCount  = 0;

            if (NLedGetDeviceInfo(NLED_COUNT_INFO_ID, ref countInfo))
            {
                LEDCount = (int)countInfo.cLeds;
            }
            return(LEDCount);
        }
示例#5
0
        /// <summary>
        /// Initialise the LED collection
        /// </summary>
        public Led()
        {
            NLED_COUNT_INFO CountStruct = new NLED_COUNT_INFO();

            if (!NativeMethods.NLedGetDeviceCount(NLED_COUNT_INFO_ID, ref CountStruct))
            {
                throw new Win32Exception(Marshal.GetLastWin32Error(), "Error Initialising LED's");
            }

            m_count = (int)CountStruct.cLeds;
        }
示例#6
0
文件: LED.cs 项目: c70863721/PDA
        /// <summary>
        /// 获得LED个数
        /// </summary>
        public int GetLedCount()
        {
            int             wCount = 0;
            NLED_COUNT_INFO nci    = new NLED_COUNT_INFO();

            if (NLedGetDeviceInfo(NLED_COUNT_INFO_ID, nci))
            {
                wCount = nci.cLeds;
            }
            return(wCount);
        }
示例#7
0
        private static int GetLedCount()
        {
            int             count = 0;
            NLED_COUNT_INFO nci   = new NLED_COUNT_INFO();

            if (NLedGetDeviceInfo(NLED_COUNT_INFO_ID, nci))
            {
                count = nci.cLeds;
            }
            return(count);
        }
示例#8
0
    public static uint GetLedCount()
    {
        NLED_COUNT_INFO nci = new NLED_COUNT_INFO();

        uint LedCount = 0;

        if (NLedGetDeviceInfo(NLED_COUNT_INFO_ID, nci))
        {
            LedCount = nci.cLeds;
        }

        return(LedCount);
    }
示例#9
0
文件: Vibrate.cs 项目: xorkrus/vk_wm
        private static int GetVibrateLNum()
        {
            NLED_COUNT_INFO nci = new NLED_COUNT_INFO();
            int wCount = 0,
                VibrLed = 0;
            NLED_SUPPORTS_INFO sup = new NLED_SUPPORTS_INFO();
            if (NLedGetDeviceInfo(0, ref nci))
                wCount = (int)nci.cLeds;
            for (int i = wCount - 1; i > -1; i--)
            {
                sup.LedNum = (uint)i;
                NLedGetDeviceInfo(1, ref sup);

                if (sup.lCycleAdjust == -1)
                {
                    VibrLed = i;
                    break;
                }
            }
            return VibrLed;
        }
        public static void Vibrate( int time )
        {
            NLED_COUNT_INFO CountStruct = new NLED_COUNT_INFO();
            if( !NLedGetDeviceCount( NLED_COUNT_INFO_ID, ref CountStruct ) )
                throw new NotSupportedException( "Not supported in this device." );
            //Error Initialising LEDs

            uint m_count = CountStruct.cLeds;

            NLED_SETTINGS_INFO nsi = new NLED_SETTINGS_INFO();

            // vibrate on
            nsi.LedNum = m_count - 1;
            nsi.OffOnBlink = ( int )LedState.On;
            NLedSetDevice( 2, ref nsi );

            // sleep for specified time
            System.Threading.Thread.Sleep( time );

            // vibrate off
            nsi.OffOnBlink = ( int )LedState.Off;
            NLedSetDevice( 2, ref nsi );
        }
示例#11
0
文件: Vibrate.cs 项目: xorkrus/vk_wm
        private static int GetVibrateLNum()
        {
            NLED_COUNT_INFO nci     = new NLED_COUNT_INFO();
            int             wCount  = 0,
                            VibrLed = 0;
            NLED_SUPPORTS_INFO sup  = new NLED_SUPPORTS_INFO();

            if (NLedGetDeviceInfo(0, ref nci))
            {
                wCount = (int)nci.cLeds;
            }
            for (int i = wCount - 1; i > -1; i--)
            {
                sup.LedNum = (uint)i;
                NLedGetDeviceInfo(1, ref sup);

                if (sup.lCycleAdjust == -1)
                {
                    VibrLed = i;
                    break;
                }
            }
            return(VibrLed);
        }
示例#12
0
 private extern static bool NLedGetDeviceCount(short nID, ref NLED_COUNT_INFO pOutput);
示例#13
0
 private extern static bool NLedGetDeviceInfo(Int32 nID, NLED_COUNT_INFO nci);
示例#14
0
文件: Vibrate.cs 项目: xorkrus/vk_wm
 static extern bool NLedGetDeviceInfo(int nInfoId, ref NLED_COUNT_INFO info);
示例#15
0
文件: LED.cs 项目: c70863721/PDA
 extern static bool NLedGetDeviceInfo(uint nID, NLED_COUNT_INFO pOutput);
 static extern bool NLedGetDeviceCount( short nID, ref NLED_COUNT_INFO pOutput );
示例#17
0
 private static extern bool NLedGetDeviceInfo(uint h, ref NLED_COUNT_INFO pOutput);
示例#18
0
文件: Led.cs 项目: iseebi/EbIRC
 private static extern bool NLedGetDeviceInfo(uint h, ref NLED_COUNT_INFO pOutput);
示例#19
0
 // Methods
 public Led()
 {
     NLED_COUNT_INFO pOutput = new NLED_COUNT_INFO();
     if (!NativeMethods.NLedGetDeviceCount(0, ref pOutput))
     {
         throw new Win32Exception(Marshal.GetLastWin32Error(), "Error Initialising LED's");
     }
     this.m_count = (int)pOutput.cLeds;
 }
示例#20
0
文件: Vibrate.cs 项目: xorkrus/vk_wm
 extern static bool NLedGetDeviceInfo(int nInfoId, ref NLED_COUNT_INFO info);
            public static uint GetLedCount()
            {
                NLED_COUNT_INFO nci = new NLED_COUNT_INFO();

                uint LedCount = 0;

                if (NLedGetDeviceInfo(NLED_COUNT_INFO_ID, nci))
                    LedCount = nci.cLeds;

                return LedCount;
            }
 private extern static bool NLedGetDeviceInfo(Int32 nID, NLED_COUNT_INFO nci);