@@ -677,6 +677,8 @@ void lynxNetwork::comlynx_process()
677677
678678 default :
679679 statusByte.bits .client_error = true ;
680+ Debug_printf (" lynxnetwork::comlynx_process - unknown command: %02X" , cmd);
681+ transaction_error ();
680682 break ;
681683 }
682684}
@@ -763,12 +765,7 @@ void lynxNetwork::parse_and_instantiate_protocol(string d)
763765
764766void lynxNetwork::process_fs (fujiCommandID_t cmd, unsigned pkt_len)
765767{
766- comlynx_recv_buffer (response, pkt_len);
767- comlynx_recv (); // CK
768-
769- SYSTEM_BUS.start_time = esp_timer_get_time ();
770- comlynx_response_ack ();
771-
768+ transaction_get (response, pkt_len);
772769 statusByte.byte = 0x00 ;
773770
774771 parse_and_instantiate_protocol (string ((char *)response, pkt_len));
@@ -778,6 +775,7 @@ void lynxNetwork::process_fs(fujiCommandID_t cmd, unsigned pkt_len)
778775 if (!fs)
779776 {
780777 statusByte.bits .client_error = true ;
778+ transaction_error ();
781779 return ;
782780 }
783781
@@ -808,8 +806,12 @@ void lynxNetwork::process_fs(fujiCommandID_t cmd, unsigned pkt_len)
808806 break ;
809807 }
810808
811- if (cmd_err != PROTOCOL_ERROR::NONE)
809+ if (cmd_err != PROTOCOL_ERROR::NONE) {
810+ transaction_error ();
812811 statusByte.bits .client_error = true ;
812+ }
813+ else
814+ transaction_complete ();
813815}
814816
815817void lynxNetwork::process_tcp (fujiCommandID_t cmd)
@@ -821,6 +823,7 @@ void lynxNetwork::process_tcp(fujiCommandID_t cmd)
821823 if (!tcp)
822824 {
823825 statusByte.bits .client_error = true ;
826+ transaction_error ();
824827 return ;
825828 }
826829
@@ -833,6 +836,7 @@ void lynxNetwork::process_tcp(fujiCommandID_t cmd)
833836 // Because we're not handling Adam bus very well, sometimes it
834837 // retries and we've already accepted which will return an
835838 // error. Don't do accept if client is already connected.
839+ // LYNX NOT LIKE ADAM BUS ANY LONGER -SJ
836840 {
837841 NetworkStatus status;
838842 tcp->status (&status);
@@ -851,8 +855,12 @@ void lynxNetwork::process_tcp(fujiCommandID_t cmd)
851855 break ;
852856 }
853857
854- if (cmd_err != PROTOCOL_ERROR::NONE)
858+ if (cmd_err != PROTOCOL_ERROR::NONE) {
855859 statusByte.bits .client_error = true ;
860+ transaction_error ();
861+ }
862+ else
863+ transaction_complete ();
856864}
857865
858866void lynxNetwork::process_http (fujiCommandID_t cmd)
@@ -864,6 +872,7 @@ void lynxNetwork::process_http(fujiCommandID_t cmd)
864872 if (!http)
865873 {
866874 statusByte.bits .client_error = true ;
875+ transaction_error ();
867876 return ;
868877 }
869878
@@ -878,8 +887,12 @@ void lynxNetwork::process_http(fujiCommandID_t cmd)
878887 return ;
879888 }
880889
881- if (cmd_err != PROTOCOL_ERROR::NONE)
890+ if (cmd_err != PROTOCOL_ERROR::NONE) {
882891 statusByte.bits .client_error = true ;
892+ transaction_error ();
893+ }
894+ else
895+ transaction_complete ();
883896}
884897
885898void lynxNetwork::process_udp (fujiCommandID_t cmd)
@@ -891,6 +904,7 @@ void lynxNetwork::process_udp(fujiCommandID_t cmd)
891904 if (!udp)
892905 {
893906 statusByte.bits .client_error = true ;
907+ transaction_error ();
894908 return ;
895909 }
896910
@@ -914,9 +928,15 @@ void lynxNetwork::process_udp(fujiCommandID_t cmd)
914928 }
915929 break ;
916930 default :
931+ cmd_err = PROTOCOL_ERROR::UNSPECIFIED;
917932 statusByte.bits .client_error = true ;
918933 break ;
919934 }
935+
936+ if (cmd_err != PROTOCOL_ERROR::NONE)
937+ transaction_error ();
938+ else
939+ transaction_complete ();
920940}
921941
922942void lynxNetwork::transaction_complete ()
0 commit comments