imtq service 8 reply, read command dipole

This commit is contained in:
2021-04-26 14:56:51 +02:00
parent 4d2b7a6150
commit e3342cf474
2 changed files with 7 additions and 4 deletions

View File

@ -1,3 +1,4 @@
import struct
from typing import Tuple
from config.object_ids import ObjIdIds
from pus_tc.imtq import ImtqActionIds
@ -37,8 +38,10 @@ def user_analyze_service_8_data(
def handle_imtq_replies(action_id: int, custom_data: bytearray) -> Tuple[list, list]:
header_list = []
content_list = []
if action_id == ImtqActionIds.get_commanded_dipole:
if action_id == struct.unpack('!I', ImtqActionIds.get_commanded_dipole)[0]:
header_list = ['Commanded X-Dipole', 'Commanded Y-Dipole', 'Commanded Z-Dipole']
x_dipole =
content_list = [custom_data[:4], custom_data[4:6], custom_data[6:10]]
x_dipole = struct.unpack('!H', custom_data[:2])
y_dipole = struct.unpack('!H', custom_data[2:4])
z_dipole = struct.unpack('!H', custom_data[4:6])
content_list = [x_dipole[0], y_dipole[0], z_dipole[0]]
return header_list, content_list