Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def tlm_encoder(self):
encodedurl = []
encodedurl.append(aios.NBytes("VBATT",2))
if "battery" in self.type_payload:
encodedurl[-1].val = self.type_payload["battery"]
else:
encodedurl[-1].val = -128
encodedurl.append(aios.Float88("Temperature"))
if "temperature" in self.type_payload:
encodedurl[-1].val = self.type_payload["temperature"]
else:
encodedurl[-1].val = -128
encodedurl.append(aios.ULongInt("Count"))
if "count" in self.type_payload:
encodedurl[-1].val = self.type_payload["count"]
else:
encodedurl[-1].val = 0
encodedurl.append(aios.ULongInt("Uptime"))
if "uptime" in self.type_payload:
encodedurl[-1].val = self.type_payload["uptime"]
else:
encodedurl[-1].val = 0
return encodedurl
encodedurl[-1].val = self.type_payload["battery"]
else:
encodedurl[-1].val = -128
encodedurl.append(aios.Float88("Temperature"))
if "temperature" in self.type_payload:
encodedurl[-1].val = self.type_payload["temperature"]
else:
encodedurl[-1].val = -128
encodedurl.append(aios.ULongInt("Count"))
if "count" in self.type_payload:
encodedurl[-1].val = self.type_payload["count"]
else:
encodedurl[-1].val = 0
encodedurl.append(aios.ULongInt("Uptime"))
if "uptime" in self.type_payload:
encodedurl[-1].val = self.type_payload["uptime"]
else:
encodedurl[-1].val = 0
return encodedurl