// File: /workspace/github_c_makefile_star2_O1/connycommy[P]atCmdDevice/src/atcmdDev/atCmdDevice.c
// Function: cmIsrRx
void cmIsrRx(cmData_t *obj, const char rxChar){

	/* misra c 15.5*/
	if( (rxChar < (char)CHAR_PRINT_BELOW)  || (rxChar > (char)CHAR_PRINT_ABOVE) ) {
		return ;  /*Char no print*/
	}

	if(1 == obj->rxData.readyAsyncEvent){
		obj->rxData.bufferAsyncEvent[obj->rxData.indexAsyncEvent++] = rxChar;
		if(obj->rxData.indexAsyncEvent > CM_BUFFER_LEN_DEF ){
			obj->rxData.indexAsyncEvent = 0;
		}
		obj->rxData.bufferAsyncEvent[obj->rxData.indexAsyncEvent] = 0;

		if(rxChar == '\n'){
			 obj->rxData.readyAsyncEvent = 0;
			 obj->rxData.asyncEvent=1;
			 obj->rxData.countAsyncEvent++;
		}
	}else{
		obj->rxData.readyAsyncEvent = findStrCharByChar("URC",rxChar);
	}

	/*misra c 15.6,14.4 , 15.6*/
	if( 1 == obj->rxData.ready) {
		return; /* B_uffer reveived*/
	}
	 obj->rxData.buffer[obj->rxData.index] = rxChar; /*misra c 13.3*/
	obj->rxData.index++;

	if (obj->rxData.index >= (obj->rxData.len - (uint8_t)1) ) { /* misra c 10.4*/
		obj->rxData.index = 0; 
	}
	 obj->rxData.buffer[obj->rxData.index] = (char)0;

	#ifdef _USE_STRSTR_FROM_ISR
     //TODO: remove strstr and compare character singly
     if( (strstr((const char*)obj->rxData.buffer, obj->matchResponseFromIsr) != NULL) ||
	 	(strstr((const char*)obj->rxData.buffer, CM_CMD_ERROR_RESPONSE_FROM_ISR ) != NULL) /*exit when error or ok*/
		 ){
        obj->rxData.index = 0;
		obj->rxData.ready = 1; // completed frame
     }
	 if(strstr((const char*)obj->rxData.buffer, CM_CMD_URC_RESPONSE_FROM_ISR ) != NULL){
		 if(rxChar == '\n'){
			obj->rxData.index = 0;
			obj->rxData.ready = 1; // completed frame
			obj->rxData.asyncEvent = 1; // async event frame
		 }
	 }
	 #else
	 IsrStrResponseCmpManually(obj, rxChar);
	 #endif
}

// Assembly:
leal -0x7b(%rsi), %eax
cmpb $-0x71, %al
jb 0x152b
movb 0x20(%rdi), %al
cmpb $0x1, %al
jne 0x1473
movq 0x18(%rdi), %rax
movzwl 0x32(%rdi), %ecx
leal 0x1(%rcx), %edx
movw %dx, 0x32(%rdi)
movb %sil, (%rax,%rcx)
movzwl 0x32(%rdi), %eax
cmpw $0x401, %ax             # imm = 0x401
jb 0x1454
movw $0x0, 0x32(%rdi)
movq 0x18(%rdi), %rax
movzwl 0x32(%rdi), %ecx
movb $0x0, (%rax,%rcx)
cmpb $0xa, %sil
jne 0x14a6
movb $0x0, 0x20(%rdi)
movb $0x1, 0x22(%rdi)
incb 0x23(%rdi)
jmp 0x14a6
movl 0xb14f(%rip), %eax      # 0xc5c8
leal 0x1(%rax), %ecx
xorl %edx, %edx
cmpq $0x2, %rax
sete %r8b
leaq 0x5b77(%rip), %r9       # 0x7004
cmovel %edx, %ecx
cmpb %sil, (%rax,%r9)
cmovnel %edx, %ecx
sete %al
andb %r8b, %al
movl %ecx, 0xb125(%rip)      # 0xc5c8
movb %al, 0x20(%rdi)
movb 0x21(%rdi), %al
cmpb $0x1, %al
je 0x152b
movq 0x10(%rdi), %rax
movzwl 0x30(%rdi), %ecx
movb %sil, (%rax,%rcx)
incw 0x30(%rdi)
movzwl 0x30(%rdi), %eax
movq 0x28(%rdi), %rcx
decq %rcx
cmpq %rax, %rcx
ja 0x14d3
movw $0x0, 0x30(%rdi)
movq 0x10(%rdi), %rax
movzwl 0x30(%rdi), %ecx
movb $0x0, (%rax,%rcx)
movq 0x50(%rdi), %rax
testq %rax, %rax
je 0x152b
movq 0xb0c9(%rip), %r9       # 0xc5b8
movl $0x3, %edx
movq 0xb0c5(%rip), %rcx      # 0xc5c0
xorl %r8d, %r8d
movq (%rax,%r9,8), %r10
cmpb %sil, (%r10,%rcx)
je 0x152c
movq %r8, 0xb0b1(%rip)       # 0xc5c0
cmpq $0x2, %r9
leaq 0x1(%r9), %r9
cmoveq %r8, %r9
movq %r9, 0xb096(%rip)       # 0xc5b8
movl $0x0, %ecx
decl %edx
jne 0x14fe
retq
cmpq 0x38(%rdi,%r9,8), %rcx
jne 0x154c
movb $0x1, 0x21(%rdi)
movq $0x0, 0xb076(%rip) # 0xc5b8
movw $0x0, 0x30(%rdi)
xorl %ecx, %ecx
jmp 0x154f
incq %rcx
movq %rcx, 0xb06a(%rip)      # 0xc5c0
retq