winasd's Introduction
winasd's People
winasd's Issues
refactor bled
bled作为一个独立的service,应尽量满足如下要求:
- 可以作为singleton module,在winasd的任何位置直接require;
- handler应该subscribe,而不是启动时直接注入,可以不支持unsubscribe;
- updateAdv方法应该按照语义拆解;即分为bound status, sata status等;这样每个模块可以独立更新自己的相关逻辑;
- 所有adv字段和服务有缺省的返回,包括在启动时其他服务尚未注册的情况;
对于service,如果没有handler可以先返回Unavailable;对于值如果没有更新过,可以先返回0x00;我们在manufacturer的所有地方不定义0x00的值,用于bled表示null状态。
以上要求不是很急。主要收益是可以方便的搭建如下测试
test.js -> bled.js <----> linux / bluetoothctl
可以完全自动化完成关于bled的所有测试,包括在test里mock业务逻辑。在通讯层可以独立测试之后,内部模块的模块级自动测试就比较有价值了。
atecc counter read and inc
atecc读取和滚动counter时,有可能从stderr打印出错误。
从atecc-util源代码上看这不该是个错误。stderr打印来自
https://github.com/aidingnan/atecc-util/blob/bf01e95a3ad688ea2088bac5704bcbe6ca1b550e/util.c#L90
should_retry
函数的唯一调用位置在
它的逻辑是在发生retry的时候会在stderr打印出一行Attempts left: n
从源代码上理解,如果所有retry都失败,stdout会没有打印,stderr会连续打印
Attempts left: 3
Attempts left: 2
Attempts left: 1
Attempts left: 0
然后才会失败,实际结果只看到了Attempts left: 3
,意思是retry一次就成功了。
程序缺省的retry次数是3,可以通过-r
参数设定。
winasd升级程序的版本处理
rockbian从v1.1.14-beta.14版本开始,发布的rootfs文件,即rootfs.tar.zst文件,内部的/etc/version
已经定义为rockbian代码池使用的tag,@jowbba 写了自动化的release工具,从rockbian的github release创建s3和生产发布的镜像信息。
@CJackYang 需要修改相应的升级代码。
rootfs.tar.zst文件中的/etc/version可以直接提取,命令如下:
tar --extract --file rootfs.tar.zst --to-stdout ./etc/version
注意tar包内的路径前面有一个点(dot)。
设计要求如下:
-
@jowbba 的云端发布时需要检查这个内部的版本,必须和github release所描述的版本一致,如果不一致,视作错误,不可发布;
-
@CJackYang station下载之后也要检查这个版本和 @jowbba 提供的钉南云的release api的json内描述是否一致,如果不一致要拒绝使用。钉南云的api里的版本格式可能和rockbian不完全一致,包括前面的
v
前缀,和-
后面的annotation。这个 @jowbba 先问清楚 @juncaixinchi 那边有什么要求。最后确定的格式,即两者如何不一致,在这个issue的讨论里回复,作为最终设计。
Thank you all.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.