Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fmupdate
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李定达
fmupdate
Commits
7795de17
Commit
7795de17
authored
Jun 20, 2019
by
yunpeng.song
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
凑凑版(posno 为 mac地址)
parent
a5eae3da
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
73 additions
and
2 deletions
+73
-2
fmscupd/fmcontrol.cpp
+27
-0
fmscupd/fmcontrol.h
+1
-0
fmscupd/fmscupd.pro
+2
-1
fmscupd/fmtools.cpp
+42
-1
fmscupd/fmtools.h
+1
-0
No files found.
fmscupd/fmcontrol.cpp
View file @
7795de17
...
...
@@ -15,6 +15,7 @@
#include <tlhelp32.h>
#include <Userenv.h>
#include <QProcess>
#include <QNetworkInterface>
#include "JlCompress.h"
FmControl
::
FmControl
()
...
...
@@ -484,3 +485,29 @@ bool FmControl::_KillProcess(const QStringList &exeList, QString &error)
return
true
;
}
//获取机器mac地址
void
FmControl
::
getMac
(
QString
&
mac
)
{
QStringList
mac_list
;
QString
strMac
;
QList
<
QNetworkInterface
>
ifaces
=
QNetworkInterface
::
allInterfaces
();
for
(
int
i
=
0
;
i
<
ifaces
.
count
();
i
++
)
{
QNetworkInterface
iface
=
ifaces
.
at
(
i
);
//过滤掉本地回环地址、没有开启的地址
if
(
iface
.
flags
().
testFlag
(
QNetworkInterface
::
IsUp
)
&&
!
iface
.
flags
().
testFlag
(
QNetworkInterface
::
IsLoopBack
))
{
//过滤掉虚拟地址
if
(
!
(
iface
.
humanReadableName
().
contains
(
"VMware"
,
Qt
::
CaseInsensitive
)))
{
strMac
=
iface
.
hardwareAddress
();
mac_list
.
append
(
strMac
);
}
}
}
if
(
mac_list
.
size
()
==
0
||
mac_list
.
at
(
0
).
isEmpty
()){
mac
=
"00-00-00-00-00-00-00-00"
;
}
mac
=
mac_list
.
at
(
0
);
}
fmscupd/fmcontrol.h
View file @
7795de17
...
...
@@ -17,6 +17,7 @@ public:
* */
void
Start
();
static
void
getMac
(
QString
&
mac
);
private
:
// 程序守护定时器
QTimer
m_keepTimer
;
...
...
fmscupd/fmscupd.pro
View file @
7795de17
...
...
@@ -12,7 +12,8 @@ DEFINES += QUAZIP_STATIC
#DEFINES += SHAN_LIN
#DEFINES += BALIBEITIAN
#DEFINES += AXMX
DEFINES
+=
SAAS
#DEFINES += SAAS
DEFINES
+=
CHOUCHOU
#DEFINES += AI_SEN
#DEFINES += TODAY
...
...
fmscupd/fmtools.cpp
View file @
7795de17
...
...
@@ -6,6 +6,7 @@
#include <QDomComment>
#include <QDomElement>
#include <QSqlQuery>
#include <QNetworkInterface>
#include <QFile>
#include <QDir>
...
...
@@ -115,6 +116,11 @@ FmTools::FmTools()
m_partnerId
=
"66666"
;
#endif
#ifdef CHOUCHOU
m_partnerId
=
"2143"
;
#endif
#ifdef BALIBEITIAN
#define MY_CFG "FMPOS.ini"
...
...
@@ -317,7 +323,11 @@ QByteArray FmTools::GetUpdateData()
rObj
.
insert
(
JSON_STOREID
,
storeid
);
rObj
.
insert
(
JSON_POSNO
,
relposid
);
#elif CHOUCHOU
QString
mac
=
""
;
getMac
(
mac
);
rObj
.
insert
(
JSON_STOREID
,
"coucou6666"
);
rObj
.
insert
(
JSON_POSNO
,
mac
);
#else
rObj
.
insert
(
JSON_STOREID
,
setting
.
value
(
m_keyStoreId
).
toString
());
rObj
.
insert
(
JSON_POSNO
,
setting
.
value
(
m_keyPosId
).
toString
());
...
...
@@ -366,6 +376,11 @@ QByteArray FmTools::GetReportData(QString planid, QString msg, QString updateSta
rObj
.
insert
(
JSON_STOREID
,
storeid
);
rObj
.
insert
(
JSON_POSNO
,
relposid
);
#elif CHOUCHOU
QString
mac
=
""
;
getMac
(
mac
);
rObj
.
insert
(
JSON_STOREID
,
"coucou6666"
);
rObj
.
insert
(
JSON_POSNO
,
mac
);
#else
rObj
.
insert
(
JSON_STOREID
,
setting
.
value
(
m_keyStoreId
).
toString
());
rObj
.
insert
(
JSON_POSNO
,
setting
.
value
(
m_keyPosId
).
toString
());
...
...
@@ -377,3 +392,29 @@ QByteArray FmTools::GetReportData(QString planid, QString msg, QString updateSta
rObj
.
insert
(
JSON_MSG
,
msg
);
return
QJsonDocument
(
rObj
).
toJson
(
QJsonDocument
::
Compact
);
}
//获取机器mac地址
void
FmTools
::
getMac
(
QString
&
mac
)
{
QStringList
mac_list
;
QString
strMac
;
QList
<
QNetworkInterface
>
ifaces
=
QNetworkInterface
::
allInterfaces
();
for
(
int
i
=
0
;
i
<
ifaces
.
count
();
i
++
)
{
QNetworkInterface
iface
=
ifaces
.
at
(
i
);
//过滤掉本地回环地址、没有开启的地址
if
(
iface
.
flags
().
testFlag
(
QNetworkInterface
::
IsUp
)
&&
!
iface
.
flags
().
testFlag
(
QNetworkInterface
::
IsLoopBack
))
{
//过滤掉虚拟地址
if
(
!
(
iface
.
humanReadableName
().
contains
(
"VMware"
,
Qt
::
CaseInsensitive
)))
{
strMac
=
iface
.
hardwareAddress
();
mac_list
.
append
(
strMac
);
}
}
}
if
(
mac_list
.
size
()
==
0
||
mac_list
.
at
(
0
).
isEmpty
()){
mac
=
"00-00-00-00-00-00-00-00"
;
}
mac
=
mac_list
.
at
(
0
);
}
fmscupd/fmtools.h
View file @
7795de17
...
...
@@ -59,6 +59,7 @@ public:
bool
ReadXml
(
QString
xmlfilename
,
QMap
<
QString
,
QString
>
&
value
,
QString
key
,
QString
&
outNum
,
bool
flg
=
true
);
static
void
getMac
(
QString
&
mac
);
private
:
FmTools
();
~
FmTools
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment