Import app manager, samples and test-tools

This commit is contained in:
wenyongh
2019-05-17 17:15:25 +08:00
parent b6e29e2153
commit dd5b133fa5
164 changed files with 21123 additions and 496 deletions

View File

@ -17,10 +17,10 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "lib-export.h"
#include "lib_export.h"
#ifdef WASM_ENABLE_BASE_LIB
#include "base-lib-export.h"
#include "base_lib_export.h"
#endif
static NativeSymbol extended_native_symbol_defs[] = {

View File

@ -17,7 +17,7 @@
#ifndef _BASE_LIB_EXPORT_H_
#define _BASE_LIB_EXPORT_H_
#include "attr-container.h"
#include "attr_container.h"
#include "native_interface.h"
#endif /* end of _BASE_LIB_EXPORT_H_ */

View File

@ -15,11 +15,11 @@
*/
#include "native_interface.h"
#include "app-manager-export.h"
#include "app_manager_export.h"
#include "coap_ext.h"
#include "wasm-export.h"
#include "wasm_export.h"
extern void module_request_handler(request_t *request, uint32 register_id);
extern void module_request_handler(request_t *request, void *user_data);
bool wasm_response_send(int32 buffer_offset, int size)
{

View File

@ -15,7 +15,7 @@
*/
#include "runtime_timer.h"
#include "app-manager-export.h"
#include "app_manager_export.h"
#include "module_wasm_app.h"
#include "bh_list.h"
#include "bh_thread.h"

View File

@ -15,7 +15,7 @@
*/
#include "runtime_sensor.h"
#include "app-manager-export.h"
#include "app_manager_export.h"
#include "module_wasm_app.h"
#include "bh_thread.h"
#include "bh_time.h"
@ -168,7 +168,7 @@ uint32 wasm_sensor_open(int32 name_offset, int instance)
memset(client, 0, sizeof(sensor_client_t));
client->client_id = mod_id;
client->client_callback = wasm_sensor_callback;
client->client_callback = (void *)wasm_sensor_callback;
client->interval = s->default_interval;
client->next = s->clients;
s->clients = client;

View File

@ -18,7 +18,7 @@
#define LIB_EXTENSION_RUNTIME_SENSOR_H_
#include "bh_platform.h"
#include "attr-container.h"
#include "attr_container.h"
struct _sys_sensor;
typedef struct _sys_sensor* sensor_obj_t;

View File

@ -18,9 +18,9 @@
#include "bh_queue.h"
#include "bh_thread.h"
#include "runtime_sensor.h"
#include "attr-container.h"
#include "attr_container.h"
#include "module_wasm_app.h"
#include "wasm-export.h"
#include "wasm_export.h"
/*
*
@ -99,11 +99,10 @@ static attr_container_t * read_test_sensor(void * sensor)
static bool config_test_sensor(void * s, void * config)
{
return false;
}
static void * thread_sensor_check(void * arg)
static void thread_sensor_check(void * arg)
{
while (1) {
int ms_to_expiry = check_sensor_timers();
@ -120,6 +119,8 @@ static void cb_wakeup_thread()
vm_cond_signal(&cond);
}
void set_sensor_reshceduler(void (*callback)());
void init_sensor_framework()
{
// init the mutext and conditions
@ -138,7 +139,7 @@ void init_sensor_framework()
wasm_register_cleanup_callback(sensor_cleanup_callback);
vm_thread_create(&tid, thread_sensor_check, NULL,
vm_thread_create(&tid, (void *)thread_sensor_check, NULL,
BH_APPLET_PRESERVED_STACK_SIZE);
}

View File

@ -14,8 +14,8 @@
* limitations under the License.
*/
#include "wasm-native.h"
#include "wasm-export.h"
#include "wasm_native.h"
#include "wasm_export.h"
#include "wasm_log.h"
#include "wasm_platform_log.h"
@ -903,7 +903,9 @@ wasm_native_func_lookup(const char *module_name, const char *func_name)
while (func_def < func_def_end) {
if (!strcmp(func_def->module_name, module_name)
&& !strcmp(func_def->func_name, func_name))
&& (!strcmp(func_def->func_name, func_name)
|| (func_def->func_name[0] == '_'
&& !strcmp(func_def->func_name + 1, func_name))))
return (void*) (uintptr_t) func_def->func_ptr;
func_def++;
}