diff --git a/tests/emulator/sa_client_central_unit.cpp b/tests/emulator/sa_client_central_unit.cpp index d35c4ef..a29b306 100644 --- a/tests/emulator/sa_client_central_unit.cpp +++ b/tests/emulator/sa_client_central_unit.cpp @@ -84,7 +84,7 @@ int main_loop() case COMMLAYER_RET_TIMEOUT: { // regular processing will be done below in the next block - printf( "no reply from comm stack received; the last message (if any) will be resent by timer\n" ); + printf( "just waiting...\n" ); zepto_response_to_request( MEMORY_HANDLE_MAIN_LOOP ); goto wait_for_comm_event; break; @@ -130,6 +130,7 @@ int main_loop() zepto_response_to_request( MEMORY_HANDLE_MAIN_LOOP ); send_command: + printf( "=============================================Msg is about to be sent; rq_size: %d, rsp_size: %d\n", ugly_hook_get_request_size( MEMORY_HANDLE_MAIN_LOOP ), ugly_hook_get_response_size( MEMORY_HANDLE_MAIN_LOOP ) ); send_to_commm_stack( MEMORY_HANDLE_MAIN_LOOP ); } diff --git a/tests/emulator/sa_client_comm_stack.cpp b/tests/emulator/sa_client_comm_stack.cpp index 2136b77..00e9792 100644 --- a/tests/emulator/sa_client_comm_stack.cpp +++ b/tests/emulator/sa_client_comm_stack.cpp @@ -89,6 +89,7 @@ int main_loop() wait_for_comm_event: ret_code = wait_for_communication_event( MEMORY_HANDLE_MAIN_LOOP, timer_val*100 ); // TODO: recalculation zepto_response_to_request( MEMORY_HANDLE_MAIN_LOOP ); + printf( "=============================================Msg wait event; ret = %d, rq_size: %d, rsp_size: %d\n", ret_code, ugly_hook_get_request_size( MEMORY_HANDLE_MAIN_LOOP ), ugly_hook_get_response_size( MEMORY_HANDLE_MAIN_LOOP ) ); switch ( ret_code ) { @@ -314,6 +315,7 @@ int main_loop() // 5. SAGDP client_received: + printf( "@client_received: rq_size: %d, rsp_size: %d\n", ugly_hook_get_request_size( MEMORY_HANDLE_MAIN_LOOP ), ugly_hook_get_response_size( MEMORY_HANDLE_MAIN_LOOP ) ); sa_get_time( &(tact.tv) ); tact.action = 0; ret_code = handler_sagdp_receive_hlp( &tact, NULL, MEMORY_HANDLE_MAIN_LOOP, &sagdp_data ); if ( ret_code == SAGDP_RET_NEED_NONCE ) diff --git a/tests/emulator/sa_server.cpp b/tests/emulator/sa_server.cpp index 9e1a598..bbf0fe5 100644 --- a/tests/emulator/sa_server.cpp +++ b/tests/emulator/sa_server.cpp @@ -16,8 +16,8 @@ Copyright (C) 2015 OLogN Technologies AG *******************************************************************************/ -#define MODEL_IN_EFFECT 1 -//#define MODEL_IN_EFFECT 2 +//#define MODEL_IN_EFFECT 1 +#define MODEL_IN_EFFECT 2 #include "sa-common.h" diff --git a/tests/emulator/sa_test_control_prog.cpp b/tests/emulator/sa_test_control_prog.cpp index 499cf21..f1868b9 100644 --- a/tests/emulator/sa_test_control_prog.cpp +++ b/tests/emulator/sa_test_control_prog.cpp @@ -164,11 +164,15 @@ uint8_t default_test_control_program_accept_reply_continue( void* control_prog_s } else { - assert( ps->chain_ini_size == 2 ); +// assert( ps->chain_ini_size == 2 ); + // need to add explicit exit command to specify packet status-in-chain of the reply + zepto_write_uint8( reply, ZEPTOVM_OP_EXIT ); + zepto_write_uint8( reply, (uint8_t)SAGDP_P_STATUS_TERMINATING ); // TODO: if padding is required, add necessary data here + reply_sz = zepto_writer_get_response_size( reply ); } uint8_t hdr = SACCP_NEW_PROGRAM; //TODO: we may want to add extra headers zepto_write_prepend_byte( reply, hdr ); - zepto_write_prepend_byte( reply, SAGDP_P_STATUS_FIRST ); + zepto_write_prepend_byte( reply, SAGDP_P_STATUS_INTERMEDIATE ); // return status diff --git a/tests/emulator/saccp_protocol.cpp b/tests/emulator/saccp_protocol.cpp index 070e487..df68340 100644 --- a/tests/emulator/saccp_protocol.cpp +++ b/tests/emulator/saccp_protocol.cpp @@ -61,12 +61,12 @@ uint8_t handler_sacpp_continue_chain( MEMORY_HANDLE mem_h, void* control_prog_st uint8_t hdr = SACCP_NEW_PROGRAM; //TODO: we may want to add extra headers zepto_write_prepend_byte( mem_h, hdr ); zepto_write_prepend_byte( mem_h, SAGDP_P_STATUS_FIRST );*/ - default_test_control_program_start_new( control_prog_state, mem_h ); + default_test_control_program_accept_reply_continue( control_prog_state, mem_h ); return SACCP_RET_PASS_LOWER; } uint8_t saccp_control_program_process_incoming( MEMORY_HANDLE mem_h, parser_obj* po, uint16_t sz, void* control_prog_state ) -{ +{assert(0); // TODO: process /* uint8_t buff[100]; memset( buff, '?', 99 );