>>102174113
Im trying to read a character device for a pen but I cant parse the output, where can I find the driver for my device (galaxy book 2 pro 360), this is a 1024 read: https://pastebin.com/K3wgS0iq
And the code I used
import struct
with open('/dev/input/event13', 'rb') as device:
data = device.read(1024)
# Define the record size
record_size = 26
# Define the format string for unpacking
# The format string should match the structure of the record
format_string = '6s 8s 6s 2s 2s 2s'
# Calculate the number of records
num_records = len(data) // record_size
# Parse each record
records = []
for i in range(num_records):
record = data[i*record_size:(i+1)*record_size]
unpacked = struct.unpack(format_string, record)
records.append(unpacked)
# Print the records
for record in records:
print(record)