Go Back   StudyChaCha 2024 2025 > StudyChaCha Discussion Forum > General Topics

  #1  
Old November 13th, 2011, 07:07 PM
Super Moderator
 
Join Date: Nov 2011
Default Coding For File Transfer Using Rs232c Interface In Java

Coding For File Transfer Using Rs232c Interface In Java

Java is a programming language originally developed by James Gosling at Sun Microsystems at present part of Oracle Corporation and released in 1995 as a core component of Sun Microsystems' Java platform.

Coding For File Transfer Using Rs232c Interface In Java
File Transfer using RS232C

#include

#include

#define COM1 0

#define DATA_READY 0×100

#define SETTINGS(0×80|0×02|0×00|0×00)

#include

int main(void)

{

char msg[1000], msg_in[1000];

char str[1000];

int status, out, in, i=0, extra;

FILE *fp;

int choice;

char c[1000];

printf(“\n1. Send or 2.Receive”);

scanf(“%d”, &choice);

switch(choice)

{

case 1:

{

bioscom(0,SETTINGS,COM1);

printf(“Enter the file name\n”);

scanf(“%s”, str);

while(1)

{

status=bioscom(3,0,COM1);

if(status && DATA_READY)

{

fp=fopen(str,”r”);

while((c[i]=getc(fp))!=EOF)

{

bioscom(1,c[i],COM1);

printf(“%c”, c[i]);

i++;

}

break;

}

}

}

case 2:

{

bioscom(0, SETTINGS, COM1);

fp1 = fopen(“str.c”, “w”);

while(1)

{

status=bioscom(3,0,COM1);

if(status && DATA_READY)

{

while((sam=bioscom(2,0,COM1)&0x7f!=0)

{

msgbox[i]=sam;

printf(“%c”, msgbox[i]);

fprintf(fp1, “%c”, msgbox[i]);

i++;

}

break;

}

}

}

}

getch();

return(0);

}

Last edited by Aakashd; February 16th, 2020 at 03:38 PM.
Reply With Quote
Other Discussions related to this topic
Thread
GIF (ISRO) Coding the Satellite Course
IRS E File Login
IW List Valid Interface Combinations
Web Interface SRM University
Learn Coding Online
Learn Online Coding
Pdf File Of IAS Exam
MBA file
Coding For File Transfer Using Rs3c Interface In Java
Ahima Coding Programs
Interface College of Maritime Studies
Ahima Coding Classes Online
Ahima Coding Courses
User Interface Design Schools
CDM Institute medical Billing and Coding
JMI Java Metadata Interface
Sastra University Parents Web Interface
CPRI Interface Wiki
What is CPRI INTERFACE?
Christ University Interface






  #2  
Old June 4th, 2020, 09:44 AM
Unregistered
Guest
 
Default Re: Coding For File Transfer Using Rs232c Interface In Java

I am doing MCA and searching for JAVA coding details. Will you provide details and Coding For File Transfer Using Rs232c Interface In Java in PDF r else provide Coding For File Transfer?
Reply With Quote
  #3  
Old June 4th, 2020, 09:46 AM
Super Moderator
 
Join Date: Jun 2013
Default Re: Coding For File Transfer Using Rs232c Interface In Java

About RS232C for Data Transfer

RS232 is an Interface and the protocol between DTE(data terminal equipment) and DCE(data communication equipment) using serial binary data exchange.

Here C is used for the current version. Universal Asynchronous Data Receiver & Transmitter (UART), attached in a motherboard, used in connection with RS232 for transmitting data to any serial device like modem or printer from its DTE interface.

Please find the below attached file for details of Coding For File Transfer Using Rs232c Interface In Java:

Coding For File Transfer Using Rs232c Interface In Java







link.springer.com/content/pdf/bbm%3A978-1-4613-1207-9%2F1.pdf

Below I am providing you the coding for Create new class in JAVA:

Create new class named ListAvailablePorts.java and paste following code.

import gnu.io.CommPortIdentifier;

import java.util.Enumeration;

public class ListAvailablePorts {

public void list() {
Enumeration ports = CommPortIdentifier.getPortIdentifiers();

while(ports.hasMoreElements())
System.out.println(((CommPortIdentifier)ports.next Element()).getName());
}

public static void main(String[] args) {
new ListAvailablePorts().list();
}
}
__________________
Answered By StudyChaCha Member
Reply With Quote
Reply




All times are GMT +6. The time now is 01:32 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Friendly URLs by vBSEO 3.6.0 PL2

1 2 3 4 5 6 7 8