Skip to content
Snippets Groups Projects
Commit 359a2e9d authored by gavanderhoorn's avatar gavanderhoorn Committed by ipa-fxm
Browse files

driver: sizeof(io_msgs) is 8 bytes, not 8 ints. Fix #107.

Also correct some minor formatting issues.
parent 1373f319
Branches
Tags
No related merge requests found
...@@ -236,41 +236,41 @@ def driverProg(): ...@@ -236,41 +236,41 @@ def driverProg():
elif mtype == MSG_SET_DIGITAL_OUT: elif mtype == MSG_SET_DIGITAL_OUT:
#send_out("Received Digital Out Signal") #send_out("Received Digital Out Signal")
# Reads the parameters # Reads the parameters
params_mult = socket_read_binary_integer(1+6+1) params_mult = socket_read_binary_integer(2)
if params_mult[0] == 0: if params_mult[0] == 0:
send_out("Received no parameters for set_out message") send_out("Received no parameters for set_digital_out message")
end end
if params_mult[2] > 0: if params_mult[2] > 0:
set_digital_out(params_mult[1], True) set_digital_out(params_mult[1], True)
elif params_mult[2] == 0: elif params_mult[2] == 0:
set_digital_out(params_mult[1], False) set_digital_out(params_mult[1], False)
end end
elif mtype == MSG_SET_FLAG: elif mtype == MSG_SET_FLAG:
#send_out("Received Set Flag Signal") #send_out("Received Set Flag Signal")
# Reads the parameters # Reads the parameters
params_mult = socket_read_binary_integer(1+6+1) params_mult = socket_read_binary_integer(2)
if params_mult[0] == 0: if params_mult[0] == 0:
send_out("Received no parameters for set_out message") send_out("Received no parameters for set_flag message")
end end
if params_mult[2] != 0: if params_mult[2] != 0:
set_flag(params_mult[1], True) set_flag(params_mult[1], True)
elif params_mult[2] == 0: elif params_mult[2] == 0:
set_flag(params_mult[1], False) set_flag(params_mult[1], False)
end end
elif mtype == MSG_SET_ANALOG_OUT: elif mtype == MSG_SET_ANALOG_OUT:
#send_out("Received Analog Out Signal") #send_out("Received Analog Out Signal")
# Reads the parameters # Reads the parameters
params_mult = socket_read_binary_integer(1+6+1) params_mult = socket_read_binary_integer(2)
if params_mult[0] == 0: if params_mult[0] == 0:
send_out("Received no parameters for set_out message") send_out("Received no parameters for set_analog_out message")
end end
set_analog_out(params_mult[1], (params_mult[2] / MULT_analog)) set_analog_out(params_mult[1], (params_mult[2] / MULT_analog))
elif mtype == MSG_SET_TOOL_VOLTAGE: elif mtype == MSG_SET_TOOL_VOLTAGE:
#send_out("Received Tool Voltage Signal") #send_out("Received Tool Voltage Signal")
# Reads the parameters # Reads the parameters (also reads second dummy '0' integer)
params_mult = socket_read_binary_integer(1+6+1) params_mult = socket_read_binary_integer(2)
if params_mult[0] == 0: if params_mult[0] == 0:
send_out("Received no parameters for set_out message") send_out("Received no parameters for set_tool_voltage message")
end end
set_tool_voltage(params_mult[1]) set_tool_voltage(params_mult[1])
else: else:
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment