open Radio

 avatar
unknown
c_cpp
a year ago
617 B
5
Indexable
	iRet = OsWlCheck();
	OsLog(LOG_ERROR, "iRet %d",iRet);

    if(fp_uart > 0)
        close(fp_uart);

    if(iRet != 0)
        return -1;

	if(0 == iRet){
	    OsLog(LOG_ERROR, "open(/dev/mux1");
	    fp_uart = open("/dev/mux1", O_RDWR | O_NOCTTY);
	}
	else if (iRet < 0){
	    OsLog(LOG_ERROR, "open(/dev/ttyAMA1");
	    fp_uart = open("/dev/ttyAMA1", O_RDWR | O_NOCTTY);
	}
	else{
	    return -1;
	}
	if(fp_uart < 0){
		printf("Open WlPort failed, errno: %d\n", errno);
		return -1;
	}
	
	if (SetOpt(fp_uart, speed, databits, parity, stopbits) < 0){
	    close(fp_uart);
		return -1;
	}
Editor is loading...
Leave a Comment