Skip to content

Commit 5ddd2c5

Browse files
committed
change api prefix
1 parent 5183d24 commit 5ddd2c5

File tree

5 files changed

+67
-21
lines changed

5 files changed

+67
-21
lines changed

examples/Uno_and_above/Uno_and_above.ino

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,23 @@ File myFile;
2929

3030
#define SD_CS_PIN 8
3131

32-
int32_t read_fn(struct uls_write_context *ctx, void *buf, uint32_t pos, size_t len) {
32+
int32_t read_fn(struct dblog_write_context *ctx, void *buf, uint32_t pos, size_t len) {
3333
myFile.seek(pos);
3434
size_t ret = myFile.read((byte *)buf, len);
3535
if (ret != len)
3636
return ULS_RES_READ_ERR;
3737
return ret;
3838
}
3939

40-
int32_t write_fn(struct uls_write_context *ctx, void *buf, uint32_t pos, size_t len) {
40+
int32_t write_fn(struct dblog_write_context *ctx, void *buf, uint32_t pos, size_t len) {
4141
myFile.seek(pos);
4242
size_t ret = myFile.write((byte *)buf, len);
4343
if (ret != len)
4444
return ULS_RES_ERR;
4545
return ret;
4646
}
4747

48-
int flush_fn(struct uls_write_context *ctx) {
48+
int flush_fn(struct dblog_write_context *ctx) {
4949
myFile.flush();
5050
return ULS_RES_OK;
5151
}
@@ -129,33 +129,33 @@ void loop() {
129129

130130
// if the file opened okay, write to it:
131131
if (myFile) {
132-
struct uls_write_context ctx;
132+
struct dblog_write_context ctx;
133133
ctx.buf = buf;
134134
ctx.col_count = 6;
135135
ctx.page_size_exp = 9;
136136
ctx.max_pages_exp = 0;
137137
ctx.read_fn = read_fn;
138138
ctx.flush_fn = flush_fn;
139139
ctx.write_fn = write_fn;
140-
int res = uls_write_init(&ctx);
140+
int res = dblog_write_init(&ctx);
141141
if (!res) {
142142
while (num_entries--) {
143143
for (int i = 0; i < 6; i++) {
144144
int val = analogRead(A0 + i);
145-
res = uls_set_col_val(&ctx, i, ULS_TYPE_INT, &val, sizeof(int));
145+
res = dblog_set_col_val(&ctx, i, ULS_TYPE_INT, &val, sizeof(int));
146146
if (res)
147147
break;
148148
}
149149
if (num_entries) {
150-
res = uls_append_empty_row(&ctx);
150+
res = dblog_append_empty_row(&ctx);
151151
if (res)
152152
break;
153153
delay(dly);
154154
}
155155
}
156156
}
157157
if (!res)
158-
res = uls_finalize(&ctx);
158+
res = dblog_finalize(&ctx);
159159
myFile.close();
160160
if (res) {
161161
Serial.print(F("Err:"));

examples/Uno_and_above_Binary_Search/Uno_and_above_Binary_Search.ino

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,25 +29,25 @@ File myFile;
2929

3030
#define SD_CS_PIN 8
3131

32-
int32_t read_fn(struct uls_write_context *ctx, void *buf, uint32_t pos, size_t len) {
32+
int32_t read_fn(struct dblog_write_context *ctx, void *buf, uint32_t pos, size_t len) {
3333
myFile.seek(pos);
3434
size_t ret = myFile.read((byte *)buf, len);
3535
if (ret != len)
36-
return ULS_RES_READ_ERR;
36+
return DBLOG_RES_READ_ERR;
3737
return ret;
3838
}
3939

40-
int32_t write_fn(struct uls_write_context *ctx, void *buf, uint32_t pos, size_t len) {
40+
int32_t write_fn(struct dblog_write_context *ctx, void *buf, uint32_t pos, size_t len) {
4141
myFile.seek(pos);
4242
size_t ret = myFile.write((byte *)buf, len);
4343
if (ret != len)
44-
return ULS_RES_ERR;
44+
return DBLOG_RES_ERR;
4545
return ret;
4646
}
4747

48-
int flush_fn(struct uls_write_context *ctx) {
48+
int flush_fn(struct dblog_write_context *ctx) {
4949
myFile.flush();
50-
return ULS_RES_OK;
50+
return DBLOG_RES_OK;
5151
}
5252

5353
int input_string(char *str, int max_len) {
@@ -129,33 +129,33 @@ void loop() {
129129

130130
// if the file opened okay, write to it:
131131
if (myFile) {
132-
struct uls_write_context ctx;
132+
struct dblog_write_context ctx;
133133
ctx.buf = buf;
134134
ctx.col_count = 6;
135135
ctx.page_size_exp = 9;
136136
ctx.max_pages_exp = 0;
137137
ctx.read_fn = read_fn;
138138
ctx.flush_fn = flush_fn;
139139
ctx.write_fn = write_fn;
140-
int res = uls_write_init(&ctx);
140+
int res = dblog_write_init(&ctx);
141141
if (!res) {
142142
while (num_entries--) {
143143
for (int i = 0; i < 6; i++) {
144144
int val = analogRead(A0 + i);
145-
res = uls_set_col_val(&ctx, i, ULS_TYPE_INT, &val, sizeof(int));
145+
res = dblog_set_col_val(&ctx, i, DBLOG_TYPE_INT, &val, sizeof(int));
146146
if (res)
147147
break;
148148
}
149149
if (num_entries) {
150-
res = uls_append_empty_row(&ctx);
150+
res = dblog_append_empty_row(&ctx);
151151
if (res)
152152
break;
153153
delay(dly);
154154
}
155155
}
156156
}
157157
if (!res)
158-
res = uls_finalize(&ctx);
158+
res = dblog_finalize(&ctx);
159159
myFile.close();
160160
if (res) {
161161
Serial.print(F("Err:"));

keywords.txt

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#######################################
2+
# Syntax Coloring Map
3+
#######################################
4+
5+
#######################################
6+
# Datatypes (KEYWORD1)
7+
#######################################
8+
9+
dblog_write_context KEYWORD1
10+
dblog_read_context KEYWORD1
11+
12+
#######################################
13+
# Methods and Functions (KEYWORD2)
14+
#######################################
15+
dblog_write_init KEYWORD2
16+
dblog_write_init_with_script KEYWORD2
17+
dblog_init_for_append KEYWORD2
18+
dblog_append_empty_row KEYWORD2
19+
dblog_append_row_with_values KEYWORD2
20+
dblog_set_col_val KEYWORD2
21+
dblog_get_col_val KEYWORD2
22+
dblog_flush KEYWORD2
23+
dblog_partial_finalize KEYWORD2
24+
dblog_finalize KEYWORD2
25+
dblog_not_finalized KEYWORD2
26+
dblog_read_page_size KEYWORD2
27+
dblog_recover KEYWORD2
28+
29+
dblog_read_init KEYWORD2
30+
dblog_cur_row_col_count KEYWORD2
31+
dblog_read_col_val KEYWORD2
32+
dblog_derive_data_len KEYWORD2
33+
dblog_read_first_row KEYWORD2
34+
dblog_read_next_row KEYWORD2
35+
dblog_read_prev_row KEYWORD2
36+
dblog_read_last_row KEYWORD2
37+
dblog_srch_row_by_id KEYWORD2
38+
dblog_bin_srch_row_by_val KEYWORD2
39+
40+
######################################
41+
# Constants (LITERAL1)
42+
#######################################
43+
DBLOG_TYPE_INT LITERAL1
44+
DBLOG_TYPE_REAL LITERAL1
45+
DBLOG_TYPE_BLOB LITERAL1
46+
DBLOG_TYPE_TEXT LITERAL1

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ maintainer=Arun <[email protected]>
55
sentence=Log data into Sqlite database from any MCU having >2kb RAM
66
paragraph=This is a general purpose library that enables logging data into Sqlite databases from any Microcontroller having atleast 2kb RAM. This is useful to log Sensor data into Micro SD cards or inbuilt flash file systems. Multiple databases can be logged at the same time and transferred over the network for further processing. See documentation for further details and limitations.
77
category=Data Storage
8-
url=https://github.com/siara-in/sqlite_micro_logger
8+
url=https://github.com/siara-in/sqlite_micro_logger_arduino
99
architectures=*

src

Submodule src updated from cd369bd to e579721

0 commit comments

Comments
 (0)