WPILibC++ 2025.1.1
Loading...
Searching...
No Matches
ntcore_test.h
Go to the documentation of this file.
1// Copyright (c) FIRST and other WPILib contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the WPILib BSD license file in the root directory of this project.
4
5#pragma once
6
7#include <stdint.h>
8
9#include "ntcore.h"
10
11// Functions in this header are to be used only for testing
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17struct WPI_String* NT_GetStringForTesting(const char* str, int* struct_size);
18// No need for free as one already exists in main library
19
20struct NT_EntryInfo* NT_GetEntryInfoForTesting(const char* name,
21 enum NT_Type type,
22 unsigned int flags,
23 uint64_t last_change,
24 int* struct_size);
25
26void NT_FreeEntryInfoForTesting(struct NT_EntryInfo* info);
27
29 const char* remote_id, const char* remote_ip, unsigned int remote_port,
30 uint64_t last_update, unsigned int protocol_version, int* struct_size);
31
33
35 int* struct_size);
36
38 int* struct_size);
39
41 const char* str, int* struct_size);
42
43struct NT_Value* NT_GetValueRawForTesting(uint64_t last_change, const char* raw,
44 int raw_len, int* struct_size);
45
47 const int* arr,
48 size_t array_len,
49 int* struct_size);
50
52 const double* arr,
53 size_t array_len,
54 int* struct_size);
55
57 const struct WPI_String* arr,
58 size_t array_len,
59 int* struct_size);
60// No need for free as one already exists in the main library
61
62#ifdef __cplusplus
63} // extern "C"
64#endif
NT_Type
NetworkTables data types.
Definition ntcore_c.h:53
struct NT_Value * NT_GetValueDoubleForTesting(uint64_t last_change, double val, int *struct_size)
struct NT_Value * NT_GetValueBooleanForTesting(uint64_t last_change, int val, int *struct_size)
struct NT_Value * NT_GetValueRawForTesting(uint64_t last_change, const char *raw, int raw_len, int *struct_size)
struct NT_EntryInfo * NT_GetEntryInfoForTesting(const char *name, enum NT_Type type, unsigned int flags, uint64_t last_change, int *struct_size)
struct NT_ConnectionInfo * NT_GetConnectionInfoForTesting(const char *remote_id, const char *remote_ip, unsigned int remote_port, uint64_t last_update, unsigned int protocol_version, int *struct_size)
struct WPI_String * NT_GetStringForTesting(const char *str, int *struct_size)
struct NT_Value * NT_GetValueStringForTesting(uint64_t last_change, const char *str, int *struct_size)
struct NT_Value * NT_GetValueBooleanArrayForTesting(uint64_t last_change, const int *arr, size_t array_len, int *struct_size)
struct NT_Value * NT_GetValueDoubleArrayForTesting(uint64_t last_change, const double *arr, size_t array_len, int *struct_size)
void NT_FreeConnectionInfoForTesting(struct NT_ConnectionInfo *info)
struct NT_Value * NT_GetValueStringArrayForTesting(uint64_t last_change, const struct WPI_String *arr, size_t array_len, int *struct_size)
void NT_FreeEntryInfoForTesting(struct NT_EntryInfo *info)
NetworkTables Connection Information.
Definition ntcore_c.h:191
struct WPI_String remote_ip
The IP address of the remote node.
Definition ntcore_c.h:198
unsigned int remote_port
The port number of the remote node.
Definition ntcore_c.h:201
uint64_t last_update
The last time any update was received from the remote node (same scale as returned by nt::Now()).
Definition ntcore_c.h:207
unsigned int protocol_version
The protocol version being used for this connection.
Definition ntcore_c.h:213
struct WPI_String remote_id
The remote identifier (as set on the remote node by NT_StartClient4().
Definition ntcore_c.h:195
NetworkTables Entry Value.
Definition ntcore_c.h:135
int64_t last_change
Definition ntcore_c.h:137
NT_Bool * arr
Definition ntcore_c.h:150
A const UTF8 string.
Definition string.h:14
const char * str
Contents.
Definition string.h:16