×

Discussion Board

Results 1 to 13 of 13

Hybrid View

  1. #1
    Regular Contributor
    Join Date
    Dec 2009
    Posts
    79

    Question BLUETOOTH PROBLEM

    Hi all,

    I've found some Bluetooth source code and there I've found the code:

    Code:
     
    BCC.setPortName("COM2");  //setting the port number
    BCC.setBaudRate(57600);//setting the baud rate
    BCC.setConnectable(true);//connectable mode
    BCC.setDiscoverable(DiscoveryAgent.GIAC);
    and the import:

    Code:
    import com.atinav.bcc.*;
    Where can I download the class??? Thank you for your help.

    AND PLEASE HELP ME FAST. CAUSE I REALLY NEED THE ANSWER.

    Benni
    Last edited by benni-europe; 2009-12-23 at 17:38.

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: BLUETOOTH BCC ATINAV Download?

    This is J2SE code? To run on a PC? I think this is dead, look for another implementation of JSR82 on Windows (like BlueCove). You will need to adapt the code.

    Graham.

  3. #3
    Regular Contributor
    Join Date
    Dec 2009
    Posts
    79

    Re: BLUETOOTH BCC ATINAV Download?

    Sorry for your answer. No this is Java ME code. http://www.javabluetooth.com/ Click on "source code". Select chapter 8. There you find the Server code. In the constructor you'll find the code.

    But: WHERE CAN I GET THE API?

    Benni

  4. #4
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: BLUETOOTH BCC ATINAV Download?

    Hmmm... I don't see that. The code I see in Chapter 8 (ChatServer.java) imports com.rococosoft.io.*, whatever that is.

    I suggest you find an example somewhere else. Look here on the Forum wiki. There is no reason you should need third-party libraries to use Bluetooth on a mobile phone.

    It will be much quicker to find a better example, than to find this API.

    Graham.

  5. #5
    Regular Contributor
    Join Date
    Dec 2009
    Posts
    79

    Re: BLUETOOTH BCC ATINAV Download?

    Sorry. The code I meant is in chapter 7.

    Code:
    import javax.microedition.io.*;
    import java.io.*;
    import javax.bluetooth.*;
    import javax.obex.*;
    import com.atinav.bcc.*;
    
    public class FTServer extends ServerRequestHandler{
    
         public FTServer() throws BluetoothStateException {
         	
      	BCC.setPortName("COM2");  //setting the port number
        	BCC.setBaudRate(57600);//setting the baud rate
        	BCC.setConnectable(true);//connectable mode
            BCC.setDiscoverable(DiscoveryAgent.GIAC);               
         }	
         public int onConnect(HeaderSet request, HeaderSet reply) {
         	System.out.println("A OBEX connection has recieved .... ");
         	return ResponseCodes.OBEX_HTTP_OK;
         }
         public int onGet(Operation op) {
         	try{
         		//The server has recived a GET request for client.
    	     	System.out.println("Recived a GET request from client .....  ");
    	     	HeaderSet hdr = op.getReceivedHeaders(); 
    	     	
    	     	System.out.println("Server has recived a request for the file  "+(hdr.getHeader(HeaderSet.NAME)).toString());
    		InputConnection inpcon = (InputConnection)Connector.open("file://name="+(hdr.getHeader(HeaderSet.NAME)).toString()+";mode=r");
    		InputStream in     =  inpcon.openInputStream(); 
    		byte[] fileAsBytes     = new byte[97];
    		in.read(fileAsBytes);
    		System.out.println("File read fully into the port ....");
    		for(int i =0; i<fileAsBytes.length; i++)
    			System.out.print((char)fileAsBytes[i]);
    		DataOutputStream out = op.openDataOutputStream();
    		out.write(fileAsBytes, 0, fileAsBytes.length);
    		System.out.println("\n"+"File written back to client .... ");
    		op.close();
    		in.close();	     	
    	    }
    	catch(IOException e)    {
    		System.out.println(e.getMessage());
    	}
    	catch(ArrayIndexOutOfBoundsException e)    {
    		System.out.println(e.getMessage());
    	}
         	return ResponseCodes.OBEX_HTTP_OK;
         }
         public static void main(String args[]) throws IOException {
         	
         	FTServer server        	 = new FTServer();
         	LocalDevice  localDevice = LocalDevice.getLocalDevice();
       	SessionNotifier sn = (SessionNotifier)Connector.open("btgoep://localhost:1106;name=FTP");
       	System.out.println("Waiting for a client connection ..... ");
       	sn.acceptAndOpen(server);
     	System.out.println("A Client now connected .... ");
    
         }
    }
    Thanks for your answers.

    Benni

  6. #6
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: BLUETOOTH BCC ATINAV Download?

    My advice stands. These are not good examples. They are not well written, and they rely on libraries that you don't have. It is easy to find better example code. I strongly recommend you stop wasting your time trying to get these working, when there are much easier options.

    Graham.

  7. #7
    Regular Contributor
    Join Date
    Sep 2008
    Location
    Ahmedabad
    Posts
    254

    Re: BLUETOOTH BCC ATINAV Download?

    Hi,

    Graham is absolutely right, there are very good examples of JSR82 available which you can utilise according to your purpose. The Atinav API that you are trying to use is mainly for desktop and is built over JSR82 only. For mobile applications based on bluetooth there is no need for any third party library.

    I hope that you understand there is no need to use Atinav Library for Bluetooth based mobile applications.
    Sunil
    Mobile Application Developer

  8. #8
    Registered User
    Join Date
    Aug 2013
    Posts
    2

    Re: BLUETOOTH BCC ATINAV Download?

    please tell me...from where i can download atinav.bcc package????
    Last edited by Ayehsa Muqaddas; 2013-08-31 at 07:36.

  9. #9
    Registered User
    Join Date
    Aug 2013
    Posts
    2

    Re: BLUETOOTH BCC ATINAV Download?

    plzzzzz tell me...from where i can download com.atinav.bcc

Similar Threads

  1. Download Manager API - Unexpected Usage Issue
    By pbal in forum Symbian C++
    Replies: 5
    Last Post: 2012-01-23, 19:59
  2. Download manager hangs during file download on N95
    By ActiveRosh in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2009-10-13, 21:59
  3. Replies: 0
    Last Post: 2009-05-04, 08:46
  4. Download failed
    By agouraud in forum Digital Rights Management & Content Downloading
    Replies: 2
    Last Post: 2004-05-13, 05:11

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •