17 #include <core/dependencies.h>
19 #ifdef POK_NEEDS_MIDDLEWARE
20 #ifdef POK_NEEDS_BLACKBOARDS
23 #include <core/event.h>
24 #include <libc/string.h>
25 #include <middleware/blackboard.h>
28 extern char pok_blackboards_data[1024];
31 pok_ret_t pok_blackboard_read (
const pok_blackboard_id_t
id,
32 const uint64_t timeout,
37 if (
id > POK_CONFIG_NB_BLACKBOARDS)
39 return POK_ERRNO_EINVAL;
44 return POK_ERRNO_EINVAL;
47 if (pok_blackboards[
id].ready != TRUE)
49 return POK_ERRNO_EINVAL;
55 pok_event_lock (pok_blackboards[
id].lock);
57 memcpy (data, &pok_blackboards_data[pok_blackboards[
id].index], pok_blackboards[
id].size);
59 pok_event_unlock (pok_blackboards[
id].lock);
62 *len = pok_blackboards[id].size;