remove tcp busy loop
authorMart Lubbers <mart@martlubbers.net>
Mon, 27 Feb 2017 16:20:47 +0000 (17:20 +0100)
committerMart Lubbers <mart@martlubbers.net>
Mon, 27 Feb 2017 16:20:47 +0000 (17:20 +0100)
Devices/mTaskTCP.icl
client/main.c

index e0b85e2..dfa7f2f 100644 (file)
@@ -24,9 +24,9 @@ instance MTaskDuplex TCPSettings where
                        onConnect _ (msgs,send,sendStopped) = (Ok "", Just (msgs,[],sendStopped), map encode send, False)
 
                        whileConnected :: (Maybe String) String ([MTaskMSGRecv], [MTaskMSGSend],Bool) -> (MaybeErrorString String, Maybe ([MTaskMSGRecv],[MTaskMSGSend],Bool), [String], Bool)
-                       whileConnected mnewData acc (msgs,send,sendStopped)
-                       | not (trace_tn (printToString (map decode (maybeToList mnewData)))) = undef
-                       = (Ok acc, Just (msgs ++ map decode (maybeToList mnewData),[],sendStopped), map encode send, False)
+                       whileConnected Nothing _ (_,[],_) = (Ok "", Nothing, [], False)
+                       whileConnected md _ (msgs,send,sendStopped)
+                       = (Ok "", Just (msgs++map decode (maybeToList md),[],sendStopped), map encode send, False)
                        
                        onDisconnect :: String ([MTaskMSGRecv],[MTaskMSGSend],Bool) -> (MaybeErrorString String, Maybe ([MTaskMSGRecv],[MTaskMSGSend],Bool))
-                       onDisconnect l (msgs,send,sendStopped) = (Ok l, Nothing)
+                       onDisconnect _ (msgs,send,sendStopped) = (Ok "", Nothing)
index 337834f..9fc91df 100644 (file)
@@ -84,11 +84,11 @@ void loop(void)
                curtask->lastrun = cyclestart;
                if(curtask->interval == 0){
                        curtask->used = false;
-                       write_byte('m');
-                       write_byte('d');
-                       write_byte('\n');
+//                     write_byte('m');
+//                     write_byte('d');
+//                     write_byte('\n');
                }
-               write_byte('\n');
+//             write_byte('\n');
        }
 }