Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
HP_2101nw
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Kainhofer
HP_2101nw
Commits
1768490b
Commit
1768490b
authored
13 years ago
by
Reinhold Kainhofer
Browse files
Options
Downloads
Patches
Plain Diff
appliance_setup: Some more 8888 work
parent
4b2159d1
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
appliance_setup/device_types.py
+22
-2
22 additions, 2 deletions
appliance_setup/device_types.py
with
22 additions
and
2 deletions
appliance_setup/device_types.py
+
22
−
2
View file @
1768490b
...
@@ -366,9 +366,9 @@ class Ether8888Device (Device):
...
@@ -366,9 +366,9 @@ class Ether8888Device (Device):
self
.
device_close
()
self
.
device_close
()
self
.
ui
.
wait_enter
(
"
Device was reset. Please press Return.
"
)
self
.
ui
.
wait_enter
(
"
Device was reset. Please press Return.
"
)
def
bulk_data_write
(
self
,
data
,
length
):
def
bulk_data_write
(
self
,
data
,
length
,
cmd
=
"
\x01\x01
"
,
unknown
=
"
\0\0
"
):
packet
=
Ether8888Packet
(
localAddr
=
self
.
localAddr
,
remoteAddr
=
self
.
remoteAddr
)
packet
=
Ether8888Packet
(
localAddr
=
self
.
localAddr
,
remoteAddr
=
self
.
remoteAddr
)
request
=
packet
.
encode
(
"
\x01\x01
"
,
"
\0\0
"
,
0
,
length
,
data
)
request
=
packet
.
encode
(
cmd
,
unknown
,
0
,
length
,
data
)
self
.
ui
.
debug
(
"
Request:
"
+
request
)
self
.
ui
.
debug
(
"
Request:
"
+
request
)
res
=
None
res
=
None
try
:
try
:
...
@@ -407,6 +407,26 @@ class Ether8888Device (Device):
...
@@ -407,6 +407,26 @@ class Ether8888Device (Device):
return
res
[
13
:]
return
res
[
13
:]
TODO
:
def
command_send
(
self
,
cmd
):
cfg
=
"
%s:
\n
"
%
cmd
res
=
self
.
bulk_data_write
(
cfg
,
len
(
cfg
),
cmd
=
"
\x01\x01
"
,
unknown
=
"
\0\0
"
)
return
self
.
bulk_data_read
(
25600
)
def
config_retrieve
(
self
):
self
.
ui
.
debug
(
"
Reading current configuration...
"
);
return
self
.
command_send
(
"
9100
"
)
def
config_send
(
self
,
config
):
self
.
ui
.
progress
(
"
Sending new configuation to the device. Please wait
"
)
cfgstring
=
config
.
to_string
()
self
.
ui
.
debug
(
"
\t
New device config: %s
\n
"
%
cfgstring
)
self
.
bulk_data_write
(
cfgstring
,
len
(
cfgstring
),
cmd
=
"
\0
x02)
self.ui.sleep_progress (10)
# Now reset the device:
return self.device_reset ()
### FTP-based devices like ???
### FTP-based devices like ???
#class FTPDevice (Device):
#class FTPDevice (Device):
# def __init__ (self):
# def __init__ (self):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment