From 8203cc8e59f27c3f6f5390a6200701c191f6d1a7 Mon Sep 17 00:00:00 2001 From: George Hotz Date: Fri, 16 Feb 2018 11:07:20 -0800 Subject: [PATCH] add is_grey --- python/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/__init__.py b/python/__init__.py index 011263f..87d2a30 100644 --- a/python/__init__.py +++ b/python/__init__.py @@ -315,6 +315,10 @@ class Panda(object): def get_version(self): return self._handle.controlRead(Panda.REQUEST_IN, 0xd6, 0, 0, 0x40) + def is_grey(self): + ret = self._handle.controlRead(Panda.REQUEST_IN, 0xc1, 0, 0, 0x40) + return ret == "\x01" + def get_serial(self): dat = self._handle.controlRead(Panda.REQUEST_IN, 0xd0, 0, 0, 0x20) hashsig, calc_hash = dat[0x1c:], hashlib.sha1(dat[0:0x1c]).digest()[0:4]