esp_event.h 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524
  1. // Copyright 2018 Espressif Systems (Shanghai) PTE LTD
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #ifndef ESP_EVENT_H_
  15. #define ESP_EVENT_H_
  16. #include "esp_err.h"
  17. #include "freertos/FreeRTOS.h"
  18. #include "freertos/task.h"
  19. #include "freertos/queue.h"
  20. #include "freertos/semphr.h"
  21. #include "esp_event_base.h"
  22. #include "esp_event_legacy.h"
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. /// Configuration for creating event loops
  27. typedef struct {
  28. int32_t queue_size; /**< size of the event loop queue */
  29. const char *task_name; /**< name of the event loop task; if NULL,
  30. a dedicated task is not created for event loop*/
  31. UBaseType_t task_priority; /**< priority of the event loop task, ignored if task name is NULL */
  32. uint32_t task_stack_size; /**< stack size of the event loop task, ignored if task name is NULL */
  33. BaseType_t task_core_id; /**< core to which the event loop task is pinned to,
  34. ignored if task name is NULL */
  35. } esp_event_loop_args_t;
  36. /**
  37. * @brief Create a new event loop.
  38. *
  39. * @param[in] event_loop_args configuration structure for the event loop to create
  40. * @param[out] event_loop handle to the created event loop
  41. *
  42. * @return
  43. * - ESP_OK: Success
  44. * - ESP_ERR_INVALID_ARG: event_loop_args or event_loop was NULL
  45. * - ESP_ERR_NO_MEM: Cannot allocate memory for event loops list
  46. * - ESP_FAIL: Failed to create task loop
  47. * - Others: Fail
  48. */
  49. esp_err_t esp_event_loop_create(const esp_event_loop_args_t *event_loop_args, esp_event_loop_handle_t *event_loop);
  50. /**
  51. * @brief Delete an existing event loop.
  52. *
  53. * @param[in] event_loop event loop to delete, must not be NULL
  54. *
  55. * @return
  56. * - ESP_OK: Success
  57. * - Others: Fail
  58. */
  59. esp_err_t esp_event_loop_delete(esp_event_loop_handle_t event_loop);
  60. /**
  61. * @brief Create default event loop
  62. *
  63. * @return
  64. * - ESP_OK: Success
  65. * - ESP_ERR_NO_MEM: Cannot allocate memory for event loops list
  66. * - ESP_FAIL: Failed to create task loop
  67. * - Others: Fail
  68. */
  69. esp_err_t esp_event_loop_create_default(void);
  70. /**
  71. * @brief Delete the default event loop
  72. *
  73. * @return
  74. * - ESP_OK: Success
  75. * - Others: Fail
  76. */
  77. esp_err_t esp_event_loop_delete_default(void);
  78. /**
  79. * @brief Dispatch events posted to an event loop.
  80. *
  81. * This function is used to dispatch events posted to a loop with no dedicated task, i.e task name was set to NULL
  82. * in event_loop_args argument during loop creation. This function includes an argument to limit the amount of time
  83. * it runs, returning control to the caller when that time expires (or some time afterwards). There is no guarantee
  84. * that a call to this function will exit at exactly the time of expiry. There is also no guarantee that events have
  85. * been dispatched during the call, as the function might have spent all of the alloted time waiting on the event queue.
  86. * Once an event has been unqueued, however, it is guaranteed to be dispatched. This guarantee contributes to not being
  87. * able to exit exactly at time of expiry as (1) blocking on internal mutexes is necessary for dispatching the unqueued
  88. * event, and (2) during dispatch of the unqueued event there is no way to control the time occupied by handler code
  89. * execution. The guaranteed time of exit is therefore the alloted time + amount of time required to dispatch
  90. * the last unqueued event.
  91. *
  92. * In cases where waiting on the queue times out, ESP_OK is returned and not ESP_ERR_TIMEOUT, since it is
  93. * normal behavior.
  94. *
  95. * @param[in] event_loop event loop to dispatch posted events from, must not be NULL
  96. * @param[in] ticks_to_run number of ticks to run the loop
  97. *
  98. * @note encountering an unknown event that has been posted to the loop will only generate a warning, not an error.
  99. *
  100. * @return
  101. * - ESP_OK: Success
  102. * - Others: Fail
  103. */
  104. esp_err_t esp_event_loop_run(esp_event_loop_handle_t event_loop, TickType_t ticks_to_run);
  105. /**
  106. * @brief Register an event handler to the system event loop (legacy).
  107. *
  108. * @note This function is obsolete and will be deprecated soon, please use esp_event_handler_instance_register()
  109. * instead.
  110. *
  111. * This function can be used to register a handler for either: (1) specific events,
  112. * (2) all events of a certain event base, or (3) all events known by the system event loop.
  113. *
  114. * - specific events: specify exact event_base and event_id
  115. * - all events of a certain base: specify exact event_base and use ESP_EVENT_ANY_ID as the event_id
  116. * - all events known by the loop: use ESP_EVENT_ANY_BASE for event_base and ESP_EVENT_ANY_ID as the event_id
  117. *
  118. * Registering multiple handlers to events is possible. Registering a single handler to multiple events is
  119. * also possible. However, registering the same handler to the same event multiple times would cause the
  120. * previous registrations to be overwritten.
  121. *
  122. * @param[in] event_base the base id of the event to register the handler for
  123. * @param[in] event_id the id of the event to register the handler for
  124. * @param[in] event_handler the handler function which gets called when the event is dispatched
  125. * @param[in] event_handler_arg data, aside from event data, that is passed to the handler when it is called
  126. *
  127. * @note the event loop library does not maintain a copy of event_handler_arg, therefore the user should
  128. * ensure that event_handler_arg still points to a valid location by the time the handler gets called
  129. *
  130. * @return
  131. * - ESP_OK: Success
  132. * - ESP_ERR_NO_MEM: Cannot allocate memory for the handler
  133. * - ESP_ERR_INVALID_ARG: Invalid combination of event base and event id
  134. * - Others: Fail
  135. */
  136. esp_err_t esp_event_handler_register(esp_event_base_t event_base,
  137. int32_t event_id,
  138. esp_event_handler_t event_handler,
  139. void *event_handler_arg);
  140. /**
  141. * @brief Register an event handler to a specific loop (legacy).
  142. *
  143. * @note This function is obsolete and will be deprecated soon, please use esp_event_handler_instance_register_with()
  144. * instead.
  145. *
  146. * This function behaves in the same manner as esp_event_handler_register, except the additional
  147. * specification of the event loop to register the handler to.
  148. *
  149. * @param[in] event_loop the event loop to register this handler function to, must not be NULL
  150. * @param[in] event_base the base id of the event to register the handler for
  151. * @param[in] event_id the id of the event to register the handler for
  152. * @param[in] event_handler the handler function which gets called when the event is dispatched
  153. * @param[in] event_handler_arg data, aside from event data, that is passed to the handler when it is called
  154. *
  155. * @note the event loop library does not maintain a copy of event_handler_arg, therefore the user should
  156. * ensure that event_handler_arg still points to a valid location by the time the handler gets called
  157. *
  158. * @return
  159. * - ESP_OK: Success
  160. * - ESP_ERR_NO_MEM: Cannot allocate memory for the handler
  161. * - ESP_ERR_INVALID_ARG: Invalid combination of event base and event id
  162. * - Others: Fail
  163. */
  164. esp_err_t esp_event_handler_register_with(esp_event_loop_handle_t event_loop,
  165. esp_event_base_t event_base,
  166. int32_t event_id,
  167. esp_event_handler_t event_handler,
  168. void *event_handler_arg);
  169. /**
  170. * @brief Register an instance of event handler to a specific loop.
  171. *
  172. * This function can be used to register a handler for either: (1) specific events,
  173. * (2) all events of a certain event base, or (3) all events known by the system event loop.
  174. *
  175. * - specific events: specify exact event_base and event_id
  176. * - all events of a certain base: specify exact event_base and use ESP_EVENT_ANY_ID as the event_id
  177. * - all events known by the loop: use ESP_EVENT_ANY_BASE for event_base and ESP_EVENT_ANY_ID as the event_id
  178. *
  179. * Besides the error, the function returns an instance object as output parameter to identify each registration.
  180. * This is necessary to remove (unregister) the registration before the event loop is deleted.
  181. *
  182. * Registering multiple handlers to events, registering a single handler to multiple events as well as registering
  183. * the same handler to the same event multiple times is possible.
  184. * Each registration yields a distinct instance object which identifies it over the registration
  185. * lifetime.
  186. *
  187. * @param[in] event_loop the event loop to register this handler function to, must not be NULL
  188. * @param[in] event_base the base id of the event to register the handler for
  189. * @param[in] event_id the id of the event to register the handler for
  190. * @param[in] event_handler the handler function which gets called when the event is dispatched
  191. * @param[in] event_handler_arg data, aside from event data, that is passed to the handler when it is called
  192. * @param[out] instance An event handler instance object related to the registered event handler and data, can be NULL.
  193. * This needs to be kept if the specific callback instance should be unregistered before deleting the whole
  194. * event loop. Registering the same event handler multiple times is possible and yields distinct instance
  195. * objects. The data can be the same for all registrations.
  196. * If no unregistration is needed but the handler should be deleted when the event loop is deleted,
  197. * instance can be NULL.
  198. *
  199. * @note the event loop library does not maintain a copy of event_handler_arg, therefore the user should
  200. * ensure that event_handler_arg still points to a valid location by the time the handler gets called
  201. *
  202. * @return
  203. * - ESP_OK: Success
  204. * - ESP_ERR_NO_MEM: Cannot allocate memory for the handler
  205. * - ESP_ERR_INVALID_ARG: Invalid combination of event base and event id or instance is NULL
  206. * - Others: Fail
  207. */
  208. esp_err_t esp_event_handler_instance_register_with(esp_event_loop_handle_t event_loop,
  209. esp_event_base_t event_base,
  210. int32_t event_id,
  211. esp_event_handler_t event_handler,
  212. void *event_handler_arg,
  213. esp_event_handler_instance_t *instance);
  214. /**
  215. * @brief Register an instance of event handler to the default loop.
  216. *
  217. * This function does the same as esp_event_handler_instance_register_with, except that it registers the
  218. * handler to the default event loop.
  219. *
  220. * @param[in] event_base the base id of the event to register the handler for
  221. * @param[in] event_id the id of the event to register the handler for
  222. * @param[in] event_handler the handler function which gets called when the event is dispatched
  223. * @param[in] event_handler_arg data, aside from event data, that is passed to the handler when it is called
  224. * @param[out] instance An event handler instance object related to the registered event handler and data, can be NULL.
  225. * This needs to be kept if the specific callback instance should be unregistered before deleting the whole
  226. * event loop. Registering the same event handler multiple times is possible and yields distinct instance
  227. * objects. The data can be the same for all registrations.
  228. * If no unregistration is needed but the handler should be deleted when the event loop is deleted,
  229. * instance can be NULL.
  230. *
  231. * @note the event loop library does not maintain a copy of event_handler_arg, therefore the user should
  232. * ensure that event_handler_arg still points to a valid location by the time the handler gets called
  233. *
  234. * @return
  235. * - ESP_OK: Success
  236. * - ESP_ERR_NO_MEM: Cannot allocate memory for the handler
  237. * - ESP_ERR_INVALID_ARG: Invalid combination of event base and event id or instance is NULL
  238. * - Others: Fail
  239. */
  240. esp_err_t esp_event_handler_instance_register(esp_event_base_t event_base,
  241. int32_t event_id,
  242. esp_event_handler_t event_handler,
  243. void *event_handler_arg,
  244. esp_event_handler_instance_t *instance);
  245. /**
  246. * @brief Unregister a handler with the system event loop (legacy).
  247. *
  248. * @note This function is obsolete and will be deprecated soon, please use esp_event_handler_instance_unregister()
  249. * instead.
  250. *
  251. * Unregisters a handler so it will no longer be called during dispatch.
  252. * Handlers can be unregistered for any combination of event_base and event_id which were previously registered.
  253. * To unregister a handler, the event_base and event_id arguments must match exactly the arguments passed to
  254. * esp_event_handler_register() when that handler was registered. Passing ESP_EVENT_ANY_BASE and/or ESP_EVENT_ANY_ID
  255. * will only unregister handlers that were registered with the same wildcard arguments.
  256. *
  257. * @note When using ESP_EVENT_ANY_ID, handlers registered to specific event IDs using the same base will not be
  258. * unregistered. When using ESP_EVENT_ANY_BASE, events registered to specific bases will also not be
  259. * unregistered. This avoids accidental unregistration of handlers registered by other users or components.
  260. *
  261. * @param[in] event_base the base of the event with which to unregister the handler
  262. * @param[in] event_id the id of the event with which to unregister the handler
  263. * @param[in] event_handler the handler to unregister
  264. *
  265. * @return ESP_OK success
  266. * @return ESP_ERR_INVALID_ARG invalid combination of event base and event id
  267. * @return others fail
  268. */
  269. esp_err_t esp_event_handler_unregister(esp_event_base_t event_base,
  270. int32_t event_id,
  271. esp_event_handler_t event_handler);
  272. /**
  273. * @brief Unregister a handler from a specific event loop (legacy).
  274. *
  275. * @note This function is obsolete and will be deprecated soon, please use esp_event_handler_instance_unregister_with()
  276. * instead.
  277. *
  278. * This function behaves in the same manner as esp_event_handler_unregister, except the additional specification of
  279. * the event loop to unregister the handler with.
  280. *
  281. * @param[in] event_loop the event loop with which to unregister this handler function, must not be NULL
  282. * @param[in] event_base the base of the event with which to unregister the handler
  283. * @param[in] event_id the id of the event with which to unregister the handler
  284. * @param[in] event_handler the handler to unregister
  285. *
  286. * @return
  287. * - ESP_OK: Success
  288. * - ESP_ERR_INVALID_ARG: Invalid combination of event base and event id
  289. * - Others: Fail
  290. */
  291. esp_err_t esp_event_handler_unregister_with(esp_event_loop_handle_t event_loop,
  292. esp_event_base_t event_base,
  293. int32_t event_id,
  294. esp_event_handler_t event_handler);
  295. /**
  296. * @brief Unregister a handler instance from a specific event loop.
  297. *
  298. * Unregisters a handler instance so it will no longer be called during dispatch.
  299. * Handler instances can be unregistered for any combination of event_base and event_id which were previously
  300. * registered. To unregister a handler instance, the event_base and event_id arguments must match exactly the
  301. * arguments passed to esp_event_handler_instance_register() when that handler instance was registered.
  302. * Passing ESP_EVENT_ANY_BASE and/or ESP_EVENT_ANY_ID will only unregister handler instances that were registered
  303. * with the same wildcard arguments.
  304. *
  305. * @note When using ESP_EVENT_ANY_ID, handlers registered to specific event IDs using the same base will not be
  306. * unregistered. When using ESP_EVENT_ANY_BASE, events registered to specific bases will also not be
  307. * unregistered. This avoids accidental unregistration of handlers registered by other users or components.
  308. *
  309. * @param[in] event_loop the event loop with which to unregister this handler function, must not be NULL
  310. * @param[in] event_base the base of the event with which to unregister the handler
  311. * @param[in] event_id the id of the event with which to unregister the handler
  312. * @param[in] instance the instance object of the registration to be unregistered
  313. *
  314. * @return
  315. * - ESP_OK: Success
  316. * - ESP_ERR_INVALID_ARG: Invalid combination of event base and event id
  317. * - Others: Fail
  318. */
  319. esp_err_t esp_event_handler_instance_unregister_with(esp_event_loop_handle_t event_loop,
  320. esp_event_base_t event_base,
  321. int32_t event_id,
  322. esp_event_handler_instance_t instance);
  323. /**
  324. * @brief Unregister a handler from the system event loop.
  325. *
  326. * This function does the same as esp_event_handler_instance_unregister_with, except that it unregisters the
  327. * handler instance from the default event loop.
  328. *
  329. * @param[in] event_base the base of the event with which to unregister the handler
  330. * @param[in] event_id the id of the event with which to unregister the handler
  331. * @param[in] instance the instance object of the registration to be unregistered
  332. *
  333. * @return
  334. * - ESP_OK: Success
  335. * - ESP_ERR_INVALID_ARG: Invalid combination of event base and event id
  336. * - Others: Fail
  337. */
  338. esp_err_t esp_event_handler_instance_unregister(esp_event_base_t event_base,
  339. int32_t event_id,
  340. esp_event_handler_instance_t instance);
  341. /**
  342. * @brief Posts an event to the system default event loop. The event loop library keeps a copy of event_data and manages
  343. * the copy's lifetime automatically (allocation + deletion); this ensures that the data the
  344. * handler recieves is always valid.
  345. *
  346. * @param[in] event_base the event base that identifies the event
  347. * @param[in] event_id the event id that identifies the event
  348. * @param[in] event_data the data, specific to the event occurence, that gets passed to the handler
  349. * @param[in] event_data_size the size of the event data
  350. * @param[in] ticks_to_wait number of ticks to block on a full event queue
  351. *
  352. * @return
  353. * - ESP_OK: Success
  354. * - ESP_ERR_TIMEOUT: Time to wait for event queue to unblock expired,
  355. * queue full when posting from ISR
  356. * - ESP_ERR_INVALID_ARG: Invalid combination of event base and event id
  357. * - Others: Fail
  358. */
  359. esp_err_t esp_event_post(esp_event_base_t event_base,
  360. int32_t event_id,
  361. void *event_data,
  362. size_t event_data_size,
  363. TickType_t ticks_to_wait);
  364. /**
  365. * @brief Posts an event to the specified event loop. The event loop library keeps a copy of event_data and manages
  366. * the copy's lifetime automatically (allocation + deletion); this ensures that the data the
  367. * handler recieves is always valid.
  368. *
  369. * This function behaves in the same manner as esp_event_post_to, except the additional specification of the event loop
  370. * to post the event to.
  371. *
  372. * @param[in] event_loop the event loop to post to, must not be NULL
  373. * @param[in] event_base the event base that identifies the event
  374. * @param[in] event_id the event id that identifies the event
  375. * @param[in] event_data the data, specific to the event occurence, that gets passed to the handler
  376. * @param[in] event_data_size the size of the event data
  377. * @param[in] ticks_to_wait number of ticks to block on a full event queue
  378. *
  379. * @return
  380. * - ESP_OK: Success
  381. * - ESP_ERR_TIMEOUT: Time to wait for event queue to unblock expired,
  382. * queue full when posting from ISR
  383. * - ESP_ERR_INVALID_ARG: Invalid combination of event base and event id
  384. * - Others: Fail
  385. */
  386. esp_err_t esp_event_post_to(esp_event_loop_handle_t event_loop,
  387. esp_event_base_t event_base,
  388. int32_t event_id,
  389. void *event_data,
  390. size_t event_data_size,
  391. TickType_t ticks_to_wait);
  392. #if CONFIG_ESP_EVENT_POST_FROM_ISR
  393. /**
  394. * @brief Special variant of esp_event_post for posting events from interrupt handlers.
  395. *
  396. * @param[in] event_base the event base that identifies the event
  397. * @param[in] event_id the event id that identifies the event
  398. * @param[in] event_data the data, specific to the event occurence, that gets passed to the handler
  399. * @param[in] event_data_size the size of the event data; max is 4 bytes
  400. * @param[out] task_unblocked an optional parameter (can be NULL) which indicates that an event task with
  401. * higher priority than currently running task has been unblocked by the posted event;
  402. * a context switch should be requested before the interrupt is existed.
  403. *
  404. * @note this function is only available when CONFIG_ESP_EVENT_POST_FROM_ISR is enabled
  405. * @note when this function is called from an interrupt handler placed in IRAM, this function should
  406. * be placed in IRAM as well by enabling CONFIG_ESP_EVENT_POST_FROM_IRAM_ISR
  407. *
  408. * @return
  409. * - ESP_OK: Success
  410. * - ESP_FAIL: Event queue for the default event loop full
  411. * - ESP_ERR_INVALID_ARG: Invalid combination of event base and event id,
  412. * data size of more than 4 bytes
  413. * - Others: Fail
  414. */
  415. esp_err_t esp_event_isr_post(esp_event_base_t event_base,
  416. int32_t event_id,
  417. void *event_data,
  418. size_t event_data_size,
  419. BaseType_t *task_unblocked);
  420. /**
  421. * @brief Special variant of esp_event_post_to for posting events from interrupt handlers
  422. *
  423. * @param[in] event_loop the event loop to post to, must not be NULL
  424. * @param[in] event_base the event base that identifies the event
  425. * @param[in] event_id the event id that identifies the event
  426. * @param[in] event_data the data, specific to the event occurence, that gets passed to the handler
  427. * @param[in] event_data_size the size of the event data
  428. * @param[out] task_unblocked an optional parameter (can be NULL) which indicates that an event task with
  429. * higher priority than currently running task has been unblocked by the posted event;
  430. * a context switch should be requested before the interrupt is existed.
  431. *
  432. * @note this function is only available when CONFIG_ESP_EVENT_POST_FROM_ISR is enabled
  433. * @note when this function is called from an interrupt handler placed in IRAM, this function should
  434. * be placed in IRAM as well by enabling CONFIG_ESP_EVENT_POST_FROM_IRAM_ISR
  435. *
  436. * @return
  437. * - ESP_OK: Success
  438. * - ESP_FAIL: Event queue for the loop full
  439. * - ESP_ERR_INVALID_ARG: Invalid combination of event base and event id,
  440. * data size of more than 4 bytes
  441. * - Others: Fail
  442. */
  443. esp_err_t esp_event_isr_post_to(esp_event_loop_handle_t event_loop,
  444. esp_event_base_t event_base,
  445. int32_t event_id,
  446. void *event_data,
  447. size_t event_data_size,
  448. BaseType_t *task_unblocked);
  449. #endif
  450. /**
  451. * @brief Dumps statistics of all event loops.
  452. *
  453. * Dumps event loop info in the format:
  454. *
  455. @verbatim
  456. event loop
  457. handler
  458. handler
  459. ...
  460. event loop
  461. handler
  462. handler
  463. ...
  464. where:
  465. event loop
  466. format: address,name rx:total_recieved dr:total_dropped
  467. where:
  468. address - memory address of the event loop
  469. name - name of the event loop, 'none' if no dedicated task
  470. total_recieved - number of successfully posted events
  471. total_dropped - number of events unsuccessfully posted due to queue being full
  472. handler
  473. format: address ev:base,id inv:total_invoked run:total_runtime
  474. where:
  475. address - address of the handler function
  476. base,id - the event specified by event base and id this handler executes
  477. total_invoked - number of times this handler has been invoked
  478. total_runtime - total amount of time used for invoking this handler
  479. @endverbatim
  480. *
  481. * @param[in] file the file stream to output to
  482. *
  483. * @note this function is a noop when CONFIG_ESP_EVENT_LOOP_PROFILING is disabled
  484. *
  485. * @return
  486. * - ESP_OK: Success
  487. * - ESP_ERR_NO_MEM: Cannot allocate memory for event loops list
  488. * - Others: Fail
  489. */
  490. esp_err_t esp_event_dump(FILE *file);
  491. #ifdef __cplusplus
  492. } // extern "C"
  493. #endif
  494. #endif // #ifndef ESP_EVENT_H_