Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gamera_videos_no_ui
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
1
Merge Requests
1
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
liusq
gamera_videos_no_ui
Commits
0c00f03d
Commit
0c00f03d
authored
Oct 11, 2024
by
“liusq”
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改WIFI判断
parent
0fc5b03b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
13 deletions
+12
-13
CameraHandle.cpp
+2
-3
NonConnectedCameraHandle.cpp
+9
-9
NonConnectedCameraHandle.h
+1
-1
No files found.
CameraHandle.cpp
View file @
0c00f03d
...
@@ -1048,7 +1048,7 @@ int CameraHandle::resetGb28181(){
...
@@ -1048,7 +1048,7 @@ int CameraHandle::resetGb28181(){
bool
result
=
connectedCameraHandle
->
changeCameraIp
(
device
);
bool
result
=
connectedCameraHandle
->
changeCameraIp
(
device
);
int
newHandle
=-
1
;
int
newHandle
=-
1
;
if
(
!
result
){
if
(
!
result
){
result
=
connectedCameraHandle
->
wifiChangeIp
(
reachableIp
,
false
,
old
,
sSn
);
result
=
connectedCameraHandle
->
wifiChangeIp
(
reachableIp
,
old
,
sSn
);
is_wifi
=
true
;
is_wifi
=
true
;
if
(
result
){
if
(
result
){
QThread
::
sleep
(
1
);
QThread
::
sleep
(
1
);
...
@@ -1058,7 +1058,6 @@ int CameraHandle::resetGb28181(){
...
@@ -1058,7 +1058,6 @@ int CameraHandle::resetGb28181(){
if
(
sdk_handle
<
0
){
if
(
sdk_handle
<
0
){
qInfo
()
<<
QString
(
"SN(%1): WIFI老句柄:%2"
).
arg
(
sSn
).
arg
(
old
);
qInfo
()
<<
QString
(
"SN(%1): WIFI老句柄:%2"
).
arg
(
sSn
).
arg
(
old
);
qInfo
()
<<
QString
(
"SN(%1): WIFI新句柄生成失败"
).
arg
(
sSn
);
qInfo
()
<<
QString
(
"SN(%1): WIFI新句柄生成失败"
).
arg
(
sSn
);
this
->
hDevice
=
old
;
this
->
hDevice
=
old
;
return
-
1
;
return
-
1
;
}
else
{
}
else
{
...
@@ -1076,7 +1075,7 @@ int CameraHandle::resetGb28181(){
...
@@ -1076,7 +1075,7 @@ int CameraHandle::resetGb28181(){
MainWindow
::
sp_this
->
findSnMapIp
(
this
->
sSn
,
old_ip
);
MainWindow
::
sp_this
->
findSnMapIp
(
this
->
sSn
,
old_ip
);
if
(
old_ip
.
length
()
>
0
){
if
(
old_ip
.
length
()
>
0
){
if
(
is_wifi
){
if
(
is_wifi
){
result
=
connectedCameraHandle
->
wifiChangeIp
(
old_ip
,
true
,
newHandle
,
sSn
);
result
=
connectedCameraHandle
->
wifiChangeIp
(
old_ip
,
newHandle
,
sSn
);
int
sdk_handle
=
this
->
sdkDevLoginSyn
(
old_ip
,
loginParam
->
nDevPort
,
loginParam
->
sUserName
,
loginParam
->
sPassword
,
3000
);
int
sdk_handle
=
this
->
sdkDevLoginSyn
(
old_ip
,
loginParam
->
nDevPort
,
loginParam
->
sUserName
,
loginParam
->
sPassword
,
3000
);
if
(
sdk_handle
<
0
){
if
(
sdk_handle
<
0
){
qInfo
()
<<
QString
(
"SN(%1): WIFI新句柄生成失败"
).
arg
(
sSn
);
qInfo
()
<<
QString
(
"SN(%1): WIFI新句柄生成失败"
).
arg
(
sSn
);
...
...
NonConnectedCameraHandle.cpp
View file @
0c00f03d
...
@@ -150,18 +150,18 @@ bool NonConnectedCameraHandle::changeCameraIp(vides_data::localDevice &device){
...
@@ -150,18 +150,18 @@ bool NonConnectedCameraHandle::changeCameraIp(vides_data::localDevice &device){
return
true
;
return
true
;
}
}
bool
NonConnectedCameraHandle
::
wifiChangeIp
(
QString
&
Ip
,
bool
is_connect
,
bool
NonConnectedCameraHandle
::
wifiChangeIp
(
QString
&
Ip
,
int
h_device
,
QString
&
sSn
){
int
h_device
,
QString
&
sSn
){
Common
&
instace
=
Common
::
getInstance
();
Common
&
instace
=
Common
::
getInstance
();
XSDK_CFG
::
NetWork_Wifi
wif
;
XSDK_CFG
::
NetWork_Wifi
wif
;
printWifi
(
h_device
,
wif
);
printWifi
(
h_device
,
wif
);
if
(
is_connect
){
//
if(is_connect){
if
(
!
isWifiConnect
(
h_device
,
wif
)){
//
if(!isWifiConnect(h_device,wif)){
qInfo
()
<<
QString
(
"SN(%1): 不是wifi连接"
).
arg
(
sSn
);
//
qInfo()<<QString("SN(%1): 不是wifi连接").arg(sSn);
return
false
;
//
return false;
}
//
}
}
//
}
QString
hex
=
instace
.
DecIpToHexIp
(
Ip
);
QString
hex
=
instace
.
DecIpToHexIp
(
Ip
);
QByteArray
&&
byIp
=
hex
.
toUtf8
();
QByteArray
&&
byIp
=
hex
.
toUtf8
();
...
@@ -292,11 +292,11 @@ bool NonConnectedCameraHandle::distributionNetwork(QString &ip,QString &sSn,int
...
@@ -292,11 +292,11 @@ bool NonConnectedCameraHandle::distributionNetwork(QString &ip,QString &sSn,int
if
(
old
<
0
){
if
(
old
<
0
){
qInfo
()
<<
QString
(
"SN(%1): WIFI修改IP,新生成句柄失败"
).
arg
(
sSn
);
qInfo
()
<<
QString
(
"SN(%1): WIFI修改IP,新生成句柄失败"
).
arg
(
sSn
);
}
else
{
}
else
{
result
=
wifiChangeIp
(
reachableIp
,
false
,
old
,
sSn
);
result
=
wifiChangeIp
(
reachableIp
,
old
,
sSn
);
}
}
}
else
{
}
else
{
qInfo
()
<<
QString
(
"newIP(%1): wifiChangeIp"
).
arg
(
reachableIp
);
qInfo
()
<<
QString
(
"newIP(%1): wifiChangeIp"
).
arg
(
reachableIp
);
result
=
wifiChangeIp
(
reachableIp
,
false
,
old
,
sSn
);
result
=
wifiChangeIp
(
reachableIp
,
old
,
sSn
);
XSDK_DevLogout
(
old
);
XSDK_DevLogout
(
old
);
}
}
}
}
...
...
NonConnectedCameraHandle.h
View file @
0c00f03d
...
@@ -19,7 +19,7 @@ public:
...
@@ -19,7 +19,7 @@ public:
//有线修改相机ip
//有线修改相机ip
bool
changeCameraIp
(
vides_data
::
localDevice
&
device
);
bool
changeCameraIp
(
vides_data
::
localDevice
&
device
);
//无线修改相机ip
//无线修改相机ip
bool
wifiChangeIp
(
QString
&
Ip
,
bool
is_connect
,
int
h_device
,
QString
&
sn
);
bool
wifiChangeIp
(
QString
&
Ip
,
int
h_device
,
QString
&
sn
);
bool
isWifiConnect
(
XSDK_HANDLE
hDevice
,
XSDK_CFG
::
NetWork_Wifi
&
cfg
);
bool
isWifiConnect
(
XSDK_HANDLE
hDevice
,
XSDK_CFG
::
NetWork_Wifi
&
cfg
);
...
...
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