| Reply | « Previous Thread | Next Thread » |
|
Hi
I'm a student from switzerland, working for a bluetooth project. The goal is to code a PC server which can handle several Mobile Phone clients. Send them some questions, receive their answers. Security is not needed. I chose the example from benhuis website, but I have a problem with bluecove creating a server, that is able to be found by the mobile phone and establish connection. When I use the example of benhui's website, mobile is server, pc is client -> no problem. But PC server, Mobile client (what i actually need..) -> finds rarely the server, if pc is found the connection cannot establish correctly. There is no error or log I can show you, the server simply is "waiting for connection..." while the phone tries to connect. My J2ME experiences are pretty poor, I read some articles and examples though. I lost so much time yet... Would really be a great thing to get started. Are there any working examples, using a PC and bluecove as a server or does somebody know what's wrong with benhui's example? Any different approache ideas? Different libraries? linux using bluez perhaps easier? Java COMM API would not be a possible solution? Greetings from switzerland and a lot of thanks Lukas ( http://www.benhui.net/modules.php?na...ne_Part_1.html ) |
|
Did you turn discovery on on the PC?
![]() |
|
yes discovery is turned on
|
|
To run BlueCove you need WinXP Service Pack 2 with a XP compatable blue tooth adapter which is Bluetooth version 1.0 with Cambridge Radio Ltd or Belkin 1.0 , difficult to find now all BT 2.0
Next you need the de.avetana obex package zip package source code and the package MicroEmulator * Copyright (C) 2001 Bartek Teodorczyk <barteo@it.pl> under GNU. Some Google-ing on these name will find the packages. Under Netbeans 4.1 IDE build the BlueCove library project which is basis of BT under J2SE the "dist" directory contains the library BlueCove.jar this is added to the de.avetana project libraries now built as library de.avetana.jar /* These lines are changes needed to use OBEXThe higlighted code is the client code. This is code copied from the Mobile project using Netbeans 4.1 and it runs on my Nokia 6230i UUID[] uuidSet = {new UUID("1106", true)}; OBEXFile transfer /* the Server and client service attributes */ public static int[] attribSet = {0x0100, 0x0001, 0x0002, 0x0003, 0x0004}; To pick up multiple phones. cs.connect(hs); client.updateStatus("OBEX session created"); public newConn extends Thread{ public void run(){ }} every time a new connection is found call newConn().start; for a new connection an now you have a multi connection server |
| jimgilmour1 |
| View Public Profile |
| Find all posts by jimgilmour1 |
|
Hi, are you still there?
I've got the same problem than Jossnaz, but I can't include the "avetana" software in my proyect because it's under license. Does anyone know another solution without this package. Is that one of the limitations of bluecove or it's my application? It seems that there are a lot of people with the same problem and no much solutions.. Thanks in advance. Francisco |
|
Jossnaz I'm a student from Pakistan, working on a similar kind of project which you are.
My project differs in the sense that my client does not need to receive anything from the server but it just needs to send some data. And I also want to connect multiple cell phone clients to the server. I'm using Ubuntu linux for development and using Avetana as the library. Its very difficult here to get a windows compatible bluetooth adapter. I have written a server & client code where the server receives the key pressed by the client on the cellphone & displays it. email me at onlytabish@hotmail.com if you are interested in the code. I'm specifically interested in knowing who is supporting you for the project and have you thought of how you would handle the situation of connecting more than 7 clients because you cannot connect more then 7 clients to a bluetooth server. |
|
Quote:
See this site for example of commercial use of software licence http://www.j2mepolish.org/licenses.html#commercial This open source project may help http://sourceforge.net/projects/openobex may solve your problem but is for non-commercial use. Although Bluecove was written by the INTEL Corp among others it may have similar conditions of non-commerical use. The simple answer is that you request permission for use and give a clear citiations and cross reference in appendix of your project. If you are writing for a Master or Doctorate I dont expect the examiners will allow the use of the code as the project is supposed to be unique. Consider making your own protocol but using the same binary code ie. 0x1106 on the service using btspp: and write your own callback code. This unversity did http://www.caside.lancs.ac.uk/java_bt.php finally try a spot of google "obex source code (j2se)" the DOCJAR website give loads of free code to think about. Jim
Last edited by jimgilmour1 : 2006-08-24 at 13:19.
|
| jimgilmour1 |
| View Public Profile |
| Find all posts by jimgilmour1 |
|
Thanks for such amount of information, now i'll try to digest it...
I'm a bit lost with bluecove. Do you why my mobile phone can't discover my pc as a bluetooth device? Avetana is going to help me out?(I wish...) I've tried with j2se 1.4 and 1.5 (I can't remember where I read it was needed the 1.4 version), with the bluecove20050514.jar, with the patched version from Benhui and with my own compiled version (1.4 and 1.5). Now I don't know what to try. (oh, I forgot it: my bluettoth device is 2.0..., Do I still have any opportunity?) There is something extrange: with the differents bluecove version (original and Benhui's one) my pc gets 2 different addresses. I've seen that the original doesn't implement method "setDiscoverable()" (it just return false). Can it work anywhere? I'll try with avetana and all you mentioned, Jim. |
|
Quote:
http://support.microsoft.com/default.aspx?kbid=841803 My belkin version 2.0 worked as a Version 1.0 device when I hacked bt.inf list if devices see my hack bt.inf thread http://discussion.forum.nokia.com/fo...ight=Bluetooth Jim
Last edited by jimgilmour1 : 2006-08-25 at 11:50.
|
| jimgilmour1 |
| View Public Profile |
| Find all posts by jimgilmour1 |
|
Thanks again.
I feel ashamed: the problem was (at first, now I've got new ones) that I had forgotten to turn discovery on on the pc , I thought that with the function "setDiscoverable()" was enough; then I realized that it was not implemented...Now, I can discover my pc as a device, but I can't discover any services on it. It only discovers a L2CAP service, searching for uuid=0x0100; even when I opened a BTSPP url on the server (pc). I suppose it's the underlying protocol what it discovers... It doesn't find the serviceClassUUID that I use or the btspp identifier (0x0003). I would use L2CAP instead, but bluecove doesn't implement the interfaces (L2CAPConnection, etc.) I can send data to the pc because I know the bluetooth address and the BTSPP service starts always with channel 1 ("btspp:\\myAdress:1"); but I need the service discovery. Maybe it's due to the driver. I will try to hack the driver as you mentioned. I hope it works. If it does not work, I'll try with another bluetooth-USB adapter. |
|
[quote=FVelasco]Thanks again.
Now, I can discover my pc as a device, but I can't discover any services on it. It only discovers a L2CAP service, searching for uuid=0x0100; even when I opened a BTSPP url on the server (pc). I suppose it's the underlying protocol what it discovers... It doesn't find the serviceClassUUID that I use or the btspp identifier (0x0003). I would use L2CAP instead, but bluecove doesn't implement the interfaces (L2CAPConnection, etc.) /QUOTE] Your server is supposed to use service registration of UUID attr[] = new UUID{0x0001,0x0002,0x0003,0x0100} which will allow you to discover all services i expect you use just {0x0003,0x0100} Jim |
| jimgilmour1 |
| View Public Profile |
| Find all posts by jimgilmour1 |
|
Hi, Jim
Sorry, but don't understand what you propose... "Your server is supposed to use service registration of UUID attr[] = new UUID{0x0001,0x0002,0x0003,0x0100}" Where can I do this? in the server... but, setting attributes via record.setAttributeValue()? I might be wrong: I thought that when I do: ------------------------ UUID myServiceUuid=new UUID("1234", true); String myServerUrl="btspp://localhost:"+myServiceUuid+";name=myServiceName"; notifier= (StreamConnectionNotifier) Connector.open(myServerUrl); ------------------------ then the serviceRecord must register myServiceUuid as an Uuid reachable in a service discovery, am I wrong? I've tried too: ------------------------ DataElement data=new DataElement(DataElement.UUID,myServiceUuid); record.setAttributeValue(0x0003,dato); ------------------------ , but it doesn't work. My client is: ------------------------ uuidList=new UUID[1]; uuidList[0]=myServiceUuid; (...) trans =agent.searchServices(null, uuidList, arrayDisp[i], this); ------------------------ I think it's time for me to study a bit more the JSR82 specification... In the other hand, trying to hack the driver, I can't find other Pnp ID for my USB dongle than the one wich corresponds to Generic Bluetooth Radio (USB\Vid_0a12&Pid_0001), even when I use the drivers that the adapter carried. |
|
Try this code the second param is a DataElement which you build up with the attibutes.
This code may help PHP Code:
PHP Code:
Jim |
| jimgilmour1 |
| View Public Profile |
| Find all posts by jimgilmour1 |
|
Hi again.
Well, I've finally resolved my problem. I mean, maybe there were no problem at all. I think it's my phone(motorola v360), it couldn't discover a SPP service in my pc. I've tried with another one (Nokia 6103) and it works fine! With the code I had at the beginning! But there is something extrange: - v360 can find a L2CAP service in my pc (but it's not a service I've made, over bluecove, it's a Personal Area Network I don't recognize). - v360 can find SPP services in 6103 (so v360 can find SPP services...) - 6103 can find a SPP service in my pc over bluecove (so bluecove can set services discoverables...). But: - v360 cannot find the SPP service over bluetooth. If I get to know what's happening I'll tell you. Bye |
|
Hi,
Quote:
Quote:
You need to set authorization off on the Motorola , but I dont have a clue how !. See the motorola development kit FAQ,and cry!. The only was to connect is using signed applications. Same with java. The only phone with worse support is samsung E720. All use of bluetooth is for Samsung only!. Quote:
Jim |
| jimgilmour1 |
| View Public Profile |
| Find all posts by jimgilmour1 |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Problems with socket connection between client and server | Al_KaRaJo | Mobile Java Networking & Messaging & Security | 4 | 2006-11-15 19:28 |
| J2ME, Bluetooth, Using your Phone as a Gateway??? | zinomorph | Bluetooth Technology | 2 | 2005-08-26 14:02 |
| problems with bluetooth file transfer to 6230? - here's the solution! | spyghost | Bluetooth Technology | 1 | 2005-01-04 18:16 |
| Nokia Activ Server 2.1 - problems | choumanb | WAP Servers | 0 | 2003-05-16 08:34 |
| 7650 Bluetooth Modem with Toshiba Tecra 9000 Windows XP - RESOLVED Now! | d0lph1n | Bluetooth Technology | 5 | 2003-02-07 12:25 |