Stream::find() not working for values above 0x7F
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 25/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- cpp
- 领域
- api, embedded-iot
调研方向
检查 Stream::find() 和相关的 findUntil() 入口点,并使用包含 0xff 的 uint8_t 序列重现报告中的不匹配。确认对大于 0x7F 的值的预期处理方式,然后验证匹配在所有受影响的函数中都能一致工作,并确认已打开的 pull request 尚未解决该问题。
由索引模型根据 Issue 内容生成。
描述
I found out that the Stream::find() (and all related functions, findUntil() etc), does not work when the sequence to be found contains values above 0x7F. I believe this is because the function uses char instead of uint8_t.
Example, using these definitions:
char a = 0xff;
uint8_t b = 0xff;
a == b is false, and therefore the find() method does not return a match when supplied a uint8_t[] array containing values above 0x7F, since the array gets casted to char. Changing the declaration of find() to uint8_t should solve the issue.
I don't know if ignoring values above 0x7F is the intended behaviour, but if that is the case I think the documentation should be more specific and explain this case better. In any case, if the current behaviour is the intended one, i do not see the reason behind it.
First time reporting something on Arduino, sorry if I overlooked something obvious.
- 主要语言
- C++
- 星标
- 307
- 派生
- 152
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
arduino/ArduinoCore-API 的其他 Issue
-
Bit manipulation not working with 64 bit values可能已有人在做 @asumo-1xts 于 41 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 25/100
arduino/ArduinoCore-API#261 ·
-
Missing virtual destructor for `Print` class可能已有人在做 @andreagilardoni 于 1109 天前认领。 未关闭bug
难度 1/5 1 小时以内 新手友好度 30/100
arduino/ArduinoCore-API#256 ·
-
enhancement
难度 3/5 1-2 天 新手友好度 48/100
arduino/ArduinoCore-API#251 · 1 条评论 ·
-
Use modern C++ casts instead of current C-style casting approaches可能已有人在做 @anotherSimpleCoder 于 311 天前认领。 未关闭enhancement
难度 4/5 3-5 天 新手友好度 35/100
arduino/ArduinoCore-API#250 ·
-
Always true condition in IPAddress string-to-ipv6 conversion可能已有人在做 @pruthvi828 于 18 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 45/100
arduino/ArduinoCore-API#249 ·
查看 arduino/ArduinoCore-API 的全部 Issue
相似的 Issue
-
upstream update
难度 2/5 1-3 小时 新手友好度 65/100
conan-io/conan-center-index#31142 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 84/100
NVIDIA/DeepStream#78 ·