tpNetworkInterface类
ExternUtils
2025-07-05
基础信息
头文件: | include <tpNetworkInterface.h> |
---|---|
Cmake: | None |
发布版本: | V0.1.0 |
继承类: | |
派生类: |
信号
信号名称 | 参数 | 描述 |
---|---|---|
wirelessRemove | tpString | |
wirelessAdd | tpWirelessInfo |
Public 成员函数
tpNetworkInterface(const char *name) | ||
---|---|---|
tpNetworkInterface(const tpString &name) | ||
~tpNetworkInterface() | ||
tpString | getName() const | 获取网卡接口名字 |
tpString | getManu() | 获取网卡制造商 |
isWireless() | 是否是无线网卡 | |
isOnline() | 判断网络接口状态,有线网络和无线网络共用此接口,值代表已经插入网线或连接到无线网络,不代表真实上网状态 | |
isOnlineInternet() | 互联网状态 | |
openDevice() | 网卡打开 | |
closeDevice() | 网卡关闭 | |
isOpenDevice() | 网卡是否打开 | |
setDhcp() | 打开网卡自动DHCP | |
setStatic(const tpString &ip, const tpString &gatway, const tpString &netmask, tpList< tpString > &dns) | 关闭网卡自动DHCP | |
isDhcp() | 判断自动DHCP是否打开 | |
tpString | getGatway() | 获取网关 |
setGatway(const tpString &gatway) | 设置网关 | |
tpList< tpString > | getDns() | 获取DNS |
setDns(tpBool autoDns, const tpList< tpString > &dnsList=tpList< tpString >()) | 设置DNS | |
isStaticDns() | 是否是静态的DNS | |
tpString | getAddr() | 获取网卡IP地址 |
setAddr(const tpString &addr) | 设置网卡IP地址 | |
tpString | getMacAddr() | 获取网卡MAC地址 |
setMacAddr(const tpString &addr) | 设置网卡MAC地址 | |
tpString | getNetmask() | 获取网卡子网掩码 |
setNetmask(const tpString &addr) | 设置网卡子网掩码 | |
tpString | getBroadAddr() | 获取广播地址 |
setBroadAddr(const tpString &addr) | 设置广播地址 | |
tpString | getAddrIpv6() | 获取IPV6地址 |
setAddrIpv6(const tpString &addr) | 设置IPV6地址 | |
startScan() | 开始扫描无线网络 | |
stopScan() | 停止无线网络扫描 | |
tpList< tpWirelessInfo > | getScan() | 获取扫描结果 |
connectWireless(const tpString &ssid, const tpString &psk="", tpUInt32 timeout=50000) | 连接到加密无线网络 | |
disconnectWireless() | 断开无线网络的连接 | |
tpString | getWirelessSsid() | 获取连接的wifi的SSID |
setHotspotSsid(const tpString &ssid) | 设置本机热点的的SSID | |
setHotspotPwd(const tpString &password) | 设置本机热点的密码 | |
openHotspot() | 打开本机热点 | |
static tpList< tpNetworkInterface > tpNetworkInterface::getAllDevice | getAllDevice() | 获取所有网卡硬件 |
成员函数说明
tpNetworkInterface::tpNetworkInterface(const char *name)
暂无注释...
tpNetworkInterface::tpNetworkInterface(const tpString &name)
暂无注释...
tpNetworkInterface::~tpNetworkInterface()
暂无注释...
tpString tpNetworkInterface::getName() const
点击查看...
获取网卡接口名字
返回值:
linebreak
tpString tpNetworkInterface::getManu()
点击查看...
获取网卡制造商
返回值:
linebreak
tpBool tpNetworkInterface::isWireless()
点击查看...
是否是无线网卡
返回值:
linebreak
tpBool tpNetworkInterface::isOnline()
点击查看...
判断网络接口状态,有线网络和无线网络共用此接口,值代表已经插入网线或连接到无线网络,不代表真实上网状态
返回值:
linebreak
tpBool tpNetworkInterface::isOnlineInternet()
点击查看...
互联网状态
返回值:
linebreak
tpInt32 tpNetworkInterface::openDevice()
点击查看...
网卡打开
返回值:
linebreak
tpInt32 tpNetworkInterface::closeDevice()
点击查看...
网卡关闭
返回值:
linebreak
tpBool tpNetworkInterface::isOpenDevice()
点击查看...
网卡是否打开
返回值:
linebreak
tpInt32 tpNetworkInterface::setDhcp()
点击查看...
打开网卡自动DHCP
返回值:
linebreak
tpInt32 tpNetworkInterface::setStatic(const tpString &ip, const tpString &gatway, const tpString &netmask, tpList< tpString > &dns)
点击查看...
关闭网卡自动DHCP
返回值:
ref;#text
tpBool tpNetworkInterface::isDhcp()
点击查看...
判断自动DHCP是否打开
返回值:
linebreak
tpString tpNetworkInterface::getGatway()
点击查看...
获取网关
返回值:
linebreak
tpInt32 tpNetworkInterface::setGatway(const tpString &gatway)
点击查看...
设置网关
返回值:
linebreak
tpList< tpString > tpNetworkInterface::getDns()
点击查看...
获取DNS
返回值:
linebreak
tpInt32 tpNetworkInterface::setDns(tpBool autoDns, const tpList< tpString > &dnsList=tpList< tpString >())
点击查看...
设置DNS
返回值:
linebreak
tpBool tpNetworkInterface::isStaticDns()
点击查看...
是否是静态的DNS
返回值:
linebreak
tpString tpNetworkInterface::getAddr()
点击查看...
获取网卡IP地址
返回值:
linebreak
tpInt32 tpNetworkInterface::setAddr(const tpString &addr)
点击查看...
设置网卡IP地址
返回值:
linebreak
tpString tpNetworkInterface::getMacAddr()
点击查看...
获取网卡MAC地址
返回值:
linebreak
tpInt32 tpNetworkInterface::setMacAddr(const tpString &addr)
点击查看...
设置网卡MAC地址
返回值:
linebreak
tpString tpNetworkInterface::getNetmask()
点击查看...
获取网卡子网掩码
返回值:
linebreak
tpInt32 tpNetworkInterface::setNetmask(const tpString &addr)
点击查看...
设置网卡子网掩码
返回值:
linebreak
tpString tpNetworkInterface::getBroadAddr()
点击查看...
获取广播地址
返回值:
linebreak
tpInt32 tpNetworkInterface::setBroadAddr(const tpString &addr)
点击查看...
设置广播地址
返回值:
linebreak
tpString tpNetworkInterface::getAddrIpv6()
点击查看...
获取IPV6地址
返回值:
linebreak
tpInt32 tpNetworkInterface::setAddrIpv6(const tpString &addr)
点击查看...
设置IPV6地址
返回值:
linebreak
tpInt32 tpNetworkInterface::startScan()
点击查看...
开始扫描无线网络
返回值:
linebreak
tpInt32 tpNetworkInterface::stopScan()
点击查看...
停止无线网络扫描
返回值:
linebreak
tpList< tpWirelessInfo > tpNetworkInterface::getScan()
点击查看...
获取扫描结果
返回值:
linebreak
tpInt32 tpNetworkInterface::connectWireless(const tpString &ssid, const tpString &psk="", tpUInt32 timeout=50000)
点击查看...
连接到加密无线网络
返回值:
linebreak
tpInt32 tpNetworkInterface::disconnectWireless()
点击查看...
断开无线网络的连接
返回值:
linebreak
tpString tpNetworkInterface::getWirelessSsid()
点击查看...
获取连接的wifi的SSID
返回值:
linebreak
tpInt32 tpNetworkInterface::setHotspotSsid(const tpString &ssid)
点击查看...
设置本机热点的的SSID
返回值:
linebreak
tpInt32 tpNetworkInterface::setHotspotPwd(const tpString &password)
点击查看...
设置本机热点的密码
返回值:
linebreak
tpInt32 tpNetworkInterface::openHotspot()
点击查看...
打开本机热点
返回值:
linebreak
static tpList< tpNetworkInterface > tpNetworkInterface::getAllDevice()
点击查看...
获取所有网卡硬件
返回值:
linebreak