Give command object and not data to core methods.

This commit is contained in:
Mikaël Ates 2013-10-08 11:35:14 +02:00
parent 260a075321
commit 33938e4303
1 changed files with 7 additions and 4 deletions

View File

@ -50,13 +50,16 @@ def get_rfsettings(response):
return logic_ports
def set_rfsettings(logic_ports):
def set_rfsettings(command):
'''
Parse response content of 'Get_RFSettings' command.
Return a string representing the data from a list of dict describing
logic ports of the reader..
'''
if not command.data_to_process:
raise MalformedDataError('Data content is malformed.')
logic_ports = command.data_to_process
data = ''
i = 0
for logic_port in logic_ports:
@ -71,8 +74,8 @@ def set_rfsettings(logic_ports):
i += 1
for _ in range(i, 16):
data += '\x00\x00\x00\x00'
return data
command.data_processed = data
def set_rfsettings_saved(logic_ports):
return set_rfsettings(logic_ports)
def set_rfsettings_saved(command):
return set_rfsettings(command)