UniPRT SDK v2.0-DLL (C++)
 
Loading...
Searching...
No Matches
Discovery.cpp File Reference
#include "pch.h"
#include "framework.h"
#include "Discovery.h"
#include "NetworkDiscover.h"
#include <vector>
#include <string>
#include <windows.h>
#include <thread>
#include <mutex>
#include <sstream>
#include <iostream>
#include <atomic>
Include dependency graph for Discovery.cpp:

Macros

#define MAX_THREADS   64
 

Functions

std::vector< std::string > *__stdcall GetPrinterList (Brand brand=Brand::ALL, int responseTimeoutMs=2000)
 Search a printer by network.
 
void __stdcall FreePrinterList (std::vector< std::string > *pList)
 Release string resource.
 
std::vector< std::string > *__stdcall GetPrinterList_IPv6 (std::string PREFIX, std::string INTERFACE_NAME, int responseTimeoutMs=2000)
 Search a printer by IPv6 network.
 
void __stdcall FreePrinterList_IPv6 (std::vector< std::string > *pList)
 Release string resource.
 

Variables

CDiscoveryApp theApp
 
std::mutex g_listMutex
 

Macro Definition Documentation

◆ MAX_THREADS

#define MAX_THREADS   64

Function Documentation

◆ FreePrinterList()

void __stdcall FreePrinterList ( std::vector< std::string > * pList)

Release string resource.

Parameters
[in]pList: a string list resource
Returns
void
Sample
FreePrinterList(pPrinterList);
void __stdcall FreePrinterList(std::vector< std::string > *pList)
Release string resource.
Definition Discovery.cpp:171

◆ FreePrinterList_IPv6()

void __stdcall FreePrinterList_IPv6 ( std::vector< std::string > * pList)

Release string resource.

Parameters
[in]pList: a string list resource
Returns
void
Sample
void __stdcall FreePrinterList_IPv6(std::vector< std::string > *pList)
Release string resource.
Definition Discovery.cpp:306

◆ GetPrinterList()

std::vector< std::string > *__stdcall GetPrinterList ( Brand brand = Brand::ALL,
int responseTimeoutMs = 2000 )

Search a printer by network.

Parameters
[in]brand: set a brand of printer, e.g. Brand::ALL, Brand::TSC or Brand::PTX
[in]responseTimeoutMs: set the timeout for printer response
Returns
std::vector<std::string>*
Sample
std::vector<std::string>* pPrinterList = GetPrinterList(Brand::ALL, 3000);
std::vector< std::string > *__stdcall GetPrinterList(Brand brand=Brand::ALL, int responseTimeoutMs=2000)
Search a printer by network.
Definition Discovery.cpp:127

◆ GetPrinterList_IPv6()

std::vector< std::string > *__stdcall GetPrinterList_IPv6 ( std::string PREFIX,
std::string INTERFACE_NAME,
int responseTimeoutMs = 2000 )

Search a printer by IPv6 network.

Parameters
[in]PREFIX: IPv6 prefix, uses the ping method to search for all possible combinations of the last 16 bits of the IP address
[in]INTERFACE_NAME: platform interface ID
[in]responseTimeoutMs: set the timeout for printer response
Returns
std::vector<std::string>*
Sample
std::vector<std::string>* foundIPs = GetPrinterList_IPv6("fe80::208:96ff:fe40:", "35", 1000); // Link-Local
std::vector<std::string>* foundIPs = GetPrinterList_IPv6("2001:b030:2219:c40:208:96ff:fe40:", "", 1000); // Global
std::vector< std::string > *__stdcall GetPrinterList_IPv6(std::string PREFIX, std::string INTERFACE_NAME, int responseTimeoutMs=2000)
Search a printer by IPv6 network.
Definition Discovery.cpp:224

Variable Documentation

◆ g_listMutex

std::mutex g_listMutex

◆ theApp

CDiscoveryApp theApp