This commit is contained in:
JasonYANG170 2024-04-18 15:32:28 +08:00
parent 1e968fb814
commit f1f42f31a5

View File

@ -22,7 +22,8 @@
#include <FS.h> #include <FS.h>
#include "SD.h" #include "SD.h"
//配置数据结构 //配置数据结构
String keySize=""; int callbacktimes;
int keySize;
const int siteSize = 5; const int siteSize = 5;
String site[siteSize]; String site[siteSize];
struct key { struct key {
@ -34,6 +35,7 @@ const char* data = "Callback function called";
static int callback(void *data, int argc, char **argv, char **azColName){ static int callback(void *data, int argc, char **argv, char **azColName){
int i; int i;
Serial.printf("%s: ", (const char*)data); Serial.printf("%s: ", (const char*)data);
callbacktimes++;
for (i = 0; i<argc; i++){ for (i = 0; i<argc; i++){
// 初始化一个空的字符串 // 初始化一个空的字符串
String outputString = ""; String outputString = "";
@ -48,6 +50,7 @@ static int callback(void *data, int argc, char **argv, char **azColName){
// 现在outputString包含了格式化后的字符串 // 现在outputString包含了格式化后的字符串
Serial.println(outputString); Serial.println(outputString);
} }
Serial.printf("\n"); Serial.printf("\n");
return 0; return 0;
} }
@ -102,6 +105,9 @@ void setup() {
return; return;
} }
Serial.println("All Have Data Times:");
Serial.println(callbacktimes);
callbacktimes=0;
rc = db_exec(db1, "SELECT * FROM key;"); rc = db_exec(db1, "SELECT * FROM key;");
if (rc != SQLITE_OK) { if (rc != SQLITE_OK) {
@ -110,7 +116,9 @@ void setup() {
return; return;
} }
Serial.println("All Have Data Times2:");
Serial.println(callbacktimes);
callbacktimes=0;
sqlite3_close(db1); sqlite3_close(db1);