/* Detect HART command zero from a freshly received buffer. */
static int32_t cn0414_process_hart_detect_command_zero(struct cn0414_dev *dev)
/* Detect HART command zero from a freshly received buffer. */
static int32_t cn0414_process_hart_detect_command_zero(struct cn0414_dev *dev)
{
	uint8_t i = 1, k = 0;
	i = 1;
	while(i <= 20) {
		if(dev->hart_buffer[i] == 0xFF) {
			i++;
			continue;
		} else {
			break;
		}
	}
	if(i <= 20) {
		for(k = 0; k < HART_COMMAND_ZERO_SIZE; k++) {
			if(dev->hart_buffer[i + k] != hart_command_zero[k])
				break;
		}
	}
	if(k == HART_COMMAND_ZERO_SIZE) {
		if(dev->hart_buffer[i + k] == 0xFF)
			return usr_uart_write_string(dev->uart_descriptor,
						     (uint8_t*)"Command zero detected.\n");
	}
	return 0;
}