Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
p.bit_pattern = output_bitp
sock.sendto(p.for_network(), sender)
elif packet.command == READ_IN_CMD:
input_bitp = pfio.read_input()
p = PfionPacket(READ_IN_ACK)
p.bit_pattern = input_bitp
sock.sendto(p.for_network(), sender)
elif packet.command == DIGITAL_WRITE_CMD:
pfio.digital_write(packet.pin_number, packet.pin_value)
p = PfionPacket(DIGITAL_WRITE_ACK)
sock.sendto(p.for_network(), sender)
elif packet.command == DIGITAL_READ_CMD:
pin_value = pfio.digital_read(packet.pin_number)
p = PfionPacket(DIGITAL_READ_ACK)
p.pin_number = packet.pin_number
p.pin_value = pin_value
sock.sendto(p.for_network(), sender)
elif callback != None:
callback(packet, sender)
elif verbose:
print "Unkown packet command (%d). Ignoring." % packet.command