Linux Demo 用 C 标准文件库代替 POSIX 文件库后,编译出来的可执行文件运行后,Log 显示插入的时间,温度和湿度数据有误:
[FlashDB][tsl][log][fdb_tsdb1] Sector (0x00000000) header info is incorrect.
[FlashDB][tsl][log][fdb_tsdb1] All sector format finished.
[FlashDB][tsl][log][fdb_tsdb1] (../../src/fdb_tsdb.c:945) TSDB (log) oldest sectors is 0x00000000, current using sector is 0x00000000.
[FlashDB] FlashDB V2.0.0 is initialize success.
[FlashDB] You can get the latest version on https://github.com/armink/FlashDB .
[FlashDB][sample][tsdb] ==================== tsdb_sample ====================
[FlashDB][sample][tsdb] append the new status.temp (36) and status.humi (85)
[FlashDB][sample][tsdb] append the new status.temp (38) and status.humi (90)
[FlashDB][sample][tsdb] [query_cb] queried a TSL: time: 0, temp: 2110953342, humi: 21989
[FlashDB][sample][tsdb] [query_by_time_cb] queried a TSL: time: 0, temp: 2110953342, humi: 21989
[FlashDB][sample][tsdb] query count is: 0
[FlashDB][sample][tsdb] set the TSL (time 0) status from 1 to 3
[FlashDB][sample][tsdb] ===========================================================
使用旧的 commit 发现没有这个问题,读出来的温湿度数据正常:
[FlashDB][tsl][log] Sector (0x00000000) header info is incorrect.
[FlashDB][tsl][log] All sector format finished.
[FlashDB][tsl][log] (../../src/fdb_tsdb.c:940) TSDB (log) oldest sectors is 0x00000000, current using sector is 0x00000000.
[FlashDB] FlashDB V1.2.0 is initialize success.
[FlashDB] You can get the latest version on https://github.com/armink/FlashDB .
[FlashDB][sample][tsdb] ==================== tsdb_sample ====================
[FlashDB][sample][tsdb] append the new status.temp (36) and status.humi (85)
[FlashDB][sample][tsdb] append the new status.temp (38) and status.humi (90)
[FlashDB][sample][tsdb] [query_cb] queried a TSL: time: 1686572803, temp: 36, humi: 85
[FlashDB][sample][tsdb] [query_cb] queried a TSL: time: 1686572803, temp: 38, humi: 90
[FlashDB][sample][tsdb] query count is: 0
[FlashDB][sample][tsdb] set the TSL (time 1686572803) status from 2 to 3
[FlashDB][sample][tsdb] set the TSL (time 1686572803) status from 2 to 3
[FlashDB][sample][tsdb] ===========================================================
问题描述
Linux Demo 用 C 标准文件库代替 POSIX 文件库后,编译出来的可执行文件运行后,Log 显示插入的时间,温度和湿度数据有误:
使用旧的 commit 发现没有这个问题,读出来的温湿度数据正常:
复现步骤
demos/linux/applications/fdb_cfg.h
的FDB_USING_FILE_POSIX_MODE
修改为FDB_USING_FILE_LIBC_MODE
Reset 到一个更老的 commit a39f4e2ed6c0d68fbd35f449f01725b9795809bd 上再重新执行上述步骤就没有再复现该问题,我就没有再进一步追查这个问题了。
测试环境