make event api change
This commit is contained in:
parent
f0f7388c0d
commit
606aac687b
@ -1,4 +1,5 @@
|
||||
#include "Event.h"
|
||||
|
||||
namespace EVENT {
|
||||
EventId_t getEventId(Event event) {
|
||||
return (event & 0xFFFF);
|
||||
@ -8,7 +9,8 @@ EventSeverity_t getSeverity(Event event) {
|
||||
return ((event >> 16) & 0xFF);
|
||||
}
|
||||
|
||||
Event makeEvent(EventId_t eventId, EventSeverity_t eventSeverity) {
|
||||
return (eventSeverity << 16) + (eventId & 0xFFFF);
|
||||
Event makeEvent(uint8_t subsystemId, uint8_t uniqueEventId,
|
||||
EventSeverity_t eventSeverity) {
|
||||
return (eventSeverity << 16) + (subsystemId * 100) + uniqueEventId;
|
||||
}
|
||||
}
|
||||
|
@ -18,9 +18,10 @@ EventId_t getEventId(Event event);
|
||||
|
||||
EventSeverity_t getSeverity(Event event);
|
||||
|
||||
Event makeEvent(EventId_t eventId, EventSeverity_t eventSeverity);
|
||||
|
||||
Event makeEvent(uint8_t subsystemId, uint8_t uniqueEventId,
|
||||
EventSeverity_t eventSeverity);
|
||||
}
|
||||
|
||||
namespace SEVERITY {
|
||||
static const EventSeverity_t INFO = 1;
|
||||
static const EventSeverity_t LOW = 2;
|
||||
|
Loading…
Reference in New Issue
Block a user