CTRE Phoenix 6 C++ 26.0.0-beta-1
Loading...
Searching...
No Matches
DeviceIdentifier.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) Cross The Road Electronics.  All rights reserved.
3 * License information can be found in CTRE_LICENSE.txt
4 * For support and suggestions contact support@ctr-electronics.com or file
5 * an issue tracker at https://github.com/CrossTheRoadElec/Phoenix-Releases
6 */
7#pragma once
8
11
12namespace ctre {
13namespace phoenix6 {
14namespace hardware {
15
16 class DeviceIdentifier final {
17 public:
18 std::string network;
19 std::string model;
21 uint32_t deviceHash;
22
23 DeviceIdentifier() = default;
24 DeviceIdentifier(int deviceID, std::string model, CANBus canbus) :
25 network{canbus.GetName()},
26 model{std::move(model)},
28 deviceHash{networking::Wrappers::CompileDeviceHash(deviceID, this->model.c_str(), this->network.c_str())}
29 {}
30
31 std::string ToString() const;
32 };
33
34}
35}
36}
Class for getting information about an available CAN bus.
Definition CANBus.hpp:19
Definition DeviceIdentifier.hpp:16
std::string model
Definition DeviceIdentifier.hpp:19
DeviceIdentifier(int deviceID, std::string model, CANBus canbus)
Definition DeviceIdentifier.hpp:24
int deviceID
Definition DeviceIdentifier.hpp:20
uint32_t deviceHash
Definition DeviceIdentifier.hpp:21
std::string network
Definition DeviceIdentifier.hpp:18
Definition motor_constants.h:14