CTRE Phoenix 6 C++ 24.3.0
Wrappers.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#include <string>
12
13namespace ctre {
14namespace phoenix6 {
15namespace networking {
16
18 {
19 public:
20 /**
21 * \brief Creates the device hash from provided parameters
22 *
23 * \param deviceID Device ID
24 * \param model Device Model
25 * \param canbus CAN bus name
26 * \returns Hash of the device
27 */
28 static uint32_t CompileDeviceHash(int deviceID, const char *model, const char *canbus);
29 /**
30 * \brief Sets the config value of the device
31 *
32 * \param network What network the device is on
33 * \param deviceHash The hash of the device
34 * \param timeoutSeconds How long to wait for the device to acknowledge in seconds
35 * \param serializedString Serialized configs to set
36 * \param futureProofConfigs True to factory default the configs before setting
37 * \param overrideIfDuplicate True to always configure this parameter, even if we detect it's unnecessary
38 * \returns Status of the config set
39 */
40 static ctre::phoenix::StatusCode Device_SetConfigValues(
41 const char *network,
42 int deviceHash,
43 double timeoutSeconds,
44 const std::string &serializedString,
45 bool futureProofConfigs,
46 bool overrideIfDuplicate);
47
48 /**
49 * \brief Gets the config value of the device
50 *
51 * \param network What network the device is on
52 * \param deviceHash The hash of the device
53 * \param timeoutSeconds How long to wait for the device to acknowledge in seconds
54 * \param serializedString Serialized configs to get
55 * \returns Status of the config set
56 */
57 static ctre::phoenix::StatusCode Device_GetConfigValues(
58 const char *network,
59 int deviceHash,
60 double timeoutSeconds,
61 std::string &serializedString);
62 };
63
64}
65}
66}
Definition: Wrappers.hpp:18
static ctre::phoenix::StatusCode Device_GetConfigValues(const char *network, int deviceHash, double timeoutSeconds, std::string &serializedString)
Gets the config value of the device.
static uint32_t CompileDeviceHash(int deviceID, const char *model, const char *canbus)
Creates the device hash from provided parameters.
static ctre::phoenix::StatusCode Device_SetConfigValues(const char *network, int deviceHash, double timeoutSeconds, const std::string &serializedString, bool futureProofConfigs, bool overrideIfDuplicate)
Sets the config value of the device.
Definition: string_util.hpp:15