Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
Production Test Suite - base
Project
Project
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
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Production Test Suite - base
Commits
ddf02977
Commit
ddf02977
authored
Jul 17, 2022
by
Pieter Van Trappen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fmc_eeprom - small improvements and fix to make legacy code run on modern (x64) systems
parent
2f668901
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
10 deletions
+11
-10
.gitignore
.gitignore
+1
-0
bin2dec.py
common/fmceeprom/bin2dec.py
+1
-1
fmc_eeprom.py
common/fmceeprom/fmc_eeprom.py
+8
-6
fmc_eeprom_example.py
common/fmceeprom/fmc_eeprom_example.py
+1
-3
No files found.
.gitignore
View file @
ddf02977
...
...
@@ -3,3 +3,4 @@
*.so
*.a
*.o
*.out
common/fmceeprom/bin2dec.py
View file @
ddf02977
#! /usr/bin/env python
#! /usr/bin/env python
2
# coding: utf8
# Copyright CERN, 2011
...
...
common/fmceeprom/fmc_eeprom.py
View file @
ddf02977
#!/usr/bin/
python
#!/usr/bin/
env python2
from
ctypes
import
*
from
ctypes
import
cdll
,
Structure
,
POINTER
,
cast
,
c_int
,
\
c_char_p
,
c_void_p
,
c_ubyte
,
c_ushort
,
byref
import
array
import
struct
import
os
lib
=
cdll
.
LoadLibrary
(
os
.
path
.
dirname
(
__file__
)
+
"
/libipmi/libipmi.so"
)
lib
=
cdll
.
LoadLibrary
(
".
/libipmi/libipmi.so"
)
class
c_CommonHeader
(
Structure
):
_fields_
=
[
...
...
@@ -331,7 +331,8 @@ def ipmi_get_mfg_date(data):
def
ipmi_get_internal_use_data
(
data
):
l
=
c_int
()
d
=
c_void_p
(
lib
.
ipmi_get_internal_use_data
(
c_char_p
(
data
),
byref
(
l
)))
lib
.
ipmi_get_internal_use_data
.
restype
=
c_void_p
d
=
lib
.
ipmi_get_internal_use_data
(
c_char_p
(
data
),
byref
(
l
))
q
=
cast
(
d
,
POINTER
(
l
.
value
*
c_ubyte
))
return
q
.
contents
...
...
@@ -366,7 +367,8 @@ def main():
ipmi_write
()
ipmi_close_file
()
test
=
open
(
'test.out'
,
'r'
)
.
read
()
with
open
(
'test.out'
,
'rb'
)
as
testf
:
test
=
testf
.
read
()
print
ipmi_get_mfg_date
(
test
)
d
=
ipmi_get_internal_use_data
(
test
)
for
v
in
d
:
...
...
common/fmceeprom/fmc_eeprom_example.py
View file @
ddf02977
#! /usr/bin/env python
#! /usr/bin/env python
2
# coding: utf8
# Copyright CERN, 2011
...
...
@@ -8,8 +8,6 @@
# Last modifications: 16/5/2012
# Import system modules
import
sys
import
time
import
datetime
import
os
...
...
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