Skip to content

Commit

Permalink
Fix: DtvProperty 構造体の定義を修正 (Close #5)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsukumijima committed Aug 15, 2024
1 parent 628fdd1 commit 375f100
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions isdb_scanner/tuner.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,9 +492,16 @@ class DvbFrontendInfo(ctypes.Structure):
]
class DtvProperty(ctypes.Structure):
class _u(ctypes.Union):
class _buffer(ctypes.Structure):
_fields_ = [
('data', ctypes.c_uint8 * 32),
('len', ctypes.c_uint32),
('reserved1', ctypes.c_uint32 * 3),
('reserved2', ctypes.c_void_p)
]
_fields_ = [
('data', ctypes.c_uint32),
('buffer', ctypes.c_uint8 * 32)
('buffer', _buffer)
]
_fields_ = [
('cmd', ctypes.c_uint32),
Expand Down Expand Up @@ -570,8 +577,8 @@ class fe_delivery_system(IntEnum):
# Linux カーネルでは様々な配信方式がサポートされているが、ここでは ISDB-T/ISDB-S に対応しているかだけを調べる
isdbt_supported: bool = False
isdbs_supported: bool = False
for i in range(dtv_prop.u.data):
delivery_system = fe_delivery_system(dtv_prop.u.buffer[i])
for i in range(dtv_prop.u.buffer.len):
delivery_system = fe_delivery_system(dtv_prop.u.buffer.data[i])
if delivery_system == fe_delivery_system.SYS_ISDBT:
isdbt_supported = True
elif delivery_system == fe_delivery_system.SYS_ISDBS:
Expand Down

0 comments on commit 375f100

Please sign in to comment.