File BradyPrintSdkCore.h
FileList > BradyPrintSdkCore.h
Go to the source code of this file
Core types and lifecycle functions for the Brady Desktop Print SDK. More...
#include <stddef.h>#include <stdbool.h>#include "BradySdkStatus.h"
Public Types
| Type | Name |
|---|---|
| typedef int | PrintJobHandle Handle type for print job instances. |
| typedef struct SdkPrinterContext * | PrinterHandle Opaque handle type for printer instances. |
Public Functions
| Type | Name |
|---|---|
| BRADY_SDK_EXPORT PrinterHandle | CreatePrinter (const char * printerModel, const char * printerName) Creates a new printer instance. The consumer is responsible for managing the lifetime of the returned handle and calling DestroyPrinter when it's no longer needed. |
| BRADY_SDK_EXPORT BradySdkStatus | DestroyPrinter (PrinterHandle printer) Destroys a printer instance and frees associated resources. |
| BRADY_SDK_EXPORT BradySdkStatus | EnableAnalytics (bool enable) Enables or disables anonymous analytics collection for the SDK. Analytics collection is enabled by default. |
| BRADY_SDK_EXPORT BradySdkStatus | InitializeBradySdk (const char * dataFolderPath) Initializes the Brady Desktop Print SDK. This function must be called before any other SDK functions. |
| BRADY_SDK_EXPORT BradySdkStatus | SetLogPath (const char * logPath, const char * logFileName, SdkLogLevel logLevel) Sets the log path for the SDK. The log file is shared between all printer instances, so this function should only be called once at the start of SDK usage. |
Macros
| Type | Name |
|---|---|
| define | BRADY_SDK_EXPORT |
Detailed Description
This header defines the fundamental handle types and SDK initialization, printer creation/destruction, and analytics functions.
Public Types Documentation
typedef PrintJobHandle
Handle type for print job instances.
typedef int PrintJobHandle;
See also: CreatePrintJob
typedef PrinterHandle
Opaque handle type for printer instances.
typedef struct SdkPrinterContext* PrinterHandle;
See also: CreatePrinter
Public Functions Documentation
function CreatePrinter
Creates a new printer instance. The consumer is responsible for managing the lifetime of the returned handle and calling DestroyPrinter when it's no longer needed.
BRADY_SDK_EXPORT PrinterHandle CreatePrinter (
const char * printerModel,
const char * printerName
)
Parameters:
printerModelA UTF-8 encoded string identifying the printer model.printerNameA UTF-8 encoded string that gives the printer a unique name.
Returns:
A handle to the printer instance, or NULL if creation failed.
See also: PrinterHandle
function DestroyPrinter
Destroys a printer instance and frees associated resources.
BRADY_SDK_EXPORT BradySdkStatus DestroyPrinter (
PrinterHandle printer
)
Parameters:
printerThe handle to the printer instance to destroy.
Returns:
BRADY_SDK_SUCCESS if the printer instance was destroyed successfully.
See also: PrinterHandle
function EnableAnalytics
Enables or disables anonymous analytics collection for the SDK. Analytics collection is enabled by default.
BRADY_SDK_EXPORT BradySdkStatus EnableAnalytics (
bool enable
)
Parameters:
enableA boolean indicating whether to enable (true) or disable (false) analytics collection.
Returns:
BRADY_SDK_SUCCESS if the operation was successful.
See also: BradySdkStatus
function InitializeBradySdk
Initializes the Brady Desktop Print SDK. This function must be called before any other SDK functions.
BRADY_SDK_EXPORT BradySdkStatus InitializeBradySdk (
const char * dataFolderPath
)
Parameters:
dataFolderPathPath to a folder where the SDK can store data. If NULL, a default path will be used. This folder is shared between all printer instances. SDK consumers must ensure that read / write permissions are available for this folder. If NULL, the SDK will use a default path based on the operating system. On Windows, the default path is ProgramData%\Brady Corp\NextGen Driver.
Returns:
BRADY_SDK_SUCCESS if the SDK was initialized successfully.
function SetLogPath
Sets the log path for the SDK. The log file is shared between all printer instances, so this function should only be called once at the start of SDK usage.
BRADY_SDK_EXPORT BradySdkStatus SetLogPath (
const char * logPath,
const char * logFileName,
SdkLogLevel logLevel
)
Parameters:
logPathThe directory where log files will be stored.logFileNameThe name of the log file. Defaults to "DriverSdkLog.txt".logLevelThe minimum log level to record. Defaults to LOG_PRODUCTION.
Returns:
BRADY_SDK_SUCCESS if the log path was set successfully.
See also: SdkLogLevel
See also: BradySdkStatus
Macro Definition Documentation
define BRADY_SDK_EXPORT
#define BRADY_SDK_EXPORT
The documentation for this class was generated from the following file BradyPrintSdkCore.h