Skip to content

Commit cd4ddd8

Browse files
committed
update
1 parent 767f6dd commit cd4ddd8

File tree

3 files changed

+12
-18
lines changed

3 files changed

+12
-18
lines changed

clic.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include "MQTTClient.h"
1515

1616
#include "e4client.h"
17-
#include "e4persistent.h"
17+
#include "e4c_store.h"
1818
#include "sha3.h"
1919

2020
#define CLIC_QOS 0

e4c_store_file.c

+10-16
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,27 @@
1-
// e4cersistent.c
1+
// e4c_store_file.c
22
// 2018-07-06 Markku-Juhani O. Saarinen <[email protected]>
33

44
// (c) 2018 Copyright Teserakt AG
55

6-
// Persistent key storage.
6+
// Persistent key storage for POSIX devices. Really a toy version
7+
// intended for little embedded devices.
78

8-
#include <string.h>
9-
10-
#ifdef __AVR__
11-
#define E4C_TOPICS_MAX 5
12-
#else
139
#include <stdio.h>
1410
#include <sys/types.h>
1511
#include <sys/stat.h>
1612
#include <fcntl.h>
1713
#include <unistd.h>
1814
#include <stdlib.h>
19-
20-
#define E4C_TOPICS_MAX 100
21-
#endif
15+
#include <string.h>
2216

2317
#include "e4client.h"
24-
#include "e4persistent.h"
18+
#include "e4c_store.h"
2519
#include "sha3.h"
2620

2721
// number of topic keys
22+
23+
#define E4C_TOPICS_MAX 100
24+
2825
static int topic_keys_no = 0;
2926

3027
// This is the topic-key structure
@@ -36,6 +33,8 @@ typedef struct {
3633

3734
static topic_key_t topic_keys[E4C_TOPICS_MAX];
3835

36+
// Filename of the persistence file
37+
3938
static char *persistence_file = NULL;
4039

4140
// Initialize and check if persistent storage is valid. The path is
@@ -208,8 +207,6 @@ int e4c_set_topic_key(const uint8_t *topic_hash, const uint8_t *key)
208207
return e4c_sync();
209208
}
210209

211-
#ifndef __AVR__
212-
213210
void e4c_debug_dumpkeys()
214211
{
215212
int i, j;
@@ -224,6 +221,3 @@ void e4c_debug_dumpkeys()
224221
printf("\n");
225222
}
226223
}
227-
228-
#endif
229-

e4client.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#endif
1010

1111
#include "e4client.h"
12-
#include "e4persistent.h"
12+
#include "e4c_store.h"
1313

1414
#include "sha3.h"
1515
#include "aes_siv.h"

0 commit comments

Comments
 (0)