日期:2014-05-17 浏览次数:21437 次
private void CloseJoystickerRightport()
{
try
{
while (JoystickerLexium23dPort.IsOpen)
{
joyStickRightPortKeepReading = false;
JoystickerLexium23dPort.DataReceived -= new SerialDataReceivedEventHandler(JoystickerRightport_DataReceived);
JoystickerLexium23dPort.DiscardOutBuffer();
JoystickerLexium23dPort.DiscardInBuffer();
JoystickerLexium23dPort.Close();
}
}
catch (System.Exception ex)
{
writeExceptionToLogFile("CloseXYZJoystickRightport", ex.Message);
}
}
private void OpenJoystickRightPot()
{
try
{
//if (JoystickerLexium23dPort.IsOpen)
//{
while (JoystickerLexium23dPort.IsOpen) JoystickerLexium23dPort.Close();
if (!JoystickerLexium23dPort.IsOpen) JoystickerLexium23dPort.Open();
//}
//else
//{
// JoystickerLexium23dPort.Open();
//}