CTRE Phoenix 6 C++
25.0.0-beta-4
Loading...
Searching...
No Matches
platform_c_style.h
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
9
#include "
ctre/phoenix/export.h
"
10
#include "stdint.h"
11
#include "stdbool.h"
12
13
#ifdef __cplusplus
14
extern
"C"
{
15
#endif
16
17
CTREXPORT
bool
c_ctre_phoenix6_platform_canbus_is_network_fd
(
char
const
*canbus);
18
CTREXPORT
int32_t
c_ctre_phoenix6_platform_canbus_get_status
(
float
*busUtilPerc, uint32_t *busOffCount, uint32_t *txFullCount, uint32_t *rec, uint32_t *tec,
char
const
*canbus,
bool
printErr);
19
CTREXPORT
void
c_ctre_phoenix6_platform_canbus_sendmessage
(uint32_t messageId, uint8_t
const
*data, uint8_t dataSize,
char
const
*canbus,
bool
printErr);
20
CTREXPORT
int32_t
c_ctre_phoenix6_platform_canbus_receivemessage
(uint32_t messageId, uint8_t *data, uint8_t * dataSize,
char
const
*canbus,
bool
printErr);
21
22
CTREXPORT
int32_t
c_ctre_phoenix6_platform_sim_create
(
int
deviceType,
int
id
);
23
CTREXPORT
int32_t
c_ctre_phoenix6_platform_sim_destroy
(
int
deviceType,
int
id
);
24
CTREXPORT
int32_t
c_ctre_phoenix6_platform_sim_destroy_all
(
void
);
25
CTREXPORT
int32_t
c_ctre_phoenix6_platform_sim_set_physics_input
(
int
deviceType,
int
id
,
char
const
*physicsType,
double
value);
26
CTREXPORT
int32_t
c_ctre_phoenix6_platform_sim_get_physics_value
(
int
deviceType,
int
id
,
char
const
*physicsType,
double
*value);
27
CTREXPORT
int32_t
c_ctre_phoenix6_platform_sim_get_last_error
(
int
deviceType,
int
id
);
28
29
CTREXPORT
int32_t
c_ctre_phoenix6_platform_replay_load_file
(
char
const
*filepath);
30
CTREXPORT
void
c_ctre_phoenix6_platform_replay_close_file
();
31
CTREXPORT
bool
c_ctre_phoenix6_platform_replay_is_file_loaded
();
32
CTREXPORT
int32_t
c_ctre_phoenix6_platform_replay_play
();
33
CTREXPORT
int32_t
c_ctre_phoenix6_platform_replay_pause
();
34
CTREXPORT
int32_t
c_ctre_phoenix6_platform_replay_stop
();
35
CTREXPORT
bool
c_ctre_phoenix6_platform_replay_is_running
(uint16_t timeoutMs);
36
CTREXPORT
void
c_ctre_phoenix6_platform_replay_set_speed
(
double
speed);
37
CTREXPORT
int32_t
c_ctre_phoenix6_platform_replay_step_timing
(
double
stepTimeSeconds);
38
39
/* NOTE: For Raw and Arrays, caller must allocate a buffer >= 64 bytes. For String, the buffer must be >= 65 bytes. */
40
CTREXPORT
int32_t
c_ctre_phoenix6_platform_replay_get_raw
(
char
const
*name,
char
**units, uint8_t *data, uint8_t *len,
double
*timestampSeconds);
41
CTREXPORT
int32_t
c_ctre_phoenix6_platform_replay_get_boolean
(
char
const
*name,
char
**units,
bool
*value,
double
*timestampSeconds);
42
CTREXPORT
int32_t
c_ctre_phoenix6_platform_replay_get_integer
(
char
const
*name,
char
**units, int64_t *value,
double
*timestampSeconds);
43
CTREXPORT
int32_t
c_ctre_phoenix6_platform_replay_get_float
(
char
const
*name,
char
**units,
float
*value,
double
*timestampSeconds);
44
CTREXPORT
int32_t
c_ctre_phoenix6_platform_replay_get_double
(
char
const
*name,
char
**units,
double
*value,
double
*timestampSeconds);
45
CTREXPORT
int32_t
c_ctre_phoenix6_platform_replay_get_string
(
char
const
*name,
char
**units,
char
*value, uint8_t *len,
double
*timestampSeconds);
46
CTREXPORT
int32_t
c_ctre_phoenix6_platform_replay_get_boolean_array
(
char
const
*name,
char
**units,
bool
*values, uint8_t *count,
double
*timestampSeconds);
47
CTREXPORT
int32_t
c_ctre_phoenix6_platform_replay_get_integer_array
(
char
const
*name,
char
**units, int64_t *values, uint8_t *count,
double
*timestampSeconds);
48
CTREXPORT
int32_t
c_ctre_phoenix6_platform_replay_get_float_array
(
char
const
*name,
char
**units,
float
*values, uint8_t *count,
double
*timestampSeconds);
49
CTREXPORT
int32_t
c_ctre_phoenix6_platform_replay_get_double_array
(
char
const
*name,
char
**units,
double
*values, uint8_t *count,
double
*timestampSeconds);
50
51
CTREXPORT
int32_t
c_ctre_phoenix6_platform_set_logger_path
(
char
const
*path);
52
CTREXPORT
int32_t
c_ctre_phoenix6_platform_start_logger
(
void
);
53
CTREXPORT
int32_t
c_ctre_phoenix6_platform_stop_logger
(
void
);
54
CTREXPORT
int32_t
c_ctre_phoenix6_platform_enable_auto_logging
(
bool
enable);
55
CTREXPORT
int32_t
c_ctre_phoenix6_platform_write_raw
(
char
const
*name, uint8_t
const
*data, uint8_t size,
double
latencySeconds);
56
CTREXPORT
int32_t
c_ctre_phoenix6_platform_write_boolean
(
char
const
*name,
bool
value,
double
latencySeconds);
57
CTREXPORT
int32_t
c_ctre_phoenix6_platform_write_integer
(
char
const
*name, int64_t value,
char
const
*units,
double
latencySeconds);
58
CTREXPORT
int32_t
c_ctre_phoenix6_platform_write_float
(
char
const
*name,
float
value,
char
const
*units,
double
latencySeconds);
59
CTREXPORT
int32_t
c_ctre_phoenix6_platform_write_double
(
char
const
*name,
double
value,
char
const
*units,
double
latencySeconds);
60
CTREXPORT
int32_t
c_ctre_phoenix6_platform_write_string
(
char
const
*name,
char
const
*value,
double
latencySeconds);
61
CTREXPORT
int32_t
c_ctre_phoenix6_platform_write_boolean_array
(
char
const
*name,
bool
const
*values, uint8_t count,
double
latencySeconds);
62
CTREXPORT
int32_t
c_ctre_phoenix6_platform_write_integer_array
(
char
const
*name, int64_t
const
*values, uint8_t count,
char
const
*units,
double
latencySeconds);
63
CTREXPORT
int32_t
c_ctre_phoenix6_platform_write_float_array
(
char
const
*name,
float
const
*values, uint8_t count,
char
const
*units,
double
latencySeconds);
64
CTREXPORT
int32_t
c_ctre_phoenix6_platform_write_double_array
(
char
const
*name,
double
const
*values, uint8_t count,
char
const
*units,
double
latencySeconds);
65
66
#ifdef __cplusplus
67
}
68
#endif
export.h
CTREXPORT
#define CTREXPORT
Definition
export.h:14
c_ctre_phoenix6_platform_canbus_get_status
CTREXPORT int32_t c_ctre_phoenix6_platform_canbus_get_status(float *busUtilPerc, uint32_t *busOffCount, uint32_t *txFullCount, uint32_t *rec, uint32_t *tec, char const *canbus, bool printErr)
c_ctre_phoenix6_platform_replay_get_double
CTREXPORT int32_t c_ctre_phoenix6_platform_replay_get_double(char const *name, char **units, double *value, double *timestampSeconds)
c_ctre_phoenix6_platform_enable_auto_logging
CTREXPORT int32_t c_ctre_phoenix6_platform_enable_auto_logging(bool enable)
c_ctre_phoenix6_platform_replay_get_float
CTREXPORT int32_t c_ctre_phoenix6_platform_replay_get_float(char const *name, char **units, float *value, double *timestampSeconds)
c_ctre_phoenix6_platform_write_boolean
CTREXPORT int32_t c_ctre_phoenix6_platform_write_boolean(char const *name, bool value, double latencySeconds)
c_ctre_phoenix6_platform_write_string
CTREXPORT int32_t c_ctre_phoenix6_platform_write_string(char const *name, char const *value, double latencySeconds)
c_ctre_phoenix6_platform_write_raw
CTREXPORT int32_t c_ctre_phoenix6_platform_write_raw(char const *name, uint8_t const *data, uint8_t size, double latencySeconds)
c_ctre_phoenix6_platform_replay_play
CTREXPORT int32_t c_ctre_phoenix6_platform_replay_play()
c_ctre_phoenix6_platform_write_double_array
CTREXPORT int32_t c_ctre_phoenix6_platform_write_double_array(char const *name, double const *values, uint8_t count, char const *units, double latencySeconds)
c_ctre_phoenix6_platform_replay_get_string
CTREXPORT int32_t c_ctre_phoenix6_platform_replay_get_string(char const *name, char **units, char *value, uint8_t *len, double *timestampSeconds)
c_ctre_phoenix6_platform_replay_get_boolean_array
CTREXPORT int32_t c_ctre_phoenix6_platform_replay_get_boolean_array(char const *name, char **units, bool *values, uint8_t *count, double *timestampSeconds)
c_ctre_phoenix6_platform_write_float
CTREXPORT int32_t c_ctre_phoenix6_platform_write_float(char const *name, float value, char const *units, double latencySeconds)
c_ctre_phoenix6_platform_replay_get_float_array
CTREXPORT int32_t c_ctre_phoenix6_platform_replay_get_float_array(char const *name, char **units, float *values, uint8_t *count, double *timestampSeconds)
c_ctre_phoenix6_platform_sim_get_physics_value
CTREXPORT int32_t c_ctre_phoenix6_platform_sim_get_physics_value(int deviceType, int id, char const *physicsType, double *value)
c_ctre_phoenix6_platform_sim_get_last_error
CTREXPORT int32_t c_ctre_phoenix6_platform_sim_get_last_error(int deviceType, int id)
c_ctre_phoenix6_platform_replay_close_file
CTREXPORT void c_ctre_phoenix6_platform_replay_close_file()
c_ctre_phoenix6_platform_sim_set_physics_input
CTREXPORT int32_t c_ctre_phoenix6_platform_sim_set_physics_input(int deviceType, int id, char const *physicsType, double value)
c_ctre_phoenix6_platform_canbus_sendmessage
CTREXPORT void c_ctre_phoenix6_platform_canbus_sendmessage(uint32_t messageId, uint8_t const *data, uint8_t dataSize, char const *canbus, bool printErr)
c_ctre_phoenix6_platform_canbus_receivemessage
CTREXPORT int32_t c_ctre_phoenix6_platform_canbus_receivemessage(uint32_t messageId, uint8_t *data, uint8_t *dataSize, char const *canbus, bool printErr)
c_ctre_phoenix6_platform_write_double
CTREXPORT int32_t c_ctre_phoenix6_platform_write_double(char const *name, double value, char const *units, double latencySeconds)
c_ctre_phoenix6_platform_replay_is_file_loaded
CTREXPORT bool c_ctre_phoenix6_platform_replay_is_file_loaded()
c_ctre_phoenix6_platform_replay_get_boolean
CTREXPORT int32_t c_ctre_phoenix6_platform_replay_get_boolean(char const *name, char **units, bool *value, double *timestampSeconds)
c_ctre_phoenix6_platform_sim_destroy
CTREXPORT int32_t c_ctre_phoenix6_platform_sim_destroy(int deviceType, int id)
c_ctre_phoenix6_platform_write_integer
CTREXPORT int32_t c_ctre_phoenix6_platform_write_integer(char const *name, int64_t value, char const *units, double latencySeconds)
c_ctre_phoenix6_platform_start_logger
CTREXPORT int32_t c_ctre_phoenix6_platform_start_logger(void)
c_ctre_phoenix6_platform_replay_get_raw
CTREXPORT int32_t c_ctre_phoenix6_platform_replay_get_raw(char const *name, char **units, uint8_t *data, uint8_t *len, double *timestampSeconds)
c_ctre_phoenix6_platform_set_logger_path
CTREXPORT int32_t c_ctre_phoenix6_platform_set_logger_path(char const *path)
c_ctre_phoenix6_platform_replay_get_integer_array
CTREXPORT int32_t c_ctre_phoenix6_platform_replay_get_integer_array(char const *name, char **units, int64_t *values, uint8_t *count, double *timestampSeconds)
c_ctre_phoenix6_platform_replay_set_speed
CTREXPORT void c_ctre_phoenix6_platform_replay_set_speed(double speed)
c_ctre_phoenix6_platform_replay_pause
CTREXPORT int32_t c_ctre_phoenix6_platform_replay_pause()
c_ctre_phoenix6_platform_replay_load_file
CTREXPORT int32_t c_ctre_phoenix6_platform_replay_load_file(char const *filepath)
c_ctre_phoenix6_platform_stop_logger
CTREXPORT int32_t c_ctre_phoenix6_platform_stop_logger(void)
c_ctre_phoenix6_platform_sim_create
CTREXPORT int32_t c_ctre_phoenix6_platform_sim_create(int deviceType, int id)
c_ctre_phoenix6_platform_canbus_is_network_fd
CTREXPORT bool c_ctre_phoenix6_platform_canbus_is_network_fd(char const *canbus)
c_ctre_phoenix6_platform_write_integer_array
CTREXPORT int32_t c_ctre_phoenix6_platform_write_integer_array(char const *name, int64_t const *values, uint8_t count, char const *units, double latencySeconds)
c_ctre_phoenix6_platform_sim_destroy_all
CTREXPORT int32_t c_ctre_phoenix6_platform_sim_destroy_all(void)
c_ctre_phoenix6_platform_replay_get_double_array
CTREXPORT int32_t c_ctre_phoenix6_platform_replay_get_double_array(char const *name, char **units, double *values, uint8_t *count, double *timestampSeconds)
c_ctre_phoenix6_platform_replay_stop
CTREXPORT int32_t c_ctre_phoenix6_platform_replay_stop()
c_ctre_phoenix6_platform_replay_get_integer
CTREXPORT int32_t c_ctre_phoenix6_platform_replay_get_integer(char const *name, char **units, int64_t *value, double *timestampSeconds)
c_ctre_phoenix6_platform_write_boolean_array
CTREXPORT int32_t c_ctre_phoenix6_platform_write_boolean_array(char const *name, bool const *values, uint8_t count, double latencySeconds)
c_ctre_phoenix6_platform_replay_is_running
CTREXPORT bool c_ctre_phoenix6_platform_replay_is_running(uint16_t timeoutMs)
c_ctre_phoenix6_platform_replay_step_timing
CTREXPORT int32_t c_ctre_phoenix6_platform_replay_step_timing(double stepTimeSeconds)
c_ctre_phoenix6_platform_write_float_array
CTREXPORT int32_t c_ctre_phoenix6_platform_write_float_array(char const *name, float const *values, uint8_t count, char const *units, double latencySeconds)
ctre
phoenix6
platform
platform_c_style.h
Generated by
1.10.0