plocHandler test wip
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
import struct
|
||||
from typing import Tuple
|
||||
from config.object_ids import ObjIdIds
|
||||
from pus_tc.ploc import PlocActionIds
|
||||
|
||||
|
||||
def user_analyze_service_8_data(
|
||||
@ -25,7 +27,20 @@ def user_analyze_service_8_data(
|
||||
data_string = data_string.rstrip(',')
|
||||
data_string = data_string.rstrip()
|
||||
content_list = [data_string]
|
||||
elif object_id == ObjIdIds.PLOC_ID:
|
||||
return handle_ploc_replies(custom_data)
|
||||
else:
|
||||
header_list = []
|
||||
content_list = []
|
||||
return header_list, content_list
|
||||
|
||||
|
||||
def handle_ploc_replies(custom_data: bytearray) -> Tuple[list, list]:
|
||||
header_list = []
|
||||
content_list = []
|
||||
action_id = struct.unpack('!I', custom_data[0:4])
|
||||
if action_id == PlocActionIds.tc_mem_read:
|
||||
header_list = ['PLOC Read Memory Data']
|
||||
memory_data = struct.unpack('!I', custom_data[4:8])
|
||||
content_list = [memory_data]
|
||||
return header_list, content_list
|
||||
|
Reference in New Issue
Block a user