Index: DialysateGenerator.py =================================================================== diff -u -r680670f948d164932a6a68effa940bd8455e820e -rbacdac2eb5cc03bfad1c55e9a3cb0f2f4bda95f5 --- DialysateGenerator.py (.../DialysateGenerator.py) (revision 680670f948d164932a6a68effa940bd8455e820e) +++ DialysateGenerator.py (.../DialysateGenerator.py) (revision bacdac2eb5cc03bfad1c55e9a3cb0f2f4bda95f5) @@ -53,20 +53,24 @@ self.__can_interface = DialityCanMessenger(can_interface=can__interface) self.__can_interface.start() - def fill(self): + def fill(self, startOrStop='start'): """ \brief request the DG board to fill \returns True if ran the command, False otherwise """ - channel_id = 0x01 - requestID = 0x03 - cargo=[] + channel_id = 0x100 + msgID = 1000 - packet = DialityPacket.buildPacket(request_id=requestID, cargo=cargo) + if startOrStop == 'start': + cargo=[1] + else: + cargo=[0] + packet = DialityPacket.buildPacket(request_id=msgID, cargo=cargo) + # Send message received_packet = self.__can_interface.send(channel_id, packet) @@ -95,20 +99,19 @@ if __name__ == "__main__": test_dg = DG() - test_dg.registerSyncReceiver(0x01, 0x05, test_sync_function) sleep(2) - test_packet = test_dg.fill() + test_packet = test_dg.fill('start') test_fill_print(test_packet) sleep(2) - test_packet = test_dg.fill() + test_packet = test_dg.fill('stop') test_fill_print(test_packet) sleep(1) - test_packet = test_dg.fill() + test_packet = test_dg.fill('start') test_fill_print(test_packet) sleep(2) - test_packet = test_dg.fill() + test_packet = test_dg.fill('start') test_fill_print(test_packet)