Add Python & USB API for controlling phone power (#313)

* Added interface for phone power

* Add power function in python

* Fixed struct
This commit is contained in:
robbederks
2019-11-04 17:26:37 -08:00
committed by GitHub
parent ba9fb69f65
commit e0762c2e77
8 changed files with 38 additions and 7 deletions

View File

@@ -626,4 +626,8 @@ class Panda(object):
def get_fan_rpm(self):
dat = self._handle.controlRead(Panda.REQUEST_IN, 0xb2, 0, 0, 2)
a = struct.unpack("H", dat)
return a[0]
return a[0]
# ****************** Phone *****************
def set_phone_power(self, enabled):
self._handle.controlWrite(Panda.REQUEST_OUT, 0xb3, int(enabled), 0, b'')