Giter Site home page Giter Site logo

颜色 about comtool HOT 7 CLOSED

neutree avatar neutree commented on August 10, 2024
颜色

from comtool.

Comments (7)

Neutree avatar Neutree commented on August 10, 2024

应该是包被分割了,目前代码里面是从每个包检测颜色控制符,控制符被分割成两个包了,所以可以保证发送颜色控制符号的时间间隔不要太长来避免,有时间我优化下这个问题

from comtool.

QingHuanFerry avatar QingHuanFerry commented on August 10, 2024

你好,这边发现一个其他的问题,有时候串口的数据接收会接收不完整,
1650425809(1)
1650425790

from comtool.

Neutree avatar Neutree commented on August 10, 2024

丢数据应该不太可能 这部分功能应该挺可靠的,能用什么方法复现吗

from comtool.

QingHuanFerry avatar QingHuanFerry commented on August 10, 2024

对的,我弄错了,应该不是接收不到,而是没有显示出来,就是这个数据明明是一包一包发的,但是数据会连着下一包一起显示出来

from comtool.

Neutree avatar Neutree commented on August 10, 2024

接收代码在这里,

length = max(1, self.com.in_waiting)
data = self.com.read(length)
if data:
t = time.time()
if length == 1 and not buffer: # just start receive
buffer += data
continue
buffer += data
if buffer and (time.time() - t > 0.001): # no new data in 1ms
try:
self.onReceived(buffer)
except Exception as e:
print("-- error in onReceived callback:", e)
buffer = b''
, 可能还有可以优化缓冲区的处理

from comtool.

Neutree avatar Neutree commented on August 10, 2024

尝试修复了 fe37bf8 , 可以拉取最新代码试试

from comtool.

Neutree avatar Neutree commented on August 10, 2024

先关闭了,有问题再打开或者新建issue

from comtool.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.