Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command ECHO - Non-Buffer Bug #58

Open
kb1lqd opened this issue Jan 6, 2017 · 1 comment
Open

Command ECHO - Non-Buffer Bug #58

kb1lqd opened this issue Jan 6, 2017 · 1 comment
Assignees
Labels

Comments

@kb1lqd
Copy link
Contributor

kb1lqd commented Jan 6, 2017

Problem Summary
I found during device testing script creation that the ECHO command in command.c was not reliable when used multiple times in quick succession.

Symptoms

  • Data to be ECHO'd is not returned from the unit and is lost occasionally, most notable during high volume use cases
@kb1lqd kb1lqd self-assigned this Jan 6, 2017
@kb1lqd kb1lqd added the bug label Jan 6, 2017
@kb1lqd kb1lqd added this to the Initial Release milestone Jan 6, 2017
@kb1lqd
Copy link
Contributor Author

kb1lqd commented Jan 6, 2017

I found that the command.c ECHO command directly implemented the UART Layer 4 transmit routine without a buffer our involvement of the housekeeping routines. This likely causes a race condition where occasionally another function buffer is attempting to transmit and the ECHO data is interjected during a transmission. A function in the housekeeping routing such as telemetry running immediately after an ECHO was placed into the Layer 4 transmit structure could cause issues at first thought.

switch (packet_parsed.command){
			//Command = ECHO
			case 1:
				uart_send(2, 62, packet_parsed.payload);
				break;
void uart_send(unsigned char service_number, unsigned char payload_length, unsigned char *payload){
	uart_transport_tx_packet(service_number,payload_length, payload);
}
unsigned char uart_transport_tx_packet(unsigned char service_number, unsigned char payload_length, unsigned char *payload){
	UART_TRANSPORT_PACKET_STRUCT uart_tx_transport_pkt_struct;
	//Create transport packet
	uart_transport_create_packet(&uart_tx_transport_pkt_struct, service_number, payload_length, payload);
	unsigned char status;
	//Place tranport packet into datalink packet to transmit
	status = uart_datalink_put_tx(0xFF, 0x00, UART_L4_PACKET_LENGTH, &uart_tx_transport_pkt_struct);
	return status;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant