File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 20
20
#include < string.h>
21
21
#include " KVStore.h"
22
22
#include " kvstore_global_api.h"
23
+ #include " DeviceKey.h"
23
24
24
25
using namespace mbed ;
25
26
26
27
#define EXAMPLE_KV_VALUE_LENGTH 64
27
28
#define EXAMPLE_KV_KEY_LENGTH 32
28
29
#define err_code (res ) MBED_GET_ERROR_CODE(res)
29
30
31
+ #define STR_EXPAND (tok ) #tok
32
+ #define STR (tok ) STR_EXPAND(tok)
33
+
30
34
void kv_store_global_api_example ();
31
35
32
36
int main ()
@@ -59,6 +63,11 @@ void kv_store_global_api_example()
59
63
res = kv_reset (" /kv/" );
60
64
printf (" kv_reset -> %d\n " , err_code (res));
61
65
66
+ if (strcmp (STR (MBED_CONF_STORAGE_STORAGE_TYPE), " TDB_EXTERNAL" ) == 0 ) {
67
+ res = DeviceKey::get_instance ().generate_root_of_trust ();
68
+ printf (" DeviceKey::get_instance().generate_root_of_trust() -> %d\n " , res);
69
+ }
70
+
62
71
/* Set First 'Dummy' Key/Value pair with unprotected clear value data */
63
72
printf (" kv_set first dummy key\n " );
64
73
res = kv_set (kv_key_in, kv_value_in, strlen (kv_value_in), 0 );
You can’t perform that action at this time.
0 commit comments