Skip to content

Commit

Permalink
Commands for updating dti current limit
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardclifford committed Apr 28, 2023
1 parent 2c09026 commit 398e86f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions backend/dashboardinterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,18 @@ async def message_handler(self, websocket):
await websocket.send(json.dumps({"lap_total": data["laps"]}))
self.race.set_lap_n(data["laps"])

elif (data['opt'] == 'SET_DC_LIM'):
bus = 0
data = struct.pack('>h', data['dc_limit'] * 10)
msg = can.Message(arbitration_id=8710, data=data, is_extended_id=True)
self.vi.send_can_msg(bus, msg)

elif (data['opt'] == 'SET_AC_LIM'):
bus = 0
data = struct.pack('>h', data['ac_limit'] * 10)
msg = can.Message(arbitration_id=8198, data=data, is_extended_id=True)
self.vi.send_can_msg(bus, msg)

elif (data['opt'] == 'SET_TCS'):
bus = 0
data = struct.pack('<B', data['strength'])
Expand Down

0 comments on commit 398e86f

Please sign in to comment.