UCOM_ToolsBPLibrary Documentation
This document provides details about the functions available in the UCOM_ToolsBPLibrary class.
CreateCOMManager
Creates and returns a new instance of UCOM_Manager
.
Parameter |
Type |
Description |
N/A |
N/A |
This function does not take any parameters. |
Return Type |
Description |
UObject* |
Returns a new instance of UCOM_Manager . |
ArrayCombine
Combines an array of debug log strings into a single string with each element on a new line.
Parameter |
Type |
Description |
DebugLogs |
TArray<FString> |
The array of debug log strings to combine. |
Return Type |
Description |
FString |
Returns a single string with each element of the array on a new line. |
ConvertIntArrayToString
Converts an integer array to a string with optional prepend and append strings.
Parameter |
Type |
Description |
Array |
TArray<int32> |
The integer array to convert. |
Prepend |
FString |
The string to prepend to the result. |
Append |
FString |
The string to append to the result. |
Return Type |
Description |
FString |
Returns a string representation of the integer array with the specified prepend and append strings. |
FPortInfo Struct Documentation
The FPortInfo struct holds comprehensive information about a port, including various identifiers and descriptive attributes. This structure is used to encapsulate all relevant data pertaining to a port for easy access and manipulation.
Property |
Type |
Description |
PortName |
FString |
The name assigned to the port. This is typically a user-friendly name used to identify the port within applications. |
KernelName |
FString |
The name of the port as recognized by the operating system kernel. This is used internally by the OS for port management. |
DevicePath |
FString |
The full device path that provides the location of the port in the system's device tree. |
KernelNameDevPath |
FString |
The combined kernel name and device path, providing a unique identifier for the port within the kernel's namespace. |
DeviceID |
FString |
The unique identifier assigned to the port's device. This ID is used to differentiate the port from other devices in the system. |
ParentDeviceID |
FString |
The unique identifier of the parent device to which this port is connected. This is useful for tracing the port's connection hierarchy. |
DriverKeyName |
FString |
The key name of the driver associated with the port. This is used to load and manage the appropriate driver for the port. |
Service |
FString |
The service name that manages the port. This is typically a system service responsible for handling port operations. |
FriendlyName |
FString |
A user-friendly name that provides an easily recognizable description of the port. This is often displayed in user interfaces. |
BusType |
FString |
The type of bus to which the port is connected (e.g., USB, PCI). This information helps in understanding the port's connection medium. |
Class |
FString |
The class of the port, typically used to categorize the port within a certain group of similar ports for organizational purposes. |
UCOM_Manager Class Documentation
The UCOM_Manager class provides various functionalities for managing serial port communication, including reading from and writing to serial ports, retrieving port information, and handling serial data events.
StartReadingSerialPort
Starts reading data from the specified serial port with a specified BaudRate.
Parameter |
Type |
Description |
PortName |
FString |
The name of the port to read from. |
BaudRate |
int32 |
The baud rate for the serial communication. |
Debug |
bool |
Flag indicating whether to enable debugging logs. |
DebugLogs |
TArray<FString>& |
Array to store debug log messages. |
ByteSize |
int32 |
The byte size for the serial communication. |
StopBits |
int32 |
The number of stop bits for the serial communication. |
Parity |
int32 |
The parity setting for the serial communication. |
Return Type |
Description |
void |
This function does not return a value. |
StopReadingSerialPort
Stops reading data from the serial port.
Parameter |
Type |
Description |
Debug |
bool |
Flag indicating whether to enable debugging logs. |
DebugLogs |
TArray<FString>& |
Array to store debug log messages. |
Return Type |
Description |
void |
This function does not return a value. |
GetLatestSerialData
Retrieves the latest data read from the serial port.
Parameter |
Type |
Description |
Debug |
bool |
Flag indicating whether to enable debugging logs. |
DebugLogs |
TArray<FString>& |
Array to store debug log messages. |
Return Type |
Description |
FString |
Returns the latest data read from the serial port. |
GetSerialPorts
Retrieves a list of available serial ports and their connected device names.
Parameter |
Type |
Description |
Debug |
bool |
Flag indicating whether to enable debugging logs. |
DebugLogs |
TArray<FString>& |
Array to store debug log messages. |
Return Type |
Description |
TArray<FString> |
Returns an array of available serial ports and their connected device names. |
COMManagerReading
Checks if the serial port reading thread is running.
Parameter |
Type |
Description |
Debug |
bool |
Flag indicating whether to enable debugging logs. |
DebugLogs |
TArray<FString>& |
Array to store debug log messages. |
Return Type |
Description |
bool |
Returns true if the serial port reading thread is running, false otherwise. |
SendSerialValueAsInt
Sends an integer value to the specified serial port.
Parameter |
Type |
Description |
PortName |
FString |
The name of the port to send data to. |
BaudRate |
int32 |
The baud rate for the serial communication. |
Value |
int32 |
The integer value to send to the port. |
Debug |
bool |
Flag indicating whether to enable debugging logs. |
DebugLogs |
TArray<FString>& |
Array to store debug log messages. |
ByteSize |
int32 |
The byte size for the serial communication. |
StopBits |
int32 |
The number of stop bits for the serial communication. |
Parity |
int32 |
The parity setting for the serial communication. |
Return Type |
Description |
void |
This function does not return a value. |
SendSerialValueAsIntArray
Sends an array of integer values to the specified serial port.
Parameter |
Type |
Description |
PortName |
FString |
The name of the port to send data to. |
BaudRate |
int32 |
The baud rate for the serial communication. |
Values |
TArray<int32>& |
The array of integer values to send to the port. |
Debug |
bool |
Flag indicating whether to enable debugging logs. |
DebugLogs |
TArray<FString>& |
Array to store debug log messages. |
ByteSize |
int32 |
The byte size for the serial communication. |
StopBits |
int32 |
The number of stop bits for the serial communication. |
Parity |
int32 |
The parity setting for the serial communication. |
Return Type |
Description |
void |
This function does not return a value. |
GetPortInfo
Retrieves detailed information about the specified port.
Parameter |
Type |
Description |
PortName |
FString |
The name of the port to get information for. |
Return Type |
Description |
FPortInfo |
Returns a struct containing detailed information about the specified port. |
UCOM_SaveLoad_Data Class Documentation
The UCOM_SaveLoad_Data class provides functions for saving and loading data to and from CSV files, as well as managing CSV file contents.
SaveDataToCSV
Saves data to a CSV file at the specified path with the given file name and slot name.
Parameter |
Type |
Description |
SavePath |
FString |
The path where the CSV file will be saved. If empty, a default path is used. |
FileName |
FString |
The name of the CSV file (without extension). |
SlotName |
FString |
The slot name to be saved in the CSV file. |
Value |
FString |
The value to be saved in the CSV file under the specified slot name. |
Debug |
bool |
Flag indicating whether to enable debugging logs. |
DebugStrings |
TArray<FString>& |
Array to store debug log messages. |
Return Type |
Description |
bool |
Returns true if the data was successfully saved to the CSV file, false otherwise. |
GetCSV_Files
Retrieves a list of CSV files from the specified directory path.
Parameter |
Type |
Description |
Path |
FString |
The directory path to search for CSV files. If empty, a default path is used. |
Debug |
bool |
Flag indicating whether to enable debugging logs. |
CSVFiles |
TArray<FString>& |
Array to store the names of found CSV files. |
DebugStrings |
TArray<FString>& |
Array to store debug log messages. |
Return Type |
Description |
void |
This function does not return a value. |
GetSlotNames
Retrieves the slot names from a specific CSV file.
Parameter |
Type |
Description |
Path |
FString |
The directory path where the CSV file is located. If empty, a default path is used. |
FileName |
FString |
The name of the CSV file. |
Debug |
bool |
Flag indicating whether to enable debugging logs. |
SlotNames |
TArray<FString>& |
Array to store the retrieved slot names. |
DebugStrings |
TArray<FString>& |
Array to store debug log messages. |
Return Type |
Description |
void |
This function does not return a value. |
GetSlotValues
Retrieves the value for a specific slot name from a specific CSV file.
Parameter |
Type |
Description |
Path |
FString |
The directory path where the CSV file is located. If empty, a default path is used. |
FileName |
FString |
The name of the CSV file. |
SlotName |
FString |
The slot name whose value needs to be retrieved. |
Debug |
bool |
Flag indicating whether to enable debugging logs. |
SlotValue |
FString& |
Reference to a string variable to store the retrieved slot value. |
DebugStrings |
TArray<FString>& |
Array to store debug log messages. |
Return Type |
Description |
bool |
Returns true if the slot value was successfully retrieved, false otherwise. |
StringToArray
Converts a comma-separated string to an array of strings and optionally to an array of integers if all elements are numeric.
Parameter |
Type |
Description |
String |
FString |
The comma-separated string to be converted. |
StringArray |
TArray<FString>& |
Array to store the parsed string elements. |
IntArray |
TArray<int32>& |
Array to store the parsed integer elements, if all elements are numeric. |
Return Type |
Description |
void |
This function does not return a value. |
RemoveSlot
Removes a row with the given slot name from the CSV file and returns the updated array of slot names.
Parameter |
Type |
Description |
Path |
FString |
The directory path where the CSV file is located. If empty, a default path is used. |
FileName |
FString |
The name of the CSV file. |
SlotName |
FString |
The slot name to be removed from the CSV file. |
Debug |
bool |
Flag indicating whether to enable debugging logs. |
UpdatedSlotNames |
TArray<FString>& |
Array to store the updated slot names after removal. |
DebugStrings |
TArray<FString>& |
Array to store debug log messages. |
Return Type |
Description |
bool |
Returns true if the slot was successfully removed, false otherwise. |
RemoveCSV_File
Removes a CSV file from the specified path after showing a confirmation message box.
Parameter |
Type |
Description |
Path |
FString |
The directory path where the CSV file is located. If empty, a default path is used. |
FileName |
FString |
The name of the CSV file to be removed. |
Debug |
bool |
Flag indicating whether to enable debugging logs. |
DebugStrings |
TArray<FString>& |
Array to store debug log messages. |
Return Type |
Description |
bool |
Returns true if the file was successfully removed, false otherwise. |