imabot2/serialib

cannot close serail port

SJavad opened this issue · 0 comments

i run this code:

int main()
{
    serialib serial;

    if (serial.openDevice("\\\\.\\COM10", 115200)!=1){
        
        cout << "COM Port Does not opened";
        return 1;

    }

    for (int c = 32; c < 128; c++)
    {
        cout << "CHAR: " << c ;
        serial.writeChar(c);
        Sleep(100);
    }

    serial.closeDevice();
    cout << "Send Complete...";
    return 0;
    
}

and when i want to close my port I get exception:
Screenshot 2023-09-12 201622