Skip to content

Disposing modem times out because of data in serial port #62

@AfmanS

Description

@AfmanS

I just started using this library, I converted a .NET Framework 4.8 app I had from that used GsmComm. I'm loving it so far. I did have one problem: after I created a modem, disposing it would hang the task unless I ran serialPort.DiscardInBuffer(); first. I wrote a class around the modem so it would run this everytime, but it feels like something AtLib could handle itself:

public async Task CloseAsync()
{
    if (_serialPort?.IsOpen == true)
    {
        _serialPort.DiscardInBuffer();
    }
    _modem?.Dispose();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions