sdk build tools and app framework updates (#171)
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
#include "lib_export.h"
|
||||
#include "sensor_api.h"
|
||||
#include "connection_api.h"
|
||||
#include "sensor_native_api.h"
|
||||
#include "timer_native_api.h"
|
||||
#include "req_resp_native_api.h"
|
||||
#include "connection_native_api.h"
|
||||
|
||||
static NativeSymbol extended_native_symbol_defs[] = {
|
||||
#include "runtime_sensor.inl"
|
||||
|
||||
@ -354,6 +354,29 @@ static host_interface interface = { .send = uart_send, .destroy = uart_destroy }
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
static attr_container_t * read_test_sensor(void * sensor)
|
||||
{
|
||||
//luc: for test
|
||||
attr_container_t *attr_obj = attr_container_create("read test sensor data");
|
||||
if (attr_obj) {
|
||||
bool ret = attr_container_set_string(&attr_obj, "name", "read test sensor");
|
||||
if (!ret) {
|
||||
attr_container_destroy(attr_obj);
|
||||
return NULL;
|
||||
}
|
||||
return attr_obj;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static bool config_test_sensor(void * s, void * config)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
static char global_heap_buf[1024 * 1024] = { 0 };
|
||||
|
||||
static void showUsage()
|
||||
@ -458,15 +481,34 @@ int iwasm_main(int argc, char *argv[])
|
||||
goto fail1;
|
||||
}
|
||||
|
||||
//
|
||||
// timer manager
|
||||
//
|
||||
init_wasm_timer();
|
||||
|
||||
|
||||
//
|
||||
// connection framework
|
||||
//
|
||||
if (!init_connection_framework()) {
|
||||
vm_thread_sys_destroy();
|
||||
goto fail1;
|
||||
}
|
||||
|
||||
//
|
||||
// sensor framework
|
||||
//
|
||||
init_sensor_framework();
|
||||
// add the sys sensor objects
|
||||
add_sys_sensor("sensor_test",
|
||||
"This is a sensor for test",
|
||||
0,
|
||||
1000,
|
||||
read_test_sensor,
|
||||
config_test_sensor);
|
||||
start_sensor_framework();
|
||||
|
||||
|
||||
// timer manager
|
||||
init_wasm_timer();
|
||||
|
||||
#ifndef CONNECTION_UART
|
||||
if (server_mode)
|
||||
|
||||
Reference in New Issue
Block a user