Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
elphel-web-393
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
elphel-web-393
Commits
8a13c1a4
Commit
8a13c1a4
authored
Dec 20, 2016
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed broadcast mask for GET requests
parent
703582df
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
26 deletions
+32
-26
parsedit.php
src/php_top/parsedit.php
+32
-26
No files found.
src/php_top/parsedit.php
View file @
8a13c1a4
...
@@ -808,6 +808,7 @@ function applyPost_debug($todo,$noFinalWait=false) {
...
@@ -808,6 +808,7 @@ function applyPost_debug($todo,$noFinalWait=false) {
}
}
}
}
$broadcast_sorted
=
split_broadcast
(
$pgmpars
);
$broadcast_sorted
=
split_broadcast
(
$pgmpars
);
ksort
(
$broadcast_sorted
);
ksort
(
$broadcast_sorted
);
$frame_to_apply
=
$frame_zero
+
$since
;
$frame_to_apply
=
$frame_zero
+
$since
;
if
(
$since
<
0
){
if
(
$since
<
0
){
...
@@ -932,6 +933,7 @@ function split_broadcast($pgmpars){
...
@@ -932,6 +933,7 @@ function split_broadcast($pgmpars){
unset
(
$pgmpars
[
$name
]);
unset
(
$pgmpars
[
$name
]);
}
}
}
}
$broadcast
=
array
(
0
=>
array
());
$broadcast
=
array
(
0
=>
array
());
foreach
(
$port_masks
as
$key
=>
$value
){
foreach
(
$port_masks
as
$key
=>
$value
){
// if (!in_array($value,$broadcast)) $broadcast[] = $value;
// if (!in_array($value,$broadcast)) $broadcast[] = $value;
...
@@ -960,34 +962,33 @@ function parsePost() {
...
@@ -960,34 +962,33 @@ function parsePost() {
if
(
!
$posted_params
[
$index
])
$posted_params
[
$index
]
=
array
();
if
(
!
$posted_params
[
$index
])
$posted_params
[
$index
]
=
array
();
$posted_params
[
$index
][
$name
]
=
$value
;
$posted_params
[
$index
][
$name
]
=
$value
;
}
}
}
}
// file_put_contents("/tmp/parse_post.log",print_r($_POST,1));
// file_put_contents("/tmp/posted_params.log",print_r($posted_params,1));
}
}
/// Simulate POST from URL parameters if 'immediate' is present in the URL
/// Simulate POST from URL parameters if 'immediate' is present in the URL
function
convertImmediateMode
(){
function
convertImmediateMode
(){
global
$posted_params
,
$global_params
,
$frame_params
;
global
$posted_params
,
$global_params
,
$frame_params
;
$posted_params
=
array
();
$posted_params
=
array
();
$index
=
0
;
$index
=
0
;
foreach
(
$global_params
as
$param
)
{
foreach
(
$global_params
as
$param
)
{
$posted_params
[
$index
++
]
=
array
(
$posted_params
[
$index
++
]
=
array
(
'name'
=>
$param
[
'name'
],
'name'
=>
$param
[
'name'
],
'oldval'
=>
$param
[
'cur_value'
],
'oldval'
=>
$param
[
'cur_value'
],
'paramdec'
=>
$param
[
'value'
],
/// 'paramhex' is not used
'paramdec'
=>
$param
[
'value'
],
/// 'paramhex' is not used
'delay'
=>
$param
[
'ahead'
],
'delay'
=>
$param
[
'ahead'
],
'apply'
=>
$param
[
'write_en'
]
&&
$param
[
'modified'
]
'broadcast'
=>
$param
[
'port_mask'
],
);
'apply'
=>
$param
[
'write_en'
]
&&
$param
[
'modified'
]
}
);
foreach
(
$frame_params
as
$param
)
{
}
$posted_params
[
$index
++
]
=
array
(
foreach
(
$frame_params
as
$param
)
{
'name'
=>
$param
[
'name'
],
$posted_params
[
$index
++
]
=
array
(
'oldval'
=>
$param
[
'cur_value'
],
'name'
=>
$param
[
'name'
],
'paramdec'
=>
$param
[
'value'
],
/// 'paramhex' is not used
'oldval'
=>
$param
[
'cur_value'
],
'delay'
=>
$param
[
'ahead'
],
'paramdec'
=>
$param
[
'value'
],
/// 'paramhex' is not used
'apply'
=>
$param
[
'write_en'
]
&&
$param
[
'modified'
]
'delay'
=>
$param
[
'ahead'
],
);
'broadcast'
=>
$param
[
'port_mask'
],
}
'apply'
=>
$param
[
'write_en'
]
&&
$param
[
'modified'
]
);
}
}
}
function
extractNames
(
$arr
){
function
extractNames
(
$arr
){
$names
=
array
();
$names
=
array
();
...
@@ -1094,7 +1095,8 @@ function parseGetNames() {
...
@@ -1094,7 +1095,8 @@ function parseGetNames() {
if
(
!
$embedImageScale
)
$embedImageScale
=
$defaultEmbedImageScale
;
if
(
!
$embedImageScale
)
$embedImageScale
=
$defaultEmbedImageScale
;
}
else
if
(
$key
==
'_time'
)
{
}
else
if
(
$key
==
'_time'
)
{
}
else
if
(
$key
==
'sensor_port'
)
{
}
else
if
(
$key
==
'sensor_port'
)
{
}
else
if
(
$key
[
0
]
==
'*'
)
{
}
else
{
}
else
{
/// locate $key among constants, accept numeric values also
/// locate $key among constants, accept numeric values also
$address
=
myval
(
$key
);
$address
=
myval
(
$key
);
...
@@ -1117,6 +1119,10 @@ function parseGetNames() {
...
@@ -1117,6 +1119,10 @@ function parseGetNames() {
$value
=
substr
(
$value
,
strpos
(
$value
,
"!"
)
+
1
);
$value
=
substr
(
$value
,
strpos
(
$value
,
"!"
)
+
1
);
}
}
if
(
isset
(
$_GET
[
"*
$key
"
]))
{
$port_mask
=
myval
(
$_GET
[
"*
$key
"
]);
}
$write_en
=
(
!
(
$value
[
0
]
==
"@"
));
$write_en
=
(
!
(
$value
[
0
]
==
"@"
));
if
(
!
$write_en
)
{
if
(
!
$write_en
)
{
if
(
strlen
(
$value
)
==
1
)
$value
=
""
;
if
(
strlen
(
$value
)
==
1
)
$value
=
""
;
...
...
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