Skip to content

Commit 97430b0

Browse files
committed
updated
1 parent 25ad12b commit 97430b0

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

python_hackrf/pylibhackrf/pyhackrf.pyx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,13 @@ cdef class PyHackrfDevice:
274274

275275
def pyhackrf_serialno_read(self) -> str:
276276
read_partid_serialno = self.pyhackrf_board_partid_serialno_read()
277-
return f'{read_partid_serialno[1][0]:08x}{read_partid_serialno[1][1]:08x}{read_partid_serialno[1][2]:08x}{read_partid_serialno[1][3]:08x}'
277+
278+
return '{0:08x}{1:08x}{2:08x}{3:08x}'.format(
279+
read_partid_serialno[1][0],
280+
read_partid_serialno[1][1],
281+
read_partid_serialno[1][2],
282+
read_partid_serialno[1][3]
283+
)
278284

279285
def pyhackrf_set_ui_enable(self, value: bool) -> None:
280286
result = chackrf.hackrf_set_ui_enable(self.__hackrf_device, <uint8_t> 1 if value else 0)

python_hackrf/pylibhackrf/pyhackrf_android.pyx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,13 @@ cdef class PyHackrfDevice:
273273

274274
def pyhackrf_serialno_read(self) -> str:
275275
read_partid_serialno = self.pyhackrf_board_partid_serialno_read()
276-
return f'{read_partid_serialno[1][0]:08x}{read_partid_serialno[1][1]:08x}{read_partid_serialno[1][2]:08x}{read_partid_serialno[1][3]:08x}'
276+
277+
return '{0:08x}{1:08x}{2:08x}{3:08x}'.format(
278+
read_partid_serialno[1][0],
279+
read_partid_serialno[1][1],
280+
read_partid_serialno[1][2],
281+
read_partid_serialno[1][3]
282+
)
277283

278284
def pyhackrf_set_ui_enable(self, value: bool) -> None:
279285
result = chackrf.hackrf_set_ui_enable(self.__hackrf_device, <uint8_t> 1 if value else 0)

0 commit comments

Comments
 (0)