/// <summary> /// 获取主键盘LED灯状态 /// </summary> /// <param name="ledNumber">键盘灯编号 0 1 2</param> /// <returns></returns> public byte GetMainKeyboardLedStatus(int ledNumber) { if (!sdk_init_main_once) { return(0); } UInt32 LastErrCode; byte ledStatus; switch (ledNumber) { case 0: //LED 1 LastErrCode = POC_API.poc_get_led_status(POC_API.POC_KEYBOARD_PID, POC_API.led_enum.POC_LED_PIN1, out ledStatus); if (LastErrCode != POC_API.POC_ERR_NO_ERROR) { //弹框 Console.WriteLine("Fails to get HIT_LED_PIN 1, " + LastErrCode.ToString("X8")); } break; case 1: //LED 2 LastErrCode = POC_API.poc_get_led_status(POC_API.POC_KEYBOARD_PID, POC_API.led_enum.POC_LED_PIN2, out ledStatus); if (LastErrCode != POC_API.POC_ERR_NO_ERROR) { //弹框 Console.WriteLine("Fails to get HIT_LED_PIN 2, " + LastErrCode.ToString("X8")); } break; case 2: //LED 3 LastErrCode = POC_API.poc_get_led_status(POC_API.POC_KEYBOARD_PID, POC_API.led_enum.POC_LED_PIN3, out ledStatus); if (LastErrCode != POC_API.POC_ERR_NO_ERROR) { //弹框 Console.WriteLine("Fails to get HIT_LED_PIN 3, " + LastErrCode.ToString("X8")); } break; default: ledStatus = 0; break; } return(ledStatus); }
/// <summary> /// 获取第二键盘LED灯状态 /// </summary> /// <param name="ledNumber">0 1 2 3 4 5</param> /// <returns></returns> public byte GetSecondKeyboardLedStatus(int ledNumber) { if (!sdk_init_second_once) { return(0); } UInt32 LastErrCode; byte ledStatus; switch (ledNumber) { case 0: //LED 1 LastErrCode = POC_API.poc_get_led_status(POC_API.POC_KEYBOARD_PID_SECOND, POC_API.led_enum.POC_LED_PIN1, out ledStatus); if (LastErrCode != POC_API.POC_ERR_NO_ERROR) { //弹框 Console.WriteLine("Fails to get HIT_LED_PIN 1, " + LastErrCode.ToString("X8")); } break; case 1: //LED 2 LastErrCode = POC_API.poc_get_led_status(POC_API.POC_KEYBOARD_PID_SECOND, POC_API.led_enum.POC_LED_PIN2, out ledStatus); if (LastErrCode != POC_API.POC_ERR_NO_ERROR) { //弹框 Console.WriteLine("Fails to get HIT_LED_PIN 2, " + LastErrCode.ToString("X8")); } break; case 2: //LED 3 LastErrCode = POC_API.poc_get_led_status(POC_API.POC_KEYBOARD_PID_SECOND, POC_API.led_enum.POC_LED_PIN3, out ledStatus); if (LastErrCode != POC_API.POC_ERR_NO_ERROR) { //弹框 Console.WriteLine("Fails to get HIT_LED_PIN 3, " + LastErrCode.ToString("X8")); } break; case 3: //LED 4 LastErrCode = POC_API.poc_get_led_status(POC_API.POC_KEYBOARD_PID_SECOND, POC_API.led_enum.POC_LED_PIN4, out ledStatus); if (LastErrCode != POC_API.POC_ERR_NO_ERROR) { //弹框 Console.WriteLine("Fails to get HIT_LED_PIN 4, " + LastErrCode.ToString("X8")); } break; case 4: //LED 5 LastErrCode = POC_API.poc_get_led_status(POC_API.POC_KEYBOARD_PID_SECOND, POC_API.led_enum.POC_LED_PIN5, out ledStatus); if (LastErrCode != POC_API.POC_ERR_NO_ERROR) { //弹框 Console.WriteLine("Fails to get HIT_LED_PIN 5, " + LastErrCode.ToString("X8")); } break; case 5: //LED 6 LastErrCode = POC_API.poc_get_led_status(POC_API.POC_KEYBOARD_PID_SECOND, POC_API.led_enum.POC_LED_PIN6, out ledStatus); if (LastErrCode != POC_API.POC_ERR_NO_ERROR) { //弹框 Console.WriteLine("Fails to get HIT_LED_PIN 6, " + LastErrCode.ToString("X8")); } break; default: ledStatus = 0; break; } //if (ledStatus == 1) //{ // SecondKeyBoardArr[ledNumber] = true; //} return(ledStatus); }