Skip to content

Commit

Permalink
ipAddress over capnp
Browse files Browse the repository at this point in the history
  • Loading branch information
arne182 authored Mar 27, 2020
1 parent 041d394 commit 2e82495
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions selfdrive/thermald/thermald.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from selfdrive.version import terms_version, training_version
from selfdrive.swaglog import cloudlog
import cereal.messaging as messaging
import cereal.messaging_arne as messaging_arne
from selfdrive.loggerd.config import get_available_percent
from selfdrive.pandad import get_expected_version
from selfdrive.thermald.power_monitoring import PowerMonitoring, get_battery_capacity, get_battery_status, get_battery_current, get_battery_voltage, get_usb_present
Expand Down Expand Up @@ -193,7 +194,7 @@ def thermald_thread():

params = Params()
pm = PowerMonitoring()

arne_pm = messaging_arne.PubMaster('ipAddress')
while 1:
health = messaging.recv_sock(health_sock, wait=True)
location = messaging.recv_sock(location_sock)
Expand Down Expand Up @@ -242,8 +243,12 @@ def thermald_thread():
except:
ip_addr = 'N/A'
ts_last_ip = ts
params.put("IPAddress", ip_addr)

params.put("IPAddress", ip_addr)
msg = messaging_arne.new_message()
msg.init('ipAddress ')
msg.ipAddress.ipAddr = ip_addr
arne_pm.send('ipAddress', msg)

current_filter.update(msg.thermal.batteryCurrent / 1e6)

# TODO: add car battery voltage check
Expand Down

0 comments on commit 2e82495

Please sign in to comment.