亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? sys_module.h

?? 嵌入式操作系統內核
?? H
?? 第 1 頁 / 共 2 頁
字號:
/** * \mainpage [SOS System API] * * Provided here is the documentation for the system API provided by the SOS * kernel for user modules. * * The link below will take you back to the main SOS documentation website: * * https://projects.nesl.ucla.edu/public/sos-2x/ */#ifndef __SYS_MODULE_H__#define __SYS_MODULE_H__#ifndef _MODULE_#include <sos.h>#endif#include <sos_info.h>#include <sos_types.h>#include <sos_module_types.h>#include <sos_timer.h>#include <pid.h>#include <stddef.h>#include <kertable_conf.h>  // for get_kertable_entry()#include <sos_error_types.h>#include <codemem.h>#ifndef SYS_JUMP_TBL_START/// \cond NOTYPEDEFvoid* ker_sys_malloc(uint16_t size);void* ker_sys_realloc(void* pntr, uint16_t newSize);void ker_sys_free(void *pntr);void* ker_sys_msg_take_data(Message *msg);int8_t ker_sys_timer_start(uint8_t tid, int32_t interval, uint8_t type);int8_t ker_sys_timer_restart(uint8_t tid, int32_t interval);int8_t ker_sys_timer_stop(uint8_t tid);int8_t ker_sys_post(sos_pid_t did, uint8_t type, uint8_t size, 		    void *data, uint16_t flag);int8_t ker_sys_post_link(sos_pid_t dst_mod_id, uint8_t type,    uint8_t size, void *data, uint16_t flag, uint16_t dst_node_addr);int8_t ker_sys_post_value(sos_pid_t dst_mod_id,                uint8_t type, uint32_t data, uint16_t flag);uint8_t ker_hw_type();uint16_t ker_id();uint16_t ker_rand();uint32_t ker_systime32();int8_t ker_sys_sensor_get_data( uint8_t sensor_id );int8_t ker_led(uint8_t op);void* ker_sys_get_module_state( void );int8_t ker_sys_fntable_subscribe( sos_pid_t pub_pid, uint8_t fid, uint8_t table_index );int8_t ker_sys_change_own( void* ptr );int8_t ker_sys_codemem_read(codemem_t h, void *buf, uint16_t nbytes, uint16_t offset);/// \endcond #endif/** * \defgroup system_api SOS System API *//** * \ingroup system_api * \defgroup malloc Memory Allocation * Functions for memory management * @{ *//// \cond NOTYPEDEFtypedef void *  (* sys_malloc_ker_func_t)( uint16_t size );/// \endcond/** * Allocate memory * * \param size Number of bytes to allocate * * \return Pointer to memory  * * \note * A call to sys_malloc will either return a valid pointer or, upon failure, * cause the system to enter a ``panic'' mode.  The default panic mode * suspends all node operations and sends a panic message out via: LEDs, * radio, and UART. * * Remember to either store, free, or SOS_RELEASE any dynamically allocated * memory.  Leaky motes sink boats!  Or is that lips... * */static inline void *  sys_malloc( uint16_t size ){#ifdef SYS_JUMP_TBL_START	return ((sys_malloc_ker_func_t)(SYS_JUMP_TBL_START+SYS_JUMP_TBL_SIZE*1))(size); #else	return ker_sys_malloc( size );#endif}/// \cond NOTYPEDEFtypedef void *  (* sys_realloc_ker_func_t)( void *  ptr, uint16_t newSize );/// \endcond/** * Reallocate dynamic memory *  * \param ptr Pointer to the currently held block of memory * * \param newSize Number of bytes to be allocated * * \return Pointer to the reallocated memory. * * This function is a slightly optimized way to extend the size of a buffer. * If it can, the function will simply extend the current block of memory so * that no data needs to be copied and return the ptr passed in.  If that * fails the kernel w ill attempt to allocate a fresh larger buffer, copy the * data over, and return a pointer to this new buffer.  If neither of these * two succeed, the function returns NULL, but you still have access to ptr. * * \note Returns a NULL if unable to reallocate but the original pointer is * still valid. * */static inline void *  sys_realloc( void *  ptr, uint16_t newSize ){#ifdef SYS_JUMP_TBL_START                                                               	return ((sys_realloc_ker_func_t)(SYS_JUMP_TBL_START+SYS_JUMP_TBL_SIZE*2))( ptr, newSize );                                #else	return ker_sys_realloc( ptr, newSize );#endif} /// \cond NOTYPEDEF                                             typedef void (* sys_free_ker_func_t)( void *  ptr );            /// \endcond  /** * * Free memory * * \param ptr Pointer to the data that should be freed * */static inline void sys_free( void *  ptr )                      {                                          #ifdef SYS_JUMP_TBL_START 	((sys_free_ker_func_t)(SYS_JUMP_TBL_START+SYS_JUMP_TBL_SIZE*3))( ptr );  #else	ker_sys_free( ptr );#endif}   /// \cond NOTYPEDEF                                             typedef void *  (* sys_msg_take_data_ker_func_t)( Message *  msg );/// \endcond        /** * * Claim the data payload of a message * * \param msg Pointer to message structure carrying data to claim  * * \return Pointer to memory * * This function allows you to claim the data in an in coming message.  This * is often called from the message handler function of a module.  Module * writers can treat this function in a manner very similar to the * sys_malloc() function. * * \n If a module does not call this function, the msg->data field may be * released by the kernel or another module after the current function ends. * This can make for very difficult to track bugs. * * \n The lower level behavior of this function is based upon if the * ::SOS_MSG_RELEASE flag was set by the call to post(), or one if its * variations, that generated the message. * * \li If ::SOS_MSG_RELEASE was set then this function takes control of the * data released into the data payload of the message * * \li If ::SOS_MSG_RELEASE was NOT set then this function attempts to * allocate a new buffer of the same size and create a deep copy of the data * payload * * \note A call to sys_msg_take_data will either return a valid pointer or, * upon failure, cause the system to enter a ``panic'' mode.  The default * panic mode suspends all node operations and sends a panic message out via: * LEDs, radio, and UART. * */static inline void *  sys_msg_take_data( Message *  msg )       {#ifdef SYS_JUMP_TBL_START                                                               	return ((sys_msg_take_data_ker_func_t)(SYS_JUMP_TBL_START+SYS_JUMP_TBL_SIZE*4))( msg );                                         #else	return ker_sys_msg_take_data( msg );#endif}        /* @} *//** * \ingroup system_api * \defgroup timer Timer * Functions to work with software timers in the system. * * @{ *//// \cond NOTYPEDEF                                             typedef int8_t (* sys_timer_start_ker_func_t)( uint8_t tid, int32_t interval, uint8_t type );/// \endcond  /** * Start a timer *  * \param tid Timer ID. This ID has to be defined by the caller. *  * \param interval The timeout interval specified in ticks of duration (1/1024) sec. * * \param type Timer type - Periodic or One Shot (Defined in sos_timer.h) *  * \return SOS_OK upon success, else -EINVAL * * in a failure with error code -EINVAL. *  */static inline int8_t sys_timer_start( uint8_t tid, int32_t interval, uint8_t type ){#ifdef SYS_JUMP_TBL_START	return ((sys_timer_start_ker_func_t)(SYS_JUMP_TBL_START+SYS_JUMP_TBL_SIZE*5))( tid, interval, type );#else	return ker_sys_timer_start( tid, interval, type );#endif}/// \cond NOTYPEDEF                                             typedef int8_t (* sys_timer_restart_ker_func_t)( uint8_t tid, int32_t interval );/// \endcond    /** * Restart a timer * * \param tid Timer ID. This ID has to be defined by the caller. *  * \param interval The timeout interval specified in ticks of duration (1/1024) sec. *  * * \return SOS_OK upon success, else -EINVAL * * \warning Re-starting a timer without initializing it will result  * in a failure with error code -EINVAL. * * \note *  *  * \li A running timer is stopped and re-started with the new parameters. *  * \li If the timer is not running, it is started. *  */static inline int8_t sys_timer_restart( uint8_t tid, int32_t interval ){    #ifdef SYS_JUMP_TBL_START	return ((sys_timer_restart_ker_func_t)(SYS_JUMP_TBL_START+SYS_JUMP_TBL_SIZE*6))( tid, interval );#else	return ker_sys_timer_restart( tid, interval );#endif}/// \cond NOTYPEDEF                                             typedef int8_t (* sys_timer_stop_ker_func_t)( uint8_t tid );    /// \endcond         /** * Stop a running timer * * \param tid Timer ID. This ID has to be defined by the caller. * * \return SOS_OK on success, else -EINVAL * * \warning Stopping a timer that is not running or that is  * not initialized  will result in a failure with error code -EINVAL. * */static inline int8_t sys_timer_stop( uint8_t tid ) {#ifdef SYS_JUMP_TBL_START	return ((sys_timer_stop_ker_func_t)(SYS_JUMP_TBL_START+SYS_JUMP_TBL_SIZE*7))( tid );#else	return ker_sys_timer_stop( tid );#endif}   /* @} *//** * \ingroup system_api * \defgroup message Messaging * Functions to send and receive SOS Messages * @{ *//// \cond NOTYPEDEF                                             typedef int8_t (* sys_post_ker_func_t)( sos_pid_t dst_mod_id, uint8_t type, uint8_t size, void *  data, uint16_t flag );/// \endcond         /** Post a message with payload to a module * * \param dst_mod_id ID of the destination module * * \param type Unique message identifier. Kernel message types are defined in * message_types.h * * \param size Size of the payload (in bytes) that is being dispatched as a * part of the message * * \param *data Pointer to the payload buffer that is dispatched in the * message. * * \param flag Control scheduler priority, memory management properties of * payload.  Check message_types.h * * \return SOS_OK on success, -ENOMEM on failure * * \warning MESSAGE PAYLOAD SHOULD NEVER BE ALLOCATED FROM THE STACK. * * \note Important information about message flags *  * * \li ::SOS_MSG_RELEASE flag should be set if the source module wishes to * transfer ownership of the message payload to the destination module. * * \li ::SOS_MSG_RELIABLE flag is set if the source module wishes to receive * notification regarding the success/failure of message delivery to the * destination module.  The notification message has the type * ::MSG_PKT_SENDDONE and its payload contains the original message. The flag * field of the notification message has the value ::SOS_MSG_SEND_FAIL if the * message was not successfully delivered. The flag field is set to 0 upon * successful delivery. * * \li ::SOS_MSG_HIGH_PRIORITY flag is set to insert the message in a high * priority queue.  The high priority queue is serviced before the low * priority queue. * */static inline int8_t sys_post( sos_pid_t dst_mod_id, uint8_t type, uint8_t size, void *  data, uint16_t flag ){                 #ifdef SYS_JUMP_TBL_START                                              	return ((sys_post_ker_func_t)(SYS_JUMP_TBL_START+SYS_JUMP_TBL_SIZE*8))( dst_mod_id, type, size, data, flag );          #else	return ker_sys_post( dst_mod_id, type, size, data, flag );#endif}             /// \cond NOTYPEDEFtypedef int8_t (* sys_post_link_ker_func_t)( sos_pid_t dst_mod_id, uint8_t type, uint8_t size, void *  data, uint16_t flag, uint16_t dst_node_addr );/// \endcond/** * Post message with paylaod over different network link. * * \warning *<STRONG>THIS IS NOT A STANDARD INTERFACE. DO NOT USE THIS IN THE MODULE.<br> * INSTEAD USE sys_post_net, sys_post_uart OR sys_post_i2c.</STRONG> */static inline int8_t sys_post_link( sos_pid_t dst_mod_id, uint8_t type, uint8_t size, void *  data, uint16_t flag, uint16_t dst_node_addr ){#ifdef SYS_JUMP_TBL_START 	return ((sys_post_link_ker_func_t)(SYS_JUMP_TBL_START+SYS_JUMP_TBL_SIZE*9))( dst_mod_id, type, size, data, flag, dst_node_addr );#else	return ker_sys_post_link( dst_mod_id, type, size, data, flag, dst_node_addr );#endif}/**  * Post a message with payload over network *

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品国产伦一区二区三区观看体验| 欧美日韩在线播放三区| 久久精品一区二区三区不卡 | 日韩区在线观看| 91久久精品午夜一区二区| 国产福利电影一区二区三区| 日本午夜精品视频在线观看| 亚洲欧洲中文日韩久久av乱码| 欧美国产乱子伦| 国产网红主播福利一区二区| 亚洲午夜免费电影| 亚洲一区二区三区爽爽爽爽爽| 亚洲伦在线观看| 国产日韩欧美在线一区| 国产无一区二区| 日本vs亚洲vs韩国一区三区二区| 蜜桃一区二区三区在线| 毛片av一区二区| 欧美体内she精视频| 欧美群妇大交群的观看方式| 欧美日本高清视频在线观看| 亚洲欧美激情在线| 成人av免费观看| 91丝袜美腿高跟国产极品老师 | 欧美三级日本三级少妇99| 国产精品麻豆视频| 亚洲免费av高清| 成人免费视频国产在线观看| 欧美性色黄大片| 亚洲欧美国产77777| 99精品视频在线观看| 欧美一卡二卡在线观看| 欧美经典一区二区三区| 韩国v欧美v亚洲v日本v| 北岛玲一区二区三区四区| 欧洲精品在线观看| 精品日韩成人av| 亚洲欧洲av一区二区三区久久| 亚洲综合在线免费观看| 奇米一区二区三区| 日韩精品综合一本久道在线视频| 亚洲天堂网中文字| 美女精品一区二区| 日韩精品一区二| 国产成人午夜电影网| 国产农村妇女毛片精品久久麻豆| 国产成人午夜99999| 国产精品国产精品国产专区不片| 亚洲美女在线一区| 欧美在线看片a免费观看| 亚洲综合激情网| 51精品视频一区二区三区| 欧美激情一区二区三区四区| 成人精品视频一区| 一区二区三区中文字幕在线观看| 欧美性色综合网| 久久电影国产免费久久电影| 欧洲人成人精品| 久久国产精品99久久久久久老狼| 久久精品人人做| 色综合一区二区| 26uuu色噜噜精品一区| 日本最新不卡在线| 久久久久国产精品免费免费搜索| 亚洲风情在线资源站| 欧美sm极限捆绑bd| 91麻豆国产在线观看| 日产国产欧美视频一区精品| 欧美国产日韩亚洲一区| 欧美欧美欧美欧美| 丁香天五香天堂综合| 精品国产网站在线观看| 成人av在线影院| 舔着乳尖日韩一区| 在线播放欧美女士性生活| 亚洲gay无套男同| 欧美日韩国产首页| 高清成人免费视频| 日本亚洲免费观看| 亚洲免费av网站| 国产午夜精品美女毛片视频| 欧美精品一二三四| 北条麻妃国产九九精品视频| 麻豆精品在线播放| 亚洲国产成人tv| **欧美大码日韩| 精品国产sm最大网站| 在线观看国产日韩| 成人99免费视频| 国产一区二区三区日韩 | 国产999精品久久| 天天色综合天天| 亚洲欧美激情小说另类| 欧美激情一区在线观看| 欧美va在线播放| 欧美精品视频www在线观看| 99国产精品久久久久久久久久| 91原创在线视频| 国产+成+人+亚洲欧洲自线| 美女任你摸久久| 午夜精品成人在线视频| 一区二区三区产品免费精品久久75| 国产丝袜美腿一区二区三区| 精品国产污网站| 日韩女同互慰一区二区| 91精品国产高清一区二区三区蜜臀| 99re在线精品| 91小视频在线观看| av中文字幕不卡| 99riav一区二区三区| voyeur盗摄精品| av在线不卡免费看| 99热国产精品| 91色在线porny| 欧美成人性福生活免费看| 日韩一级免费观看| 日韩一区二区影院| 日韩欧美一级二级三级| 精品国产污网站| 2021国产精品久久精品| 久久综合99re88久久爱| 久久这里只有精品6| 久久精品男人天堂av| 久久久亚洲精华液精华液精华液| 日韩精品一区二区三区中文精品| 久久久久久久电影| 国产女人18水真多18精品一级做| 国产精品久久久久久亚洲伦| 亚洲欧洲性图库| 亚洲资源中文字幕| 视频在线观看一区| 精品国产一区二区精华| 精品国产第一区二区三区观看体验| 欧美大片免费久久精品三p| 久久九九99视频| 国产精品国产三级国产| 亚洲综合在线视频| 久久精品噜噜噜成人av农村| 国产精品一区三区| 日韩精品乱码av一区二区| 日韩激情av在线| 国产乱子伦视频一区二区三区 | 欧美国产一区在线| 亚洲麻豆国产自偷在线| 秋霞影院一区二区| 国产综合色精品一区二区三区| 成人av资源站| 欧美麻豆精品久久久久久| 久久色视频免费观看| 亚洲天堂av一区| 欧美aaaaaa午夜精品| 国产91综合网| 欧美久久久久久蜜桃| 久久精品亚洲乱码伦伦中文| 一区二区三区中文免费| 免费观看在线综合| 91香蕉国产在线观看软件| 欧美一级日韩一级| 国产精品国产自产拍高清av| 亚洲成a人片在线观看中文| 国产精华液一区二区三区| 日本精品视频一区二区| 欧美大黄免费观看| 夜夜嗨av一区二区三区网页| 国产乱码精品一区二区三区av | 欧美日韩免费一区二区三区视频 | 综合色中文字幕| 精品一区二区三区视频| 天堂va蜜桃一区二区三区漫画版| 国产又粗又猛又爽又黄91精品| 色综合中文字幕国产 | 日韩免费一区二区| 亚洲码国产岛国毛片在线| 国产精品 欧美精品| 欧美一区二区三区视频在线 | 欧美亚洲一区二区在线| 国产精品家庭影院| 国产在线精品视频| 制服.丝袜.亚洲.另类.中文| 亚洲欧美另类久久久精品2019 | 精品无人码麻豆乱码1区2区 | 色狠狠色狠狠综合| 国产精品久久久久一区| 国产麻豆日韩欧美久久| 91精品国产免费| 亚洲18影院在线观看| 日本道色综合久久| 1000精品久久久久久久久| 国产成人午夜精品影院观看视频| 精品国产一区二区亚洲人成毛片| 日韩成人av影视| 91精品欧美久久久久久动漫| 亚洲国产视频在线| 欧美午夜寂寞影院| 亚洲高清三级视频| 在线电影一区二区三区| 日韩高清不卡在线| 欧美电视剧在线看免费| 日本人妖一区二区| 久久综合九色综合97婷婷女人|