Line data Source code
1 : /********************************************************************************
2 : * Copyright (c) 2026 Accenture
3 : *
4 : * This program and the accompanying materials are made available under the
5 : * terms of the Apache License Version 2.0 which is available at
6 : * https://www.apache.org/licenses/LICENSE-2.0
7 : *
8 : * SPDX-License-Identifier: Apache-2.0
9 : ********************************************************************************/
10 :
11 : #include "busid/BusId.h"
12 :
13 : namespace common
14 : {
15 : namespace busid
16 : {
17 :
18 : #define BUS_ID_NAME(BUS) \
19 : case ::busid::BUS: return #BUS
20 :
21 92 : char const* BusIdTraits::getName(uint8_t index)
22 : {
23 92 : switch (index)
24 : {
25 1 : BUS_ID_NAME(SELFDIAG);
26 0 : BUS_ID_NAME(CAN_0);
27 0 : BUS_ID_NAME(ETH_0);
28 0 : BUS_ID_NAME(ETH_1);
29 91 : default: return "INVALID";
30 : }
31 : }
32 :
33 : } // namespace busid
34 : } // namespace common
|