1919#include "ocre_api.h"
2020#include "../ocre_timers/ocre_timer.h"
2121#include "../ocre_sensors/ocre_sensors.h"
22+ #include "../ocre_gpio/ocre_gpio.h"
23+ #include "../container_messaging/messaging.h"
2224
2325int _ocre_posix_uname (wasm_exec_env_t exec_env , struct _ocre_posix_utsname * name ) {
2426 struct utsname info ;
@@ -82,6 +84,15 @@ NativeSymbol ocre_api_table[] = {
8284
8385 {"ocre_sleep" , ocre_sleep , "(i)i" , NULL },
8486
87+ // Container Messaging API
88+ #ifdef CONFIG_OCRE_CONTAINER_MESSAGING
89+ {"ocre_msg_system_init" , ocre_msg_system_init , "()" , NULL },
90+ {"ocre_publish_message" , ocre_publish_message , "(***i)i" , NULL },
91+ {"ocre_subscribe_message" , ocre_subscribe_message , "(**)i" , NULL },
92+ #endif
93+
94+ // Sensor API
95+ #ifdef CONFIG_OCRE_SENSORS
8596 // Sensor API
8697 {"ocre_sensors_init" , ocre_sensors_init , "()i" , NULL },
8798 {"ocre_sensors_discover" , ocre_sensors_discover , "()i" , NULL },
@@ -90,7 +101,7 @@ NativeSymbol ocre_api_table[] = {
90101 {"ocre_sensors_get_channel_count" , ocre_sensors_get_channel_count , "(i)i" , NULL },
91102 {"ocre_sensors_get_channel_type" , ocre_sensors_get_channel_type , "(ii)i" , NULL },
92103 {"ocre_sensors_read" , ocre_sensors_read , "(ii)i" , NULL },
93-
104+ #endif
94105 // Timer API
95106 {"ocre_timer_create" , ocre_timer_create , "(i)i" , NULL },
96107 {"ocre_timer_start" , ocre_timer_start , "(iii)i" , NULL },
@@ -99,6 +110,16 @@ NativeSymbol ocre_api_table[] = {
99110 {"ocre_timer_get_remaining" , ocre_timer_get_remaining , "(i)i" , NULL },
100111 {"ocre_timer_set_dispatcher" , ocre_timer_set_dispatcher , "(i)v" , NULL },
101112
113+ #ifdef CONFIG_OCRE_GPIO
114+ // GPIO API
115+ {"ocre_gpio_init" , ocre_gpio_wasm_init , "()i" , NULL },
116+ {"ocre_gpio_configure" , ocre_gpio_wasm_configure , "(iii)i" , NULL },
117+ {"ocre_gpio_set" , ocre_gpio_wasm_set , "(iii)i" , NULL },
118+ {"ocre_gpio_get" , ocre_gpio_wasm_get , "(ii)i" , NULL },
119+ {"ocre_gpio_toggle" , ocre_gpio_wasm_toggle , "(ii)i" , NULL },
120+ {"ocre_gpio_register_callback" , ocre_gpio_wasm_register_callback , "(ii)i" , NULL },
121+ {"ocre_gpio_unregister_callback" , ocre_gpio_wasm_unregister_callback , "(ii)i" , NULL },
122+ #endif
102123};
103124
104125int ocre_api_table_size = sizeof (ocre_api_table ) / sizeof (NativeSymbol );
0 commit comments