Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
DrBomb committed May 27, 2019
0 parents commit b65205c
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 0 deletions.
1 change: 1 addition & 0 deletions fs/init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
load('api_timer.js');
3 changes: 3 additions & 0 deletions fs/jstore.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{"items":[
["item", ],
]}
27 changes: 27 additions & 0 deletions mos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
author: Juan
description: Reproduction of a JStore crash due to invalid file structure
arch: esp32
version: 1.0
manifest_version: 2017-05-18

tags:
- js
- c

sources:
- src

filesystem:
- fs

libs:
- origin: https://github.com/mongoose-os-libs/ca-bundle
- origin: https://github.com/mongoose-os-libs/rpc-service-config
- origin: https://github.com/mongoose-os-libs/rpc-service-fs
- origin: https://github.com/mongoose-os-libs/rpc-uart
- origin: https://github.com/mongoose-os-libs/sntp
- origin: https://github.com/mongoose-os-libs/wifi
- origin: https://github.com/mongoose-os-libs/mjs
- origin: https://github.com/mongoose-os-libs/ota-shadow
- origin: https://github.com/mongoose-os-libs/mbedtls
- origin: https://github.com/mongoose-os-libs/jstore
11 changes: 11 additions & 0 deletions mos_esp32.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
libs:
- origin: https://github.com/mongoose-os-libs/i2c
- origin: https://github.com/mongoose-os-libs/pwm
- origin: https://github.com/mongoose-os-libs/rpc-loopback
- origin: https://github.com/mongoose-os-libs/rpc-mqtt
- origin: https://github.com/mongoose-os-libs/rpc-service-gpio
- origin: https://github.com/mongoose-os-libs/rpc-service-i2c
- origin: https://github.com/mongoose-os-libs/rpc-service-ota
- origin: https://github.com/mongoose-os-libs/rpc-service-wifi
- origin: https://github.com/mongoose-os-libs/spi
- origin: https://github.com/mongoose-os-libs/vfs-dev-spi-flash
15 changes: 15 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include "mgos.h"
#include "mgos_jstore.h"

enum mgos_app_init_result mgos_app_init(void) {
char *error;
struct mgos_jstore *store = mgos_jstore_create("jstore.json", &error);
if(store == NULL){
LOG(LL_ERROR, ("JSTORE FAILED TO CREATE!"));
if(error != NULL){
LOG(LL_ERROR, ("Error: %s", error));
}
}
mgos_jstore_free(store);
return MGOS_APP_INIT_SUCCESS;
}

0 comments on commit b65205c

Please sign in to comment.