[hal] Add CAN Bus Map (#8765)

We will want a better API for higher level devices that expect to be on
motioncore, but for ones that are not expected to be, it'll be really
nice to have an API that can let us map the motioncore can bus to its
HAL index.
This commit is contained in:
Thad House
2026-04-16 21:03:39 -07:00
committed by GitHub
parent 628ba1458f
commit 8c80cdcf28
3 changed files with 84 additions and 1 deletions

View File

@@ -8,6 +8,7 @@
#include <gtest/gtest.h>
#include "wpi/hal/CANAPI.h"
#include "wpi/hal/CANBusMap.h"
#include "wpi/hal/simulation/CanData.h"
namespace wpi::hal {
@@ -44,7 +45,7 @@ struct CANSendCallbackStore {
TEST(CANTest, CanIdPacking) {
int32_t status = 0;
int32_t deviceId = 12;
CANTestStore testStore(0, deviceId, &status);
CANTestStore testStore(HAL_CAN_BUS_S0, deviceId, &status);
ASSERT_EQ(0, status);
std::pair<int32_t, bool> storePair;