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