summaryrefslogtreecommitdiff
path: root/lib/zephyr_tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/zephyr_tests.py')
-rwxr-xr-xlib/zephyr_tests.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/zephyr_tests.py b/lib/zephyr_tests.py
index 041c2de..12864e0 100755
--- a/lib/zephyr_tests.py
+++ b/lib/zephyr_tests.py
@@ -325,6 +325,7 @@ class libZephyr(object):
"ZExpandRealm",
"ZOpenPort",
"ZClosePort",
+ "ZMakeAscii",
]
def __init__(self, library_path=None):
"""connect to the library and build the wrappers"""
@@ -405,9 +406,30 @@ class libZephyr(object):
POINTER(c_ushort), # port
]
+ # Code_t
+ # ZMakeAscii(register char *ptr,
+ # int len,
+ # unsigned char *field,
+ # int num)
+ self.ZMakeAscii.argtypes = [
+ c_char_p, # ptr
+ c_int, # len
+ c_char_p, # field; c_uchar_p?
+ c_int, # num
+ ]
+
+
# library-specific setup...
self.ZInitialize()
+def py_make_ascii(input):
+ """reference ZMakeAscii expressed as python..."""
+ hexes = ["%02X" % ord(ch) for ch in input]
+ output = []
+ for i in range(0, len(hexes), 4):
+ output.append("0x" + "".join(hexes[i:i+4]))
+ return " ".join(output)
+