mirror of
https://github.com/commaai/panda.git
synced 2026-06-12 23:27:23 +08:00
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:
@@ -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'')
|
||||
Reference in New Issue
Block a user