2 * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 * @brief \~english Event library -- API define head file
22 #ifndef OTHERSERVICE_EV_LIB_H_ // NOLINT(build/header_guard)
23 #define OTHERSERVICE_EV_LIB_H_ // NOLINT(build/header_guard)
25 #include <agl_types_obsoluted.h>
26 #include <agldd/ev_common.h>
27 /** @addtogroup BaseSystem
30 /** @addtogroup other_service
34 /** @addtogroup event_library
35 * @ingroup other_service
43 #endif /* __cplusplus */
45 /* Create/Delete flag and message queue */
46 /////////////////////////////////////////////////////////////////////////////////////
47 /// \ingroup EV_create_flag
48 /// \~english @par Brief
49 /// Create flag for event flag by the flag_id.
50 /// \~english @param [in] flag_id
51 /// EV_ID - Flag ID of the flag event
53 /// EV_ID type parameter
55 /// typedef UINT32 EV_ID
57 /// \~english @retval EV_OK Successful completion
58 /// \~english @retval EV_ERR_Invalid_ID Invalid flag_id
59 /// \~english @retval EV_ERR_Thread_Over The MAX of event thread.
60 /// \~english @retval EV_ERR_Exist Duplication Error
61 /// \~english @retval EV_ERR_Fatal Abnormal error
62 /// \~english @par Prerequisite
63 /// There is no prerequisite
64 /// \~english @par Change of internal state
65 /// There is no change of the internal Status
66 /// \~english @par Conditions of processing failure
67 /// - Input parameter error (specifying incorrect flag_id)
68 /// --incorrect flag_id: The ID is not created by function of EV_moduleID_to_flagID().
69 /// - EV_ERR_Invalid_ID
70 /// - Startup thread upper limit (16) error
71 /// - EV_ERR_Thread_Over
72 /// - flag_id registered in launch thread
73 /// - Flag corresponding to flag_id already exists
75 /// - Securing free space of thread information management table (malloc) Failure
76 /// - Flag pool is NULL
77 /// - Flag generation corresponding to flag_id failed
79 /// \~english @par Classification
81 /// \~english @par Type
83 /// \~english @par Detail
84 /// Creates flag with ID specified by the argument.
85 /// An error occurs if flag of the specified ID already exists.
86 /// \~english @see evk_open, evk_close, evk_ioctl, evk_create_flag, evk_set_poll
87 ////////////////////////////////////////////////////////////////////////////////////
89 EV_ERR EV_create_flag(EV_ID flag_id); // NOLINT (readability/nolint)
91 /////////////////////////////////////////////////////////////////////////////////////
92 /// \ingroup EV_create_flag64
93 /// \~english @par Brief
94 /// Create flag for event flag by the flag_id.
95 /// \~english @param [in] flag_id
96 /// EV_ID - Flag ID of the flag event
98 /// EV_ID type parameter
100 /// typedef UINT32 EV_ID
102 /// \~english @retval EV_OK Successful completion
103 /// \~english @retval EV_ERR_Invalid_ID Invalid flag_id
104 /// \~english @retval EV_ERR_Thread_Over The MAX of event thread.
105 /// \~english @retval EV_ERR_Exist Duplication Error
106 /// \~english @retval EV_ERR_Fatal Abnormal error
107 /// \~english @par Prerequisite
108 /// There is no prerequisite
109 /// \~english @par Change of internal state
110 /// There is no change of the internal Status
111 /// \~english @par Conditions of processing failure
112 /// - Input parameter error (specifying incorrect flag_id)
113 /// --incorrect flag_id: The ID is not created by function of EV_moduleID_to_flag64ID ().
114 /// - EV_ERR_Invalid_ID
115 /// - Startup thread upper limit (16) error
116 /// - EV_ERR_Thread_Over
117 /// - flag_id registered in launch thread
118 /// - Flag corresponding to flag_id already exists
120 /// - Securing free space of thread information management table (malloc) Failure
121 /// - Flag pool is NULL
122 /// - Flag generation corresponding to flag_id failed
124 /// \~english @par Classification
126 /// \~english @par Type
128 /// \~english @par Detail
129 /// Creates flag with ID specified by the argument.
130 /// An error occurs if flag of the specified ID already exists.
131 /// \~english @see evk_open, evk_close, evk_ioctl, evk_create_flag, evk_set_poll
132 ////////////////////////////////////////////////////////////////////////////////////
134 EV_ERR EV_create_flag64(EV_ID flag_id); // NOLINT (readability/nolint)
136 /////////////////////////////////////////////////////////////////////////////////////
137 /// \ingroup EV_create_queue
138 /// \~english @par Brief
139 /// Create message queue with the queue_id.
140 /// \~english @param [in] queue_id
141 /// EV_ID - queue_id of message event
143 /// EV_ID type parameter
145 /// typedef UINT32 EV_ID
147 /// \~english @param [in] length
148 /// UINT8 - length of message queue (Maximum accumulated number of the messages)
149 /// \~english @param [in] max_bytes
150 /// UINT16 - the maximum number of bytes per 1 message(MAX 2048)
151 /// \~english @param [in] type
152 /// EV_Message_Queue_Type - classification of the processing when the queue received more event
153 /// - in the queue full state.
155 /// EV_Message_Queue_Type
157 /// typedef UINT8 EV_Message_Queue_Type;
158 /// - EV_MESSAGE_QUEUE_TYPE_BUSY = 0 // Return error(EV_ERR_Busy) to origin of message transmission
159 /// - EV_MESSAGE_QUEUE_TYPE_FIFO = 1 // Delete the top message of the queue, and shift message
160 /// // (Delete the oldest message)
161 /// - EV_MESSAGE_QUEUE_TYPE_REPLACE = 2 // Overwrite the last message of the queue
162 /// // (Overwrite the newest message)
164 /// \~english @retval EV_OK Successful completion
165 /// \~english @retval EV_ERR_Invalid_ID Invalid queue_id
166 /// \~english @retval EV_ERR_Thread_Over The MAX of event thread.
167 /// \~english @retval EV_ERR_Exist Duplication Error
168 /// \~english @retval EV_ERR_Fatal Abnormal error
169 /// \~english @par Prerequisite
170 /// There is no prerequisite
171 /// \~english @par Change of internal state
172 /// There is no change of the internal Status
173 /// \~english @par Conditions of processing failure
174 /// - Input parameter error (specifying incorrect queue_id)
175 /// --incorrect queue_id:The queue_id is not created by function of EV_moduleID_to_queueID ().
176 /// - EV_ERR_Invalid_ID
177 /// - Startup thread upper limit (16) error
178 /// - EV_ERR_Thread_Over
179 /// - queue_id registered in launch thread
180 /// - Message queue corresponding to queue_id already exists
182 /// - Securing free space of thread information management table (malloc) Failure
183 /// - Access failed from kernel space to user space reference area
184 /// - Failed to copy data from user space to kernel space
185 /// - Message queue pool is NULL
186 /// - Message queue generation corresponding to queue_id failed
188 /// \~english @par Classification
190 /// \~english @par Type
192 /// \~english @par Detail
193 /// Creates message queue with ID specified by the argument.
194 /// When queue is created, a memory area corresponding to "length" x "max_bytes" is dynamically secured.
195 /// An error occurs if queue of the specified ID already exists.
196 /// \~english @see evk_open, evk_close, evk_ioctl, evk_create_message_queue, evk_set_poll
197 ////////////////////////////////////////////////////////////////////////////////////
199 EV_ERR EV_create_queue(EV_ID queue_id, // NOLINT (readability/nolint)
200 UINT8 length, // NOLINT (readability/nolint)
201 UINT16 max_bytes, // NOLINT (readability/nolint)
202 EV_Message_Queue_Type type); // NOLINT (readability/nolint)
204 /////////////////////////////////////////////////////////////////////////////////////
205 /// \ingroup EV_create_flag_auto_id
206 /// \~english @par Brief
207 /// Automatically assign flag ID, and creates flag with flag ID.
208 /// \~english @param [out] flag_id
209 /// EV_ID* - flag_id assigned automatically
211 /// EV_ID type parameter
213 /// typedef UINT32 EV_ID
215 /// \~english @retval EV_OK Successful completion
216 /// \~english @retval EV_ERR_Thread_Over The MAX of event thread
217 /// \~english @retval EV_ERR_Fatal Abnormal error
218 /// \~english @par Prerequisite
219 /// There is no prerequisite
220 /// \~english @par Change of internal state
221 /// There is no change of the internal Status
222 /// \~english @par Conditions of processing failure
223 /// - Startup thread upper limit (16) error
224 /// - EV_ERR_Thread_Over
225 /// - Securing free space of thread information management table (malloc) Failure
226 /// - Flag pool is NULL
227 /// - Flag generation corresponding to flag_id failed
229 /// \~english @par Classification
231 /// \~english @par Type
233 /// \~english @par Detail
234 /// Automatically assign flag ID, and creates flag with flag ID.
235 /// It is the same as "EV_create_flag" except that flag ID is automatically allocated.
236 /// \~english @see EV_create_flag, evk_open, evk_close, evk_ioctl, evk_create_flag, evk_alloc_flag_id, evk_set_poll
237 ////////////////////////////////////////////////////////////////////////////////////
239 EV_ERR EV_create_flag_auto_id(/* OUT */EV_ID *flag_id); // NOLINT (readability/nolint)
241 /////////////////////////////////////////////////////////////////////////////////////
242 /// \ingroup EV_create_flag64_auto_id
243 /// \~english @par Brief
244 /// Automatically assign flag ID, and creates flag with flag ID.
245 /// \~english @param [out] flag_id
246 /// EV_ID* - flag_id assigned automatically
248 /// EV_ID type parameter
250 /// typedef UINT32 EV_ID
252 /// \~english @retval EV_OK Successful completion
253 /// \~english @retval EV_ERR_Thread_Over The MAX of event thread
254 /// \~english @retval EV_ERR_Fatal Abnormal error
255 /// \~english @par Prerequisite
256 /// There is no prerequisite
257 /// \~english @par Change of internal state
258 /// There is no change of the internal Status
259 /// \~english @par Conditions of processing failure
260 /// - Startup thread upper limit (16) error
261 /// - EV_ERR_Thread_Over
262 /// - Securing free space of thread information management table (malloc) Failure
263 /// - Flag pool is NULL
264 /// - Flag generation corresponding to flag_id failed
266 /// \~english @par Classification
268 /// \~english @par Type
270 /// \~english @par Detail
271 /// Automatically assign flag ID, and creates flag with flag ID.
272 /// It is the same as "EV_create_flag" except that flag ID is automatically allocated.
273 /// \~english @see EV_create_flag, evk_open, evk_close, evk_ioctl, evk_create_flag, evk_alloc_flag_id, evk_set_poll
274 ////////////////////////////////////////////////////////////////////////////////////
276 EV_ERR EV_create_flag64_auto_id(/* OUT */EV_ID *flag_id); // NOLINT (readability/nolint)
278 /////////////////////////////////////////////////////////////////////////////////////
279 /// \ingroup EV_create_queue_auto_id
280 /// \~english @par Brief
281 /// Automatically assign queue ID, and creates message queue with queue ID.
282 /// It stores queue_id assigned automatically in argument.
283 /// \~english @param [out] queue_id
284 /// EV_ID* - queue_id assigned automatically
286 /// EV_ID type parameter
288 /// typedef UINT32 EV_ID
290 /// \~english @param [in] length
291 /// UINT8 - length of message queue (Maximum accumulated number of the messages)
292 /// \~english @param [in] max_bytes
293 /// UINT16 - the maximum number of bytes per 1 message(MAX 2048)
294 /// \~english @param [in] type
295 /// EV_Message_Queue_Type - classification of the processing when the queue received more event
296 /// in the queue full state.
298 /// EV_Message_Queue_Type
300 /// typedef UINT8 EV_Message_Queue_Type;
301 /// - EV_MESSAGE_QUEUE_TYPE_BUSY = 0 // Return error(EV_ERR_Busy) to origin of message transmission
302 /// - EV_MESSAGE_QUEUE_TYPE_FIFO = 1 // Delete the top message of the queue, and shift message
303 /// // (Delete the oldest message)
304 /// - EV_MESSAGE_QUEUE_TYPE_REPLACE = 2 // Overwrite the last message of the queue
305 /// // (Overwrite the newest message)
307 /// \~english @retval EV_OK Successful completion
308 /// \~english @retval EV_ERR_Thread_Over The MAX of event thread
309 /// \~english @retval EV_ERR_Fatal Abnormal error
310 /// \~english @par Prerequisite
311 /// There is no prerequisite
312 /// \~english @par Change of internal state
313 /// There is no change of the internal Status
314 /// \~english @par Conditions of processing failure
315 /// - Thread is unregistered and threads started up to the maximum of event thread(16 threads)
316 /// - EV_ERR_Thread_Over
317 /// - Message queue corresponding to queue_id already exists
318 /// - Securing free space of thread information management table (malloc) Failure
319 /// - Access failed from kernel space to user space reference area
320 /// - Failed to copy data from user space to kernel space
321 /// - Message queue pool is NULL
322 /// - Message queue generation corresponding to queue_id failed
324 /// \~english @par Classification
326 /// \~english @par Type
328 /// \~english @par Detail
329 /// Automatically assign queue id, and creates message queue with queue id, It stores queue_id
330 /// assigned automatically in argument.
331 /// It is the same as "EV_queue_flag" except that queue ID is automatically allocated.
332 /// \~english @see EV_create_queue, evk_open, evk_close, evk_ioctl, evk_create_message_queue,
333 /// evk_alloc_queueID, evk_set_poll
334 ////////////////////////////////////////////////////////////////////////////////////
336 EV_ERR EV_create_queue_auto_id(/* OUT */EV_ID *queue_id, // NOLINT (readability/nolint)
337 UINT8 length, // NOLINT (readability/nolint)
338 UINT16 max_bytes, // NOLINT (readability/nolint)
339 EV_Message_Queue_Type type); // NOLINT (readability/nolint)
341 /////////////////////////////////////////////////////////////////////////////////////
342 /// \ingroup EV_destroy_flag
343 /// \~english @par Brief
344 /// Deletes flag with ID specified by the argument.
345 /// \~english @param [in] flag_id
346 /// EV_ID - Flag ID of the flag event
348 /// EV_ID type parameter
350 /// typedef UINT32 EV_ID
352 /// \~english @retval EV_OK Successful completion
353 /// \~english @retval EV_ERR_Invalid_ID Invalid queue_id
354 /// \~english @retval EV_ERR_Fatal Abnormal error
355 /// \~english @par Prerequisite
356 /// Execute EV_create_flag(),EV_create_flag_auto_id() and flag has already been created.
357 /// \~english @par Change of internal state
358 /// There is no change of the internal Status
359 /// \~english @par Conditions of processing failure
360 /// - Input parameter error (specifying incorrect queue_id)
361 /// --incorrect queue_id:The queue_id of essage which has not been created.
362 /// - Flag corresponding to queue_id doesn't exist
363 /// - EV_ERR_Invalid_ID
364 /// \~english @par Classification
366 /// \~english @par Type
368 /// \~english @par Detail
369 /// Deletes flag with ID specified by the argument.
370 /// The user can only delete flag created by user process.
371 /// Due to deletion, program waiting for this flag (poll or wait) wakes up.
372 /// \~english @see evk_close, evk_ioctl, evk_destroy_queue
373 ////////////////////////////////////////////////////////////////////////////////////
375 EV_ERR EV_destroy_flag(EV_ID queue_id); // NOLINT (readability/nolint)
377 /////////////////////////////////////////////////////////////////////////////////////
378 /// \ingroup EV_destroy_queue
379 /// \~english @par Brief
380 /// Delete queue for message event by the queue_id.
381 /// \~english @param [in] queue_id
382 /// EV_ID - queue_id of the message event
384 /// EV_ID type parameter
386 /// typedef UINT32 EV_ID
388 /// \~english @retval EV_OK Successful completion
389 /// \~english @retval EV_ERR_Invalid_ID Invalid queue_id
390 /// \~english @retval EV_ERR_Fatal Abnormal error
391 /// \~english @par Prerequisite
392 /// Execute EV_create_queue(),EV_create_queue_auto_id() and message queue has already been created.
393 /// \~english @par Change of internal state
394 /// There is no change of the internal Status
395 /// \~english @par Conditions of processing failure
396 /// - Input parameter error (specifying incorrect queue_id)
397 /// --incorrect queue_id:The queue_id of essage which has not been created.
398 /// - Message queue corresponding to flag_id doesn't exist
399 /// - EV_ERR_Invalid_ID
400 /// \~english @par Classification
402 /// \~english @par Type
404 /// \~english @par Detail
405 /// Deletes message queue with ID specified by the argument.
406 /// The user can only delete message queue created by user process.
407 /// Due to deletion, program waiting for this message queue (poll or wait) wakes up.
408 /// \~english @see EV_destroy_flag, evk_close, evk_ioctl, evk_destroy_queue
409 ////////////////////////////////////////////////////////////////////////////////////
411 EV_ERR EV_destroy_queue(EV_ID queue_id); // NOLINT (readability/nolint)
414 /////////////////////////////////////////////////////////////////////////////////////
415 /// \ingroup EV_set_flag
416 /// \~english @par Brief
418 /// \~english @param [in] flag_id
419 /// EV_ID - Flag ID of the event flag
421 /// EV_ID type parameter
423 /// typedef UINT32 EV_ID
425 /// \~english @param [in] bits
426 /// UINT32 - event flag bit pattern
427 /// \~english @retval EV_OK Successful completion
428 /// \~english @retval EV_ERR_Invalid_ID Invalid flag_id
429 /// \~english @retval EV_ERR_Fatal Abnormal error
430 /// \~english @par Prerequisite
431 /// Execute EV_create_flag(),EV_create_flag_auto_id() and flag has already been created.
432 /// \~english @par Change of internal state
433 /// There is no change of the internal Status
434 /// \~english @par Conditions of processing failure
435 /// - Input parameter error (specifying incorrect flag_id)
436 /// --incorrect flag_id:The flag_id of event which has not been created.
437 /// - Flag corresponding to flag_id doesn't exist
438 /// - EV_ERR_Invalid_ID
439 /// - Access failed from kernel space to user space reference area
440 /// - Failed to copy data from user space to kernel space
442 /// \~english @par Classification
444 /// \~english @par Type
446 /// \~english @par Detail
447 /// Sets bit pattern specified by argument to flag of ID specified by argument.
448 /// When setting a plurality of bit patterns in the same flag, "only OR
449 /// operation result of all bit patterns" is held in flag.
450 /// \~english @see evk_open, evk_close, evk_ioctl, evk_store_flag
451 ////////////////////////////////////////////////////////////////////////////////////
453 EV_ERR EV_set_flag(EV_ID flag_id, UINT32 bits); // NOLINT (readability/nolint)
456 /////////////////////////////////////////////////////////////////////////////////////
457 /// \ingroup EV_set_flag64
458 /// \~english @par Brief
460 /// \~english @param [in] flag_id
461 /// EV_ID - Flag ID of the event flag
463 /// EV_ID type parameter
466 /// typedef UINT32 EV_ID
468 /// \~english @param [in] bits
469 /// UINT32 - event flag bit pattern
470 /// \~english @retval EV_OK Successful completion
471 /// \~english @retval EV_ERR_Invalid_ID Invalid flag_id
472 /// \~english @retval EV_ERR_Fatal Abnormal error
473 /// \~english @par Prerequisite
474 /// Execute EV_create_flag(),EV_create_flag_auto_id() and flag has already been created.
475 /// \~english @par Change of internal state
476 /// There is no change of the internal Status
477 /// \~english @par Conditions of processing failure
478 /// - Input parameter error (specifying incorrect flag_id)
479 /// --incorrect flag_id:The flag_id of event which has not been created.
480 /// - Flag corresponding to flag_id doesn't exist
481 /// - EV_ERR_Invalid_ID
482 /// - Access failed from kernel space to user space reference area
483 /// - Failed to copy data from user space to kernel space
485 /// \~english @par Classification
487 /// \~english @par Type
489 /// \~english @par Detail
490 /// Sets bit pattern specified by argument to flag of ID specified by argument.
491 /// When setting a plurality of bit patterns in the same flag, "only OR operation
492 /// result of all bit patterns" is held in flag.
493 /// \~english @see evk_open, evk_close, evk_ioctl, evk_store_flag
494 ////////////////////////////////////////////////////////////////////////////////////
496 EV_ERR EV_set_flag64(EV_ID flag_id, UINT64 bits); // NOLINT (readability/nolint)
498 /////////////////////////////////////////////////////////////////////////////////////
499 /// \ingroup EV_send_message
500 /// \~english @par Brief
501 /// Send Message event
502 /// \~english @param [in] queue_id
503 /// EV_ID - Queue ID of the message destination
505 /// EV_ID type parameter
507 /// typedef UINT32 EV_ID
509 /// \~english @param [in] bytes
510 /// UINT16 - The bytes of the send message
511 /// \~english @param [in] message
512 /// const void * - Pointer to a transmitting byte line
513 /// \~english @param [in] senderInfo
514 /// UINT32 - Message Source(It is specified when it is used for application identification.
515 /// When do not use it, appoint 0.)
516 /// \~english @retval EV_OK Successful completion
517 /// \~english @retval EV_ERR_Invalid_ID Invalid queue_id
518 /// \~english @retval EV_ERR_Busy Queue overflow
519 /// \~english @retval EV_ERR_Fatal Abnormal error
520 /// \~english @par Prerequisite
521 /// Execute EV_create_queue(),EV_create_queue_auto_id() and message queue has already been created.
522 /// \~english @par Change of internal state
523 /// There is no change of the internal Status
524 /// \~english @par Conditions of processing failure
525 /// - Input parameter error (specifying incorrect queue_id)
526 /// --incorrect queue_id:The queue_id of essage which has not been created.
527 /// - Message queue corresponding to queue_id doesn't exist
528 /// - EV_ERR_Invalid_ID
529 /// - Queue overflow in kernel space
531 /// - Access failed from kernel space to user space reference area
532 /// - Failed to copy data from user space to kernel space
533 /// - Invalid queue types
535 /// \~english @par Classification
537 /// \~english @par Type
539 /// \~english @par Detail
540 /// Sends message specified by argument to message queue of ID specified by argument.
541 /// An error occurs when message queue of the specified ID doesn't exist or
542 /// message size exceeds the specified size.
543 /// When message queue is FULL, the processing differs depending on the type of message queue specified
544 /// at the time of creation message queue.
545 /// \~english @see evk_open, evk_close, evk_ioctl, evk_store_message
546 ////////////////////////////////////////////////////////////////////////////////////
548 EV_ERR EV_send_message(EV_ID queue_id, // NOLINT (readability/nolint)
549 UINT16 bytes, // NOLINT (readability/nolint)
550 const void *message, // NOLINT (readability/nolint)
551 UINT32 senderInfo); // NOLINT (readability/nolint)
553 /* \~english Get events in the order of arrivals */
554 ////////////////////////////////////////////////////////////////////////////////
555 /// \ingroup EV_get_next_event
556 /* \~english get events by reaching time */
557 /// \~english @par Brief get the first reached event(non-block)
558 /// \~english @param [out] ev
563 /// typedef unsigned int UINT32;
564 /// typedef UINT32 EV_Type;
565 /// typedef UINT32 EV_ID;
566 /// #define EV_MAX_MESSAGE_LENGTH 2048
567 /// enum ev_message_queue_type {
568 /// EV_MESSAGE_QUEUE_TYPE_BUSY,
569 /// EV_MESSAGE_QUEUE_TYPE_FIFO,
570 /// EV_MESSAGE_QUEUE_TYPE_REPLACE,
585 /// UINT32 senderInfo;
588 /// UINT8 message[EV_MAX_MESSAGE_LENGTH];
592 /// EV_Type type; // please reference ev_message_queue_type.
595 /// EV_Flag64 flag64;
596 /// EV_Message message;
602 /// \~english @retval EV_OK: normal termination
603 /// \~english @retval EV_ERR_Invalid_Thread: unregistered thread
604 /// \~english @retval EV_ERR_Fatal: Fatal error
605 /// \~english @par Prerequisite
607 /// \~english @par Change of internal state
609 /// \~english @par Conditions of processing failure
610 /// - unregistered thread
611 /// - EV_ERR_Invalid_Thread
612 /// - Access failed from kernel space to user space reference area
613 /// - Failed to copy data from user space to kernel space
615 /// \~english @par Classification
617 /// \~english @par Type
619 /// \~english @par Detail
620 /// Get the first reached event which occurred for
621 /// flags or message queues created in current process.
622 /// If there is no event, set ev->type to EV_EVENT_None, then return immediately.
623 /// The event is flag or message is decided by
624 /// the ev->type is EV_EVENT_Flag or EV_EVENT_Message.
625 // \~english @see none
626 ////////////////////////////////////////////////////////////////////////////////
628 EV_ERR EV_get_next_event(/* OUT */EV_Event *ev); // NOLINT (readability/nolint)
630 ////////////////////////////////////////////////////////////////////////////////
631 /// \ingroup EV_peek_next_event
632 /// \~english @par Brief get the first reached event(non-destructive)
633 /// \~english @param [out] ev
636 /// typedef unsigned int UINT32;
637 /// typedef UINT32 EV_Type;
638 /// typedef UINT32 EV_ID;
639 /// #define EV_MAX_MESSAGE_LENGTH 2048
640 /// enum ev_message_queue_type {
641 /// EV_MESSAGE_QUEUE_TYPE_BUSY,
642 /// EV_MESSAGE_QUEUE_TYPE_FIFO,
643 /// EV_MESSAGE_QUEUE_TYPE_REPLACE,
658 /// UINT32 senderInfo;
661 /// UINT8 message[EV_MAX_MESSAGE_LENGTH];
665 /// EV_Type type; // please reference ev_message_queue_type.
668 /// EV_Flag64 flag64;
669 /// EV_Message message;
674 /// \~english @retval EV_OK: normal termination
675 /// \~english @retval EV_ERR_Invalid_Thread: unregistered thread
676 /// \~english @retval EV_ERR_Fatal: Fatal error
677 /// \~english @par Prerequisite
679 /// \~english @par Change of internal state
681 /// \~english @par Conditions of processing failure
682 /// - unregistered thread
683 /// - EV_ERR_Invalid_Thread
684 /// - Access failed from kernel space to user space reference area
685 /// - Failed to copy data from user space to kernel space
687 /// \~english @par Classification
689 /// \~english @par Type
691 /// \~english @par Detail
692 /// Get the first reached event which occurred for
693 /// flags or message queues created in current process non-destructively.
694 /// If the event is not getted from other processes, then call the function of
695 /// EV_get_next_event() or EV_peek_next_event(), it will return a same event.
696 /// If there is no event, set ev->type to EV_EVENT_None, then return immediately.
697 /// The event is flag or message is decided by
698 /// ev->type is EV_EVENT_Flag or EV_EVENT_Message.
699 // \~english @see none
700 ////////////////////////////////////////////////////////////////////////////////
702 EV_ERR EV_peek_next_event(/* OUT */EV_Event *ev); // NOLINT (readability/nolint)
704 /* Get eventflag (ID specified) */
705 /////////////////////////////////////////////////////////////////////////////////////
706 /// \ingroup EV_get_flag
707 /// \~english @par Brief
708 /// Get event flag(non-block)
709 /// \~english @param [in] flag_id
712 /// EV_ID type parameter
714 /// typedef UINT32 EV_ID
716 /// \~english @param [out] flag
717 /// EV_Flag * - event flag structure
719 /// EV_Flag structure
722 /// EV_ID flagID; // Flag ID
723 /// UINT32 bits; // event flag bit pattern
726 /// \~english @retval EV_OK Successful completion
727 /// \~english @retval EV_ERR_Invalid_ID Invalid flag_id
728 /// \~english @retval EV_ERR_Fatal Abnormal error
729 /// \~english @par Prerequisite
730 /// Execute EV_create_flag(),EV_create_flag_auto_id() and flag has already been created.
731 /// \~english @par Change of internal state
732 /// There is no change of the internal Status
733 /// \~english @par Conditions of processing failure
734 /// - Input parameter error
735 /// - Flag corresponding to flag_id doesn't exist
736 /// --incorrect flag_id:The flag_id of event which has not been created.
737 /// - EV_ERR_Invalid_ID
738 /// - Access failed from kernel space to user space reference area
739 /// - Failed to copy data from user space to kernel space
741 /// \~english @par Classification
743 /// \~english @par Type
745 /// \~english @par Detail
746 /// Gets bit pattern specified by argument to flag of ID specified by argument.
747 /// The user can only get flag created by user process, and clear bit pattern of acquired flag.
748 /// An error occurs if flag of the specified ID doesn't exist.
750 /// evk_ioctl, evk_get_event
751 ////////////////////////////////////////////////////////////////////////////////////
753 EV_ERR EV_get_flag(EV_ID flag_id, /* OUT */EV_Flag *flag); // NOLINT (readability/nolint)
755 /////////////////////////////////////////////////////////////////////////////////////
756 /// \ingroup EV_wait_flag
757 /// \~english @par Brief
758 /// Get event flag(block)
759 /// \~english @param [in] flag_id
762 /// EV_ID type parameter
764 /// typedef UINT32 EV_ID
766 /// \~english @param [out] flag
767 /// EV_Flag * - event flag structure
769 /// EV_Flag structure
772 /// EV_ID flagID; // Flag ID
773 /// UINT32 bits; // event flag bit pattern
776 /// \~english @retval EV_OK Successful completion
777 /// \~english @retval EV_ERR_Invalid_ID Invalid flag_id
778 /// \~english @retval EV_ERR_Interrupted signal interrupt
779 /// \~english @retval EV_ERR_Fatal Abnormal error
780 /// \~english @par Prerequisite
781 /// Execute EV_create_flag(),EV_create_flag_auto_id() and flag has already been created.
782 /// \~english @par Change of internal state
783 /// There is no change of the internal Status
784 /// \~english @par Conditions of processing failure
785 /// - Input parameter error
786 /// - Flag corresponding to flag_id doesn't exist
787 /// --incorrect flag_id:The flag_id of event which has not been created.
788 /// - EV_ERR_Invalid_ID
789 /// - Task blocking was canceled by signal interrupt
790 /// - EV_ERR_Interrupted
791 /// - Access failed from kernel space to user space reference area
792 /// - Failed to copy data from user space to kernel space
794 /// \~english @par Classification
796 /// \~english @par Type
798 /// \~english @par Detail
799 /// Gets bit pattern specified by argument to flag of ID specified by argument.
800 /// The user can only get flag created by user process, and clear bit pattern of acquired flag.
801 /// An error occurs if flag of the specified ID doesn't exist.
802 /// If bit pattern is not set in flag, block until bit pattern is set.
803 /// However, if a signal interrupt or corresponding flag is deleted, it will abort and return an error.
805 /// evk_ioctl, evk_get_event
806 ////////////////////////////////////////////////////////////////////////////////////
808 EV_ERR EV_wait_flag(EV_ID flag_id, /* OUT */EV_Flag *flag); // NOLINT (readability/nolint)
810 ////////////////////////////////////////////////////////////////////////////////
811 /// \ingroup EV_peek_flag
812 /// \~english @par Brief get flag event(non-destructive)
813 /// \~english @param [in] flag_id
814 /// ID of message event queue
815 /// \~english @param [out] flag
818 /// EV_ID type parameter
820 /// typedef UINT32 EV_ID
823 /// EV_Flag Structure
830 /// \~english @retval EV_OK: normal termination
831 /// \~english @retval EV_ERR_Invalid_ID: The specified flag ID is not existing,
832 /// or it is not created in current process.
833 /// \~english @retval EV_ERR_Fatal: Fatal error
834 /// \~english @par Prerequisite
836 /// \~english @par Change of internal state
838 /// \~english @par Conditions of processing failure
839 /// - Input parameter error
840 /// - Flag corresponding to flag_id doesn't exist
841 /// --incorrect flag_id:The flag_id of event which has not been created.
842 /// - EV_ERR_Invalid_ID
843 /// - Task blocking was canceled by signal interrupt
844 /// - EV_ERR_Interrupted
845 /// - Access failed from kernel space to user space reference area
846 /// - Failed to copy data from user space to kernel space
848 /// \~english @par Classification
850 /// \~english @par Type
852 /// \~english @par Detail
853 /// Get a flag event whose ID is specified non-destructively.
854 /// If there is no event, just return.
855 /// If there is no event, set flag->flagID to EV_NO_ID.
856 /// You can judge that there is no event, even though flag->bits is 0.
857 // \~english @see none
858 ////////////////////////////////////////////////////////////////////////////////
860 EV_ERR EV_peek_flag(EV_ID flag_id, /* OUT */EV_Flag *flag); // NOLINT (readability/nolint)
862 /* Get eventflag (ID specified) */
863 /////////////////////////////////////////////////////////////////////////////////////
864 /// \ingroup EV_get_flag64
865 /// \~english @par Brief
866 /// Get event flag(non-block)
867 /// \~english @param [in] flag_id
870 /// EV_ID type parameter
872 /// typedef UINT32 EV_ID
874 /// \~english @param [out] flag
875 /// EV_Flag * - event flag structure
877 /// EV_Flag structure
879 /// typedef unsigned int UINT32;
880 /// typedef UINT32 EV_ID
883 /// EV_ID flagID; // Flag ID
884 /// UINT32 bits; // event flag bit pattern
887 /// \~english @retval EV_OK Successful completion
888 /// \~english @retval EV_ERR_Invalid_ID Invalid flag_id
889 /// \~english @retval EV_ERR_Fatal Abnormal error
890 /// \~english @par Prerequisite
891 /// Execute EV_create_flag(),EV_create_flag_auto_id() and flag has already been created.
892 /// \~english @par Change of internal state
893 /// There is no change of the internal Status
894 /// \~english @par Conditions of processing failure
895 /// - Input parameter error
896 /// - Flag corresponding to flag_id doesn't exist
897 /// --incorrect flag_id:The flag_id of event which has not been created.
898 /// - EV_ERR_Invalid_ID
899 /// - Access failed from kernel space to user space reference area
900 /// - Failed to copy data from user space to kernel space
902 /// \~english @par Classification
904 /// \~english @par Type
906 /// \~english @par Detail
907 /// Gets bit pattern specified by argument to flag of ID specified by argument.
908 /// The user can only get flag created by user process, and clear bit pattern of acquired flag.
909 /// An error occurs if flag of the specified ID doesn't exist.
911 /// evk_ioctl, evk_get_event
912 ////////////////////////////////////////////////////////////////////////////////////
914 EV_ERR EV_get_flag64(EV_ID flag_id, /* OUT */EV_Flag64 *flag); // NOLINT (readability/nolint)
916 /////////////////////////////////////////////////////////////////////////////////////
917 /// \ingroup EV_wait_flag64
918 /// \~english @par Brief
919 /// Get event flag(block)
920 /// \~english @param [in] flag_id
923 /// EV_ID type parameter
925 /// typedef UINT32 EV_ID
927 /// \~english @param [out] flag
928 /// EV_Flag * - event flag structure
930 /// EV_Flag structure
932 /// typedef unsigned int UINT32;
933 /// typedef UINT32 EV_ID
936 /// EV_ID flagID; // Flag ID
937 /// UINT32 bits; // event flag bit pattern
940 /// \~english @retval EV_OK Successful completion
941 /// \~english @retval EV_ERR_Invalid_ID Invalid flag_id
942 /// \~english @retval EV_ERR_Interrupted signal interrupt
943 /// \~english @retval EV_ERR_Fatal Abnormal error
944 /// \~english @par Prerequisite
945 /// Execute EV_create_flag(),EV_create_flag_auto_id() and flag has already been created.
946 /// \~english @par Change of internal state
947 /// There is no change of the internal Status
948 /// \~english @par Conditions of processing failure
949 /// - Input parameter error
950 /// - Flag corresponding to flag_id doesn't exist
951 /// --incorrect flag_id:The flag_id of event which has not been created.
952 /// - EV_ERR_Invalid_ID
953 /// - Task blocking was canceled by signal interrupt
954 /// - EV_ERR_Interrupted
955 /// - Access failed from kernel space to user space reference area
956 /// - Failed to copy data from user space to kernel space
958 /// \~english @par Classification
960 /// \~english @par Type
962 /// \~english @par Detail
963 /// Gets bit pattern specified by argument to flag of ID specified by argument.
964 /// The user can only get flag created by user process, and clear bit pattern of acquired flag.
965 /// An error occurs if flag of the specified ID doesn't exist.
966 /// If bit pattern is not set in flag, block until bit pattern is set.
967 /// However, if a signal interrupt or corresponding flag is deleted, it will abort and return an error.
969 /// evk_ioctl, evk_get_event
970 ////////////////////////////////////////////////////////////////////////////////////
972 EV_ERR EV_wait_flag64(EV_ID flag_id, /* OUT */EV_Flag64 *flag); // NOLINT (readability/nolint)
974 ////////////////////////////////////////////////////////////////////////////////
975 /// \ingroup EV_peek_flag64
976 /// \~english @par Brief get flag event(non-destructive)
977 /// \~english @param [in] flag_id
978 /// ID of message event queue
979 /// \~english @param [out] flag
982 /// EV_ID type parameter
984 /// typedef UINT32 EV_ID
987 /// EV_Flag Structure
994 /// \~english @retval EV_OK: normal termination
995 /// \~english @retval EV_ERR_Invalid_ID: The specified flag ID is not existing,
996 /// or it is not created in current process.
997 /// \~english @retval EV_ERR_Fatal: Fatal error
998 /// \~english @par Prerequisite
1000 /// \~english @par Change of internal state
1002 /// \~english @par Conditions of processing failure
1003 /// - Input parameter error
1004 /// - Flag corresponding to flag_id doesn't exist
1005 /// --incorrect flag_id:The flag_id of event which has not been created.
1006 /// - EV_ERR_Invalid_ID
1007 /// - Task blocking was canceled by signal interrupt
1008 /// - EV_ERR_Interrupted
1009 /// - Access failed from kernel space to user space reference area
1010 /// - Failed to copy data from user space to kernel space
1012 /// \~english @par Classification
1014 /// \~english @par Type
1016 /// \~english @par Detail
1017 /// Get a flag event whose ID is specified non-destructively.
1018 /// If there is no event, just return.
1019 /// If there is no event, set flag->flagID to EV_NO_ID.
1020 /// You can judge that there is no event, even though flag->bits is 0.
1021 // \~english @see none
1022 ////////////////////////////////////////////////////////////////////////////////
1024 EV_ERR EV_peek_flag64(EV_ID flag_id, /* OUT */EV_Flag64 *flag); // NOLINT (readability/nolint)
1026 /* Get Message Event (ID specified) */
1027 /////////////////////////////////////////////////////////////////////////////////////
1028 /// \ingroup EV_get_message
1029 /// \~english @par Brief
1030 /// Get message event(non-block)
1031 /// \~english @param [in] queue_id
1032 /// EV_ID - Message queue ID
1034 /// EV_ID type parameter
1036 /// typedef UINT32 EV_ID
1038 /// \~english @param [out] message
1039 /// EV_Message * - Message event structure
1041 /// EV_Message structure
1043 /// typedef unsigned int UINT32;
1044 /// typedef UINT32 EV_ID
1046 /// #define EV_MAX_MESSAGE_LENGTH 2048
1047 /// typedef struct {
1048 /// EV_ID queueID; // ID of message queue
1049 /// UINT32 senderInfo; // Message Source
1050 /// UINT32 length; // length of message
1051 /// UINT32 dummy; // dummy for padding
1052 /// UINT8 message[EV_MAX_MESSAGE_LENGTH]; // message
1055 /// \~english @retval EV_OK Successful completion
1056 /// \~english @retval EV_ERR_Invalid_ID Invalid queue_id
1057 /// \~english @retval EV_ERR_Fatal Abnormal error
1058 /// \~english @par Prerequisite
1059 /// Execute EV_create_queue(),EV_create_queue_auto_id() and message queue has already been created.
1060 /// \~english @par Change of internal state
1061 /// There is no change of the internal Status
1062 /// \~english @par Conditions of processing failure
1063 /// - Input parameter error
1064 /// - Message queue corresponding to queue_id doesn't exist
1065 /// --incorrect queue_id:The queue_id of essage which has not been created.
1066 /// - EV_ERR_Invalid_ID
1067 /// - Access failed from kernel space to user space reference area
1068 /// - Failed to copy data from user space to kernel space
1070 /// \~english @par Classification
1072 /// \~english @par Type
1074 /// \~english @par Detail
1075 /// Gets 1 message specified by argument to message queue of ID specified by argument.
1076 /// The user can only get message queue created by user process, and clear 1 message of acquired message queue.
1077 /// An error occurs if message queue of the specified ID doesn't exist.
1079 /// evk_ioctl, evk_get_event
1080 ////////////////////////////////////////////////////////////////////////////////////
1082 EV_ERR EV_get_message(EV_ID queue_id, /* OUT */EV_Message *message); // NOLINT (readability/nolint)
1084 /////////////////////////////////////////////////////////////////////////////////////
1085 /// \ingroup EV_wait_message
1086 /// \~english @par Brief
1087 /// Get message event(block)
1088 /// \~english @param [in] queue_id
1089 /// EV_ID - Message queue ID
1091 /// EV_ID type parameter
1093 /// typedef UINT32 EV_ID
1095 /// \~english @param [out] message
1096 /// EV_Message * - Message event structure
1098 /// EV_Message structure
1100 /// typedef unsigned int UINT32;
1101 /// typedef UINT32 EV_ID
1103 /// #define EV_MAX_MESSAGE_LENGTH 2048
1104 /// typedef struct {
1105 /// EV_ID queueID; // ID of message queue
1106 /// UINT32 senderInfo; // Message Source
1107 /// UINT32 length; // length of message
1108 /// UINT32 dummy; // dummy for padding
1109 /// UINT8 message[EV_MAX_MESSAGE_LENGTH]; // message
1112 /// \~english @retval EV_OK Successful completion
1113 /// \~english @retval EV_ERR_Invalid_ID Invalid queue_id
1114 /// \~english @retval EV_ERR_Interrupted signal interrupt
1115 /// \~english @retval EV_ERR_Fatal Abnormal error
1116 /// \~english @par Prerequisite
1117 /// Execute EV_create_queue(),EV_create_queue_auto_id() and message queue has already been created.
1118 /// \~english @par Change of internal state
1119 /// There is no change of the internal Status
1120 /// \~english @par Conditions of processing failure
1121 /// - Input parameter error
1122 /// - Message queue corresponding to queue_id doesn't exist
1123 /// --incorrect queue_id:The queue_id of essage which has not been created.
1124 /// - EV_ERR_Invalid_ID
1125 /// - Task blocking was canceled by signal interrupt
1126 /// - EV_ERR_Interrupted
1127 /// - Access failed from kernel space to user space reference area
1128 /// - Failed to copy data from user space to kernel space
1130 /// \~english @par Classification
1132 /// \~english @par Type
1134 /// \~english @par Detail
1135 /// Gets 1 message specified by argument to message queue of ID specified by argument.
1136 /// The user can only get message queue created by user process, and clear 1 message of acquired message queue.
1137 /// An error occurs if message queue of the specified ID doesn't exist.
1138 /// If message is not set in message queue, block until message is sent.
1139 /// However, if a signal interrupt or corresponding message queue is deleted, it will abort and return an error.
1141 /// evk_ioctl, evk_get_event
1142 ////////////////////////////////////////////////////////////////////////////////////
1144 EV_ERR EV_wait_message(EV_ID queue_id, /* OUT */EV_Message *message); // NOLINT (readability/nolint)
1146 ////////////////////////////////////////////////////////////////////////////////
1147 /// \ingroup EV_peek_message
1148 /// \~english @par Brief get message event(non-destructive)
1149 /// \~english @param [in] queue_id
1150 /// ID of message event queue
1151 /// \~english @param [out] message
1152 /// message event queue struct
1156 /// typedef UINT32 EV_ID
1160 /// EV_Message struct
1162 /// #define EV_MAX_MESSAGE_LENGTH 2048
1163 /// typedef struct {
1165 /// UINT32 senderInfo;
1168 /// UINT8 message[EV_MAX_MESSAGE_LENGTH];
1171 /// \~english @retval EV_OK: normal termination
1172 /// \~english @retval EV_ERR_Invalid_ID: The specified queue ID is not existing,
1173 /// or it is not created in current process.
1174 /// \~english @retval EV_ERR_Fatal: Fatal error
1175 /// \~english @par Prerequisite
1177 /// \~english @par Change of internal state
1178 /// There is no change of the internal Status
1179 /// \~english @par Conditions of processing failure
1180 /// - Input parameter error
1181 /// - Message queue corresponding to queue_id doesn't exist
1182 /// --incorrect queue_id:The queue_id of essage which has not been created.
1183 /// - EV_ERR_Invalid_ID
1184 /// - Access failed from kernel space to user space reference area
1185 /// - Failed to copy data from user space to kernel space
1187 /// \~english @par Classification
1189 /// \~english @par Type
1191 /// \~english @par Detail
1192 /// Get a message event queue whose ID is specified non-destructively.
1193 /// If there is no event, just return.
1194 /// If there is no event, set message->queueID to EV_NO_ID.
1195 /// It is the same with EV_get_message(), except the message is remained in the queue.
1196 // \~english @see none
1197 ////////////////////////////////////////////////////////////////////////////////
1199 EV_ERR EV_peek_message(EV_ID queue_id, /* OUT */EV_Message *message); // NOLINT (readability/nolint)
1201 /* \~english Get events(with search criteria) */
1203 ////////////////////////////////////////////////////////////////////////////////
1204 /// \ingroup EV_find_message_by_sender
1205 /* \~english get event(with search sender infomation condition) */
1206 /// \~english @param [in] queue_id
1207 /// ID of message event queue
1208 /// \~english @param [in] senderInfo
1209 /// sender information
1210 /// \~english @param [out] message
1211 /// message event struct
1213 /// EV_ID type parameter
1215 /// typedef UINT32 EV_ID
1218 /// EV_Message struct
1220 /// #define EV_MAX_MESSAGE_LENGTH 2048
1221 /// typedef struct {
1223 /// UINT32 senderInfo;
1226 /// UINT8 message[EV_MAX_MESSAGE_LENGTH];
1229 /// \~english @retval EV_OK: normal termination
1230 /// \~english @retval EV_ERR_Invalid_ID: The specified queue ID is not existing,
1231 /// or it is not created in current process.
1232 /// \~english @retval EV_ERR_Fatal: Fatal error
1233 /// \~english @par Prerequisite
1235 /// \~english @par Change of internal state
1237 /// \~english @par Conditions of processing failure
1238 /// - Input parameter error (specifying incorrect queue_id)
1239 /// --incorrect queue_id:The queue_id of essage which has not been created.
1240 /// - Not find same sender information's message according to input sender information information
1241 /// - EV_ERR_Invalid_ID
1242 /// - Securing free space of thread information management table (malloc) Failure
1243 /// - Access failed from kernel space to user space reference area
1244 /// - Failed to copy data from user space to kernel space
1245 /// - Message queue pool is NULL
1246 /// - Message queue generation corresponding to queue_id failed
1248 /// \~english @par Classification
1250 /// \~english @par Type
1252 /// \~english @par Detail
1253 /// If there is a event whose sender information is same with
1254 /// any event in message event queue whose ID is specified, get the event and delete it from queue.
1255 /// If such a message is not existing,
1256 /// set message->queueID to EV_NO_ID, then return.
1257 // \~english @see none
1258 ////////////////////////////////////////////////////////////////////////////////
1260 EV_ERR EV_find_message_by_sender(EV_ID queue_id, UINT32 senderInfo, EV_Message *message); // NOLINT (readability/nolint)
1262 ////////////////////////////////////////////////////////////////////////////////
1263 /// \ingroup EV_find_message_by_content
1264 /// \~english @par Brief get message event(search with contents)
1265 /// \~english @param [in] queue_id
1266 /// ID of message event queue
1267 /// \~english @param [in] bytes
1268 /// size of compare bytes
1269 /// \~english @param [in] compare_bytes
1270 /// bytes that used to campare the contents
1271 /// \~english @param [out] message
1272 /// message event struct
1274 /// EV_ID type parameter
1276 /// typedef UINT32 EV_ID
1279 /// EV_Message struct
1281 /// #define EV_MAX_MESSAGE_LENGTH 2048
1282 /// typedef struct {
1284 /// UINT32 senderInfo;
1287 /// UINT8 message[EV_MAX_MESSAGE_LENGTH];
1290 /// \~english @retval EV_OK: normal termination
1291 /// \~english @retval EV_ERR_Invalid_ID: The specified queue ID is not existing,
1292 /// or it is not created in current process.
1293 /// \~english @retval EV_ERR_Fatal: Fatal error
1294 /// \~english @par Prerequisite
1296 /// \~english @par Change of internal state
1298 /// \~english @par Conditions of processing failure
1299 /// - Input parameter error (specifying incorrect queue_id)
1300 /// --incorrect queue_id:The queue_id of essage which has not been created.
1301 /// - Not find contents's message according to input contents information
1302 /// - EV_ERR_Invalid_ID
1303 /// - Securing free space of thread information management table (malloc) Failure
1304 /// - Access failed from kernel space to user space reference area
1305 /// - Failed to copy data from user space to kernel space
1306 /// - Message queue pool is NULL
1307 /// - Message queue generation corresponding to queue_id failed
1309 /// \~english @par Classification
1311 /// \~english @par Type
1313 /// \~english @par Detail
1314 /// If the event in compare bytes is same with
1315 /// any event in message event queue whose ID is specified,
1316 /// get the event and delete it from queue.
1317 /// If such a message is not existing, set message->queueID to EV_NO_ID, then return.
1318 // \~english @see none
1319 ////////////////////////////////////////////////////////////////////////////////
1321 EV_ERR EV_find_message_by_content(EV_ID queue_id, // NOLINT (readability/nolint)
1322 UINT16 length, // NOLINT (readability/nolint)
1323 const void *compare_bytes, // NOLINT (readability/nolint)
1324 /* OUT */EV_Message *message); // NOLINT (readability/nolint)
1326 /////////////////////////////////////////////////////////////////////////////////////
1327 /// \ingroup EV_get_flag_fd
1328 /// \~english @par Brief
1329 /// Obtain fd for polling flag event
1330 /// \~english @param [in] flag_id
1333 /// EV_ID type parameter
1335 /// typedef UINT32 EV_ID
1337 /// \~english @param [out] fd
1338 /// int * - event flag queue fd for Polling
1339 /// \~english @retval EV_OK Successful completion
1340 /// \~english @retval EV_ERR_Invalid_ID Invalid flag_id
1341 /// \~english @par Prerequisite
1342 /// Execute EV_create_flag(),EV_create_flag_auto_id() and flag has already been created.
1343 /// \~english @par Change of internal state
1344 /// There is no change of the internal Status
1345 /// \~english @par Conditions of processing failure
1346 /// - Input parameter error
1347 /// --incorrect flag_id:The flag_id of event which has not been created.
1348 /// - Flag corresponding to flag_id doesn't exist
1349 /// - EV_ERR_Invalid_ID
1350 /// \~english @par Classification
1352 /// \~english @par Type
1354 /// \~english @par Detail
1355 /// Gets fd(File Descriptor) corresponding to flag of ID specified by argument.
1356 /// The user can only get flag created by user process .
1357 /// This fd(File Descriptor) can be used only for designation to poll / select, and operation when other
1358 /// operations are performed is not guaranteed.
1359 /// At the time of poll, only POLLIN can be specified, and at the time of select,
1360 /// it is possible to check only whether it can be read.
1361 /// Also, if flag is deleted in poll / select, it exits poll / select. * In case of poll, POLLERR is set.
1362 /// When calling the same ID more than once, it returns the same fd(File Descriptor)
1363 /// each time (unless destroy / create is done).
1366 ////////////////////////////////////////////////////////////////////////////////////
1368 EV_ERR EV_get_flag_fd(EV_ID flag_id, /* OUT */int *fd); // NOLINT (readability/nolint)
1370 /////////////////////////////////////////////////////////////////////////////////////
1371 /// \ingroup EV_get_queue_fd
1372 /// \~english @par Brief
1373 /// Obtain fd for polling message event
1374 /// \~english @param [in] flag_id
1377 /// EV_ID type parameter
1379 /// typedef UINT32 EV_ID
1381 /// \~english @param [out] fd
1382 /// int * - Message queue fd for Polling
1383 /// \~english @retval EV_OK Successful completion
1384 /// \~english @retval EV_ERR_Invalid_ID Invalid queue_id
1385 /// \~english @par Prerequisite
1386 /// Execute EV_create_queue(),EV_create_queue_auto_id() and message queue has already been created.
1387 /// \~english @par Change of internal state
1388 /// There is no change of the internal Status
1389 /// \~english @par Conditions of processing failure
1390 /// - Input parameter error
1391 /// - Message queue corresponding to queue_id doesn't exist
1392 /// --incorrect queue_id:The queue_id of essage which has not been created.
1393 /// - EV_ERR_Invalid_ID
1394 /// \~english @par Classification
1396 /// \~english @par Type
1398 /// \~english @par Detail
1399 /// Gets fd(File Descriptor) corresponding to message queue of ID specified by argument.
1400 /// The user can only get message queue created by user process .
1401 /// This fd(File Descriptor) can be used only for designation to poll / select,
1402 /// and operation when other operations are performed is not guaranteed.
1403 /// At the time of poll, only POLLIN can be specified, and at the time of select,
1404 /// it is possible to check only whether it can be read.
1405 /// Also, if message queue is deleted in poll / select, it exits poll / select.
1406 /// * In case of poll, POLLERR is set.
1407 /// When calling the same ID more than once, it returns the same fd(File Descriptor)
1408 /// each time (unless destroy / create is done).
1411 ////////////////////////////////////////////////////////////////////////////////////
1413 EV_ERR EV_get_queue_fd(EV_ID queue_id, /* OUT */int *fd); // NOLINT (readability/nolint)
1415 /* \~english Functions that specify the module ID (16 bits) instead of the flag ID and queue ID */
1417 ////////////////////////////////////////////////////////////////////////////////
1418 /// \ingroup EV_moduleID_to_flag_id
1419 /* \~english function group used to specify moduleID(16bit) instead of flag_id, queue_id */
1420 /// \~english @par Brief change from moduleID to flag_id
1421 /// \~english @param [in] m_id
1423 /// \~english @retval flag_id
1425 /// typedef UINT32 EV_ID
1427 /// \~english @par Prerequisite
1429 /// \~english @par Change of internal state
1431 /// \~english @par Conditions of processing failure
1433 /// \~english @par Classification
1435 /// \~english @par Type
1437 /// \~english @par Detail
1438 /// You can not use this function to
1439 /// create a multiple of flags with one moduleID. return error:EV_ERR_Exist.
1440 /// This function is only used for generating one event by one module ID.
1441 // \~english @see none
1442 ////////////////////////////////////////////////////////////////////////////////
1444 EV_ID EV_moduleID_to_flagID(UINT16 m_id); // NOLINT (readability/nolint)
1446 ////////////////////////////////////////////////////////////////////////////////
1447 /// \ingroup EV_moduleID_to_flag64ID
1448 /// \~english @par Brief change from moduleID to 64bit flag_id
1449 /// \~english @param [in] m_id
1452 /// EV_ID type parameter
1454 /// typedef UINT32 EV_ID
1456 /// \~english @retval 64bit flag_id
1457 /// \~english @par Prerequisite
1459 /// \~english @par Change of internal state
1461 /// \~english @par Conditions of processing failure
1463 /// \~english @par Classification
1465 /// \~english @par Type
1467 /// \~english @par Detail
1468 /// You can not use this function to
1469 /// create a multiple of flags with one moduleID. return error:EV_ERR_Exist.
1470 /// This function is only used for generating one event by one module ID.
1471 // \~english @see none
1472 ////////////////////////////////////////////////////////////////////////////////
1474 EV_ID EV_moduleID_to_flag64ID(UINT16 m_id); // NOLINT (readability/nolint)
1476 ////////////////////////////////////////////////////////////////////////////////
1477 /// \ingroup EV_moduleID_to_queueID
1478 /// \~english @par Brief change from moduleID to queue_id
1479 /// \~english @param [in] m_id
1482 /// EV_ID type parameter
1484 /// typedef UINT32 EV_ID
1486 /// \~english @retval queue_id
1487 /// \~english @par Prerequisite
1489 /// \~english @par Change of internal state
1491 /// \~english @par Conditions of processing failure
1493 /// \~english @par Classification
1495 /// \~english @par Type
1497 /// \~english @par Detail
1498 /// You can not use this function to
1499 /// create a multiple of queues with one moduleID.
1500 // \~english @see none
1501 ////////////////////////////////////////////////////////////////////////////////
1503 EV_ID EV_moduleID_to_queueID(UINT16 m_id); // NOLINT (readability/nolint)
1505 ////////////////////////////////////////////////////////////////////////////////
1506 /// \ingroup EV_create_flag_by_mID
1507 /// \~english @par Brief create flag(moduleID specified)
1508 /// \~english @param [in] m_id
1510 /// \~english @retval EV_OK Successful completion
1511 /// \~english @retval EV_ERR_Invalid_ID Invalid flag_id
1512 /// \~english @retval EV_ERR_Thread_Over The MAX of event thread.
1513 /// \~english @retval EV_ERR_Exist Duplication Error
1514 /// \~english @retval EV_ERR_Fatal Abnormal error
1515 /// \~english @par Prerequisite
1516 /// There is no prerequisite
1517 /// \~english @par Change of internal state
1518 /// There is no change of the internal Status
1519 /// \~english @par Conditions of processing failure
1520 /// - Input parameter error (specifying incorrect flag_id)
1521 /// --incorrect flag_id:The ID is not created by function of EV_moduleID_to_flagID ().
1522 /// - EV_ERR_Invalid_ID
1523 /// - Startup thread upper limit (16) error
1524 /// - EV_ERR_Thread_Over
1525 /// - flag_id registered in launch thread
1526 /// - Flag corresponding to flag_id already exists
1528 /// - Securing free space of thread information management table (malloc) Failure
1529 /// - Flag pool is NULL
1530 /// - Flag generation corresponding to flag_id failed
1532 /// \~english @par Classification
1534 /// \~english @par Type
1536 /// \~english @par Detail
1537 /// You can not use this function to
1538 /// create a multiple of flags with one moduleID.return error:EV_ERR_Exist.
1539 /// This function is only used for generating one event by one module ID.
1540 // \~english @see EV_create_flag
1541 ////////////////////////////////////////////////////////////////////////////////
1543 EV_ERR EV_create_flag_by_mID(UINT16 m_id); // NOLINT (readability/nolint)
1545 ////////////////////////////////////////////////////////////////////////////////
1546 /// \ingroup EV_create_flag64_by_mID
1547 /// \~english @par Brief create 64bit flag(moduleID specified)
1548 /// \~english @param [in] m_id
1550 /// \~english @retval EV_OK Successful completion
1551 /// \~english @retval EV_ERR_Invalid_ID Invalid flag_id
1552 /// \~english @retval EV_ERR_Thread_Over The MAX of event thread.
1553 /// \~english @retval EV_ERR_Exist Duplication Error
1554 /// \~english @retval EV_ERR_Fatal Abnormal error
1555 /// \~english @par Prerequisite
1556 /// There is no prerequisite
1557 /// \~english @par Change of internal state
1558 /// There is no change of the internal Status
1559 /// \~english @par Conditions of processing failure
1560 /// - Input parameter error (specifying incorrect flag_id)
1561 /// --incorrect flag_id:The ID is not created by function of EV_moduleID_to_flag64ID ().
1562 /// - EV_ERR_Invalid_ID
1563 /// - Startup thread upper limit (16) error
1564 /// - EV_ERR_Thread_Over
1565 /// - flag_id registered in launch thread
1566 /// - Flag corresponding to flag_id already exists
1568 /// - Securing free space of thread information management table (malloc) Failure
1569 /// - Flag pool is NULL
1570 /// - Flag generation corresponding to flag_id failed
1572 /// \~english @par Classification
1574 /// \~english @par Type
1576 /// \~english @par Detail
1577 /// You can not use this function to
1578 /// create a multiple of flags with one moduleID. return error:EV_ERR_Exist.
1579 /// This function is only used for generating one event by one module ID.
1580 // \~english @see EV_create_flag64
1581 ////////////////////////////////////////////////////////////////////////////////
1583 EV_ERR EV_create_flag64_by_mID(UINT16 m_id); // NOLINT (readability/nolint)
1585 ////////////////////////////////////////////////////////////////////////////////
1586 /// \ingroup EV_create_queue_by_mID
1587 /// \~english @par Brief create queue(moduleID specified)
1588 /// \~english @param [in] m_id
1590 /// \~english @param [in] length
1591 /// length of message queue
1592 /// \~english @param [in] max_bytes
1593 /// one max bytes for message
1594 /// \~english @param [in] type
1595 /// treat type of receiving events even though the queue is full
1597 /// ev_message_queue_type struct
1599 /// enum ev_message_queue_type {
1600 /// EV_MESSAGE_QUEUE_TYPE_BUSY,
1601 /// EV_MESSAGE_QUEUE_TYPE_FIFO,
1602 /// EV_MESSAGE_QUEUE_TYPE_REPLACE,
1605 /// \~english @retval EV_OK: normal termination
1606 /// \~english @retval EV_ERR_Invalid_ID: set en invalid flag ID
1607 /// \~english @retval EV_ERR_Thread_Over The MAX of event thread.
1608 /// \~english @retval EV_ERR_Exist: a same flag ID is existing
1609 /// \~english @retval EV_ERR_Fatal: Fatal error
1610 /// \~english @par Prerequisite
1611 /// There is no prerequisite
1612 /// \~english @par Change of internal state
1613 /// There is no change of the internal Status
1614 /// \~english @par Conditions of processing failure
1615 /// - Input parameter error (specifying incorrect queue_id)
1616 /// --incorrect queue_id:The queue_id of essage which has not been created.
1617 /// - EV_ERR_Invalid_ID
1618 /// - Startup thread upper limit (16) error
1619 /// - EV_ERR_Thread_Over
1620 /// - queue_id registered in launch thread
1621 /// - Message queue corresponding to queue_id already exists
1623 /// - Securing free space of thread information management table (malloc) Failure
1624 /// - Access failed from kernel space to user space reference area
1625 /// - Failed to copy data from user space to kernel space
1626 /// - Message queue pool is NULL
1627 /// - Message queue generation corresponding to queue_id failed
1629 /// \~english @par Classification
1631 /// \~english @par Type
1633 /// \~english @par Detail
1634 /// You can not use this function to
1635 /// create a multiple of queues with one moduleID.
1636 // \~english @see EV_create_queue
1637 ////////////////////////////////////////////////////////////////////////////////
1640 EV_create_queue_by_mID(UINT16 m_id, // NOLINT (readability/nolint)
1641 UINT8 length, // NOLINT (readability/nolint)
1642 UINT16 max_bytes, // NOLINT (readability/nolint)
1643 EV_Message_Queue_Type type); // NOLINT (readability/nolint)
1645 ////////////////////////////////////////////////////////////////////////////////
1646 /// \ingroup EV_destroy_flag_by_mID
1647 /// \~english @par Brief delete flag(moduleID specified)
1648 /// \~english @param [in] m_id
1650 /// \~english @par length [in]length of message queue
1651 /// \~english @par max_bytes [in]one max bytes for message
1652 /// \~english @par type [in]treat type of receiving events even though the queue is full
1653 /// \~english @retval EV_OK: normal termination
1654 /// \~english @retval EV_ERR_Invalid_ID: set en invalid flag ID
1655 /// \~english @retval EV_ERR_Fatal: Fatal error
1656 /// \~english @par Prerequisite
1658 /// \~english @par Change of internal state
1660 /// \~english @par Conditions of processing failure
1661 /// - Input parameter error (specifying incorrect flag_id)
1662 /// --incorrect flag_id:The flag_id of event/message which has not been created.
1663 /// - Flag corresponding to queue_id doesn't exist
1664 /// - EV_ERR_Invalid_ID
1665 /// \~english @par Classification
1667 /// \~english @par Type
1669 /// \~english @par Detail
1670 /// \~english You can not use this function to
1671 /// \~english create a multiple of flags with one moduleID. return error:EV_ERR_Exist.
1672 /// This function is only used for generating one event by one module ID.
1673 // \~english @see EV_destroy_flag
1674 ////////////////////////////////////////////////////////////////////////////////
1676 EV_ERR EV_destroy_flag_by_mID(UINT16 m_id); // NOLINT (readability/nolint)
1678 ////////////////////////////////////////////////////////////////////////////////
1679 /// \ingroup EV_destroy_queue_by_mID
1680 /// \~english @par Brief delete queue(moduleID specified)
1681 /// \~english @param [in] m_id
1683 /// \~english @retval EV_OK Successful completion
1684 /// \~english @retval EV_ERR_Invalid_ID Invalid queue_id
1685 /// \~english @retval EV_ERR_Fatal Abnormal error
1686 /// \~english @par Prerequisite
1688 /// \~english @par Change of internal state
1689 /// There is no change of the internal Status
1690 /// \~english @par Conditions of processing failure
1691 /// - Input parameter error (specifying incorrect queue_id)
1692 /// --incorrect queue_id:The queue_id of essage which has not been created.
1693 /// - Message queue corresponding to flag_id doesn't exist
1694 /// - EV_ERR_Invalid_ID
1695 /// \~english @par Classification
1697 /// \~english @par Type
1699 /// \~english @par Detail
1700 /// You can not use this function to
1701 /// create a multiple of queues with one moduleID
1702 // \~english @see EV_destroy_queue
1703 ////////////////////////////////////////////////////////////////////////////////
1705 EV_ERR EV_destroy_queue_by_mID(UINT16 m_id); // NOLINT (readability/nolint)
1707 ////////////////////////////////////////////////////////////////////////////////
1708 /// \ingroup EV_set_flag_by_mID
1709 /// \~english @par Brief send flag(moduleID specified)
1710 /// \~english @param [in] m_id
1712 /// \~english @param [in] bits
1714 /// \~english @retval EV_OK: normal termination
1715 /// \~english @retval EV_ERR_Invalid_ID: set en invalid flag ID
1716 /// \~english @retval EV_ERR_Fatal: Fatal error
1717 /// \~english @par Prerequisite
1719 /// \~english @par Change of internal state
1720 /// There is no change of the internal Status
1721 /// \~english @par Conditions of processing failure
1722 /// - Input parameter error (specifying incorrect flag_id)
1723 /// --incorrect flag_id:The flag_id of event which has not been created.
1724 /// - Flag corresponding to flag_id doesn't exist
1725 /// - EV_ERR_Invalid_ID
1726 /// - Access failed from kernel space to user space reference area
1727 /// - Failed to copy data from user space to kernel space
1729 /// \~english @par Classification
1731 /// \~english @par Type
1733 /// \~english @par Detail
1734 /// Sets bit pattern specified by argument to flag of ID specified by argument.
1735 /// When setting a plurality of bit patterns in the same flag,
1736 /// "only OR operation result of all bit patterns" is held in flag.
1737 // \~english @see EV_set_flag
1738 ////////////////////////////////////////////////////////////////////////////////
1740 EV_ERR EV_set_flag_by_mID(UINT16 m_id, UINT32 bits); // NOLINT (readability/nolint)
1742 ////////////////////////////////////////////////////////////////////////////////
1743 /// \ingroup EV_set_flag64_by_mID
1744 /// \~english @par Brief send 64bit flag(moduleID specified)
1745 /// \~english @param [in] m_id
1747 /// \~english @param [in] bits
1749 /// \~english @retval EV_OK Successful completion
1750 /// \~english @retval EV_ERR_Invalid_ID Invalid flag_id
1751 /// \~english @retval EV_ERR_Fatal Abnormal error
1752 /// \~english @par Prerequisite
1754 /// \~english @par Change of internal state
1755 /// There is no change of the internal Status
1756 /// \~english @par Conditions of processing failure
1757 /// - Input parameter error (specifying incorrect flag_id)
1758 /// --incorrect flag_id:The flag_id of event which has not been created.
1759 /// - Flag corresponding to flag_id doesn't exist
1760 /// - EV_ERR_Invalid_ID
1761 /// - Access failed from kernel space to user space reference area
1762 /// - Failed to copy data from user space to kernel space
1764 /// \~english @par Classification
1766 /// \~english @par Type
1768 /// \~english @par Detail
1769 /// Sets bit pattern specified by argument to flag of ID specified by argument.
1770 /// When setting a plurality of bit patterns in the same flag, "only
1771 /// OR operation result of all bit patterns" is held in flag.
1772 // \~english @see EV_set_flag64
1773 ////////////////////////////////////////////////////////////////////////////////
1775 EV_ERR EV_set_flag64_by_mID(UINT16 m_id, UINT64 bits); // NOLINT (readability/nolint)
1777 ////////////////////////////////////////////////////////////////////////////////
1778 /// \ingroup EV_send_message_by_mID
1779 /// \~english @par Brief send message(moduleID specified)
1780 /// \~english @param [in] m_id
1782 /// \~english @param [in] bytes
1783 /// number of send bytes
1784 /// \~english @param [in] message
1785 /// pointer to sender contents
1786 /// \~english @param [in] senderInfo
1787 /// sender information
1788 /// \~english @retval EV_OK Successful completion
1789 /// \~english @retval EV_ERR_Invalid_ID Invalid queue_id
1790 /// \~english @retval EV_ERR_Busy Queue overflow
1791 /// \~english @retval EV_ERR_Fatal Abnormal error
1792 /// \~english @par Prerequisite
1793 /// Execute EV_create_queue(),EV_create_queue_auto_id() and message queue has already been created.
1794 /// \~english @par Change of internal state
1795 /// There is no change of the internal Status
1796 /// \~english @par Conditions of processing failure
1797 /// - Input parameter error (specifying incorrect queue_id)
1798 /// --incorrect queue_id:The queue_id of essage which has not been created.
1799 /// - Message queue corresponding to queue_id doesn't exist
1800 /// - EV_ERR_Invalid_ID
1801 /// - Queue overflow in kernel space
1803 /// - Access failed from kernel space to user space reference area
1804 /// - Failed to copy data from user space to kernel space
1805 /// - Invalid queue types
1807 /// \~english @par Classification
1809 /// \~english @par Type
1811 /// \~english @par Detail
1812 /// Sends message specified by argument to message moduleID specified by argument.
1813 /// An error occurs when message queue of the specified ID doesn't exist
1814 /// or message size exceeds the specified size.
1815 /// When message queue is FULL, the processing differs depending on the type
1816 /// of message queue specified at the time of creation message queue.
1817 /// \~english @see evk_open, evk_close, evk_ioctl, evk_store_message
1818 ////////////////////////////////////////////////////////////////////////////////
1821 EV_send_message_by_mID(UINT16 m_id, // NOLINT (readability/nolint)
1822 UINT16 bytes, // NOLINT (readability/nolint)
1823 const void *message, // NOLINT (readability/nolint)
1824 UINT32 senderInfo); // NOLINT (readability/nolint)
1826 /** @}*/ // end of event_library
1827 /** @}*/ // end of other_service
1828 /** @}*/ // end of BaseSystem
1831 * @brief Method to specify module IDs as flag IDs and queue IDs
1833 * The function with module ID as an argument directly can be used in the case of that created only
1834 * one flag and queue in the module, other than using macros EV_Flag_ID_Base() or EV_Queue_ID_Base().
1835 * @see EV_create_flag_by_mID
1836 * @see EV_create_queue_by_mID
1837 * @see EV_destroy_flag_by_mID
1838 * @see EV_destroy_queue_by_mID
1839 * @see EV_set_flag_by_mID
1840 * @see EV_send_message_by_mID
1842 * So the following API can be used to convert IDs created using above method to flag IDs or queue ID
1843 * when pass them to other modules.
1844 * @see EV_moduleID_to_flagID(UINT16 m_id)
1845 * @see EV_moduleID_to_queueID(UINT16 m_id)
1852 #endif /* __cplusplus */
1854 #endif /* !__KERNEL__ */
1856 #endif // OTHERSERVICE_EV_LIB_H_