processing / processing/processing4

Serial.list() doesn't update items after a port gets disconnected

未关闭
#1,258 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Java
星标
497
派生
183
平均合并
4 小时 39 分钟
30 天内合并 PR
3

描述

Issue description

if conncted to a port say "COM5". if "COM5" is disconncted for any reason, the serial.list() will still show that "COM5" exists even if connction is stopped using serial.stop() after getting "COM5" device disconncted.

again, if conncted to port "COM5" for instance, if connection is stopped using serial.stop() and then if "COM5" device is disconnceted, serial.list() will then update its element and "COM5" isn't there anymore. which is a normal behavior.

test code to varify this issue

import processing.serial.*;
 Serial comPort;

void setup() {
  size(500, 400);
  surface.setTitle("TEST");    
  comPort = new Serial(this, "COM5", 115200);
  background(150);
  frameRate(60);
}

void draw() {
  background(150);  
  println(Serial.list().length);  
}

check for number of serial ports exists first and then try disconncting the device
Serial.list().length will still show that port was not removed...

URL(s) of affected page(s)
Proposed fix

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先,使用提供的 Processing sketch 和 Serial.list() 入口点重现问题,同时在连接处于活动状态时断开 COM5。跟踪串行库如何发现并刷新端口;当 Serial.list() 不再包含已断开的端口且无需调用 serial.stop() 时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
java
领域
desktop
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。