DRONE/dronecommunication.c
int uart_init(int Valueunused){
	uart0_filestream = open(SERIAL, O_RDWR | O_NOCTTY | O_NDELAY );
	if (uart0_filestream == -1)
	{
		printf("Error - Unable to open UART.  Ensure it is not in use by another application\n");
        return uart0_filestream;
	}
	//UART Options
	struct termios options;
	tcgetattr(uart0_filestream, &options);
	options.c_cflag = B57600 | CS8 | CLOCAL | CREAD;		
	options.c_iflag = IGNPAR;
	options.c_oflag = 0;
	options.c_lflag = 0;
	tcflush(uart0_filestream, TCIFLUSH);
	tcsetattr(uart0_filestream, TCSANOW, &options);
    return uart0_filestream;
	//fp = fopen ("GPS_Data.txt","w+");
	//UART Options
}
///////////////////////////////////Added By Indrajit //////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
//>> Initializing serial interface
//------------------------------------------------------------------------------------------------------
Added By Indrajit
>> Initializing serial interface
Added By Indrajit >> Initializing serial interface
int uart_init(int Valueunused){
	uart0_filestream = open(SERIAL, O_RDWR | O_NOCTTY | O_NDELAY );
	if (uart0_filestream == -1)
	{
		printf("Error - Unable to open UART.  Ensure it is not in use by another application\n");
        return uart0_filestream;
	}
	struct termios options;
	tcgetattr(uart0_filestream, &options);
	options.c_cflag = B57600 | CS8 | CLOCAL | CREAD;		
	options.c_iflag = IGNPAR;
	options.c_oflag = 0;
	options.c_lflag = 0;
	tcflush(uart0_filestream, TCIFLUSH);
	tcsetattr(uart0_filestream, TCSANOW, &options);
    return uart0_filestream;
}
int uart_init ( int Valueunused ) { uart0_filestream = open ( SERIAL , O_RDWR | O_NOCTTY | O_NDELAY ) ; if ( uart0_filestream == -1 ) { printf ( " \n " ) ; return uart0_filestream ; } struct termios options ; tcgetattr ( uart0_filestream , & options ) ; options . c_cflag = B57600 | CS8 | CLOCAL | CREAD ; options . c_iflag = IGNPAR ; options . c_oflag = 0 ; options . c_lflag = 0 ; tcflush ( uart0_filestream , TCIFLUSH ) ; tcsetattr ( uart0_filestream , TCSANOW , & options ) ; return uart0_filestream ; }
Added By Indrajit
>> Initializing serial interface
Added By Indrajit >> Initializing serial interface
//UART Options //fp = fopen ("GPS_Data.txt","w+"); //UART Options