1 | /* |
---|
2 | ------------------------------------------------------------------------ |
---|
3 | |
---|
4 | COPYRIGHT (c) 1997 |
---|
5 | Objective Design Systems Ltd Pty (ODS) |
---|
6 | All rights reserved (R) Objective Design Systems Ltd Pty |
---|
7 | |
---|
8 | The license and distribution terms for this file may be found in the |
---|
9 | file LICENSE in this distribution or at |
---|
10 | http://www.rtems.org/license/LICENSE. |
---|
11 | |
---|
12 | ------------------------------------------------------------------------ |
---|
13 | |
---|
14 | See header file. |
---|
15 | |
---|
16 | ------------------------------------------------------------------------ |
---|
17 | */ |
---|
18 | |
---|
19 | #include <rtems++/rtemsEvent.h> |
---|
20 | |
---|
21 | /* ---- |
---|
22 | rtemsEvent |
---|
23 | */ |
---|
24 | |
---|
25 | rtemsEvent::rtemsEvent(const char *name_str, uint32_t node) |
---|
26 | : name(rtems_build_name('S', 'E', 'L', 'F')), |
---|
27 | id(RTEMS_SELF) |
---|
28 | { |
---|
29 | connect(name_str, node); |
---|
30 | } |
---|
31 | |
---|
32 | rtemsEvent::rtemsEvent(const rtemsEvent& event) |
---|
33 | { |
---|
34 | name = event.name; |
---|
35 | id = event.id; |
---|
36 | } |
---|
37 | |
---|
38 | rtemsEvent::rtemsEvent() |
---|
39 | : name(rtems_build_name('S', 'E', 'L', 'F')), |
---|
40 | id(RTEMS_SELF) |
---|
41 | { |
---|
42 | } |
---|
43 | |
---|
44 | rtemsEvent::~rtemsEvent() |
---|
45 | { |
---|
46 | } |
---|
47 | |
---|
48 | const rtemsEvent& rtemsEvent::operator=(const rtemsEvent& event) |
---|
49 | { |
---|
50 | name = event.name; |
---|
51 | id = event.id; |
---|
52 | |
---|
53 | return *this; |
---|
54 | } |
---|
55 | |
---|
56 | const rtems_status_code rtemsEvent::connect(const char *name_str, |
---|
57 | const uint32_t node) |
---|
58 | { |
---|
59 | name = rtems_build_name(name_str[0], |
---|
60 | name_str[1], |
---|
61 | name_str[2], |
---|
62 | name_str[3]); |
---|
63 | |
---|
64 | set_status_code(rtems_task_ident(name, node, &id)); |
---|
65 | |
---|
66 | if (unsuccessful()) |
---|
67 | { |
---|
68 | name = rtems_build_name('S', 'E', 'L', 'F'); |
---|
69 | id = RTEMS_SELF; |
---|
70 | } |
---|
71 | |
---|
72 | return last_status_code(); |
---|
73 | } |
---|