| Reply | « Previous Thread | Next Thread » |
|
Hi all,
I have a problem with attribute in bluetooth, here is my code: try { device = LocalDevice.getLocalDevice(); device.setDiscoverable(DiscoveryAgent.GIAC); String url2 = "btspp://localhost:" + uuid2.toString() +";authorize=true;authenticate=false;encrypt=false" + ";name=" + appName; server = (StreamConnectionNotifier) Connector.open(url2); ServiceRecord rec = device.getRecord(server); DataElement elm = null; elm = new DataElement(DataElement.STRING,"BT Server"); if(rec.setAttributeValue(0x101,elm)) log("101 added"); /* Set service provider name */ elm = new DataElement( DataElement.STRING,"CINI, Research Group"); if(rec.setAttributeValue(0x102,elm)) log("102 added"); // rec.setDeviceServiceClasses(SERVICE_TELEPHONY); device.updateRecord(rec); c = server.acceptAndOpen(); } Server should add these attributes: 258,257,256,4,1 Client: DataElement dataelem = null; String name = null; for ( int i=0; i< records.length; i ++ ) { ServiceRecord record = records[i]; int IDs2[] = record.getAttributeIDs(); for (int j=0;j<IDs2.length;j++){ DataElement prova = record.getAttributeValue(IDs2[j]); System.out.println(IDs2[j]+" "+prova.getDataType()); if(prova.getDataType()==DataElement.STRING) System.out.println(prova.getValue().toString()); } services.addElement( record ); } } Client retrieves only these attribute: 0,1,4 where is the problem? My code has been copied from other working code. I use nokia 9500 but also nokia 6680 and it does not work the same. please help me :-( Paolo |
|
Ok I have the solution.
Thanks everybody ![]() |
|
Hello.
Could you please talk about the solution? I have the same problem, but only when I build with NetBeans 5.0 (building with WTK attributes are correctly published). Thanks. |
| edazcnokia |
| View Public Profile |
| Find all posts by edazcnokia |
|
If you are using BluecoveXP the Service Record will not support extra attributes.
Only UUID = {0x0000,0x0001,0x0004,0x0100); You can recompile BlueCove to add attributes,which works,but obviously its unique, and not dynamic and non standard. The Mobility toolkit will support more but obviously this does not connect with the real world! as its an emulator. I have not use NB 5.1 and Netbeans 5.1 mobility, but NB 5.0 beta did NOT work, so updgrading to 5.1 and Netbeans 5.1 Mobility might be the answer. It works in Nb 4.1 Jim
Last edited by jimgilmour1 : 2006-05-21 at 12:29.
|
| jimgilmour1 |
| View Public Profile |
| Find all posts by jimgilmour1 |
|
Thanx Jim.
My problem with custom service attributes in midlets was that I was not fetching them at service discovery. I solved it simply adding my custom attribute numbers in the array passed to DiscoveryAgent.searchServices function as first parameter. It was not a problem of NetBeans :$ About Bluecove, I could see that UpdateRecord function is not available with this library, so it does not allow for custom service attributes. I'll try to achieve this using Avetana with Bluez in a Linux Server instead. Edazc |
| edazcnokia |
| View Public Profile |
| Find all posts by edazcnokia |
|
Quote:
Quote:
for bluetooth.Jim |
| jimgilmour1 |
| View Public Profile |
| Find all posts by jimgilmour1 |
|
hi all,
i'm making HID service Record & having a problem in setDeviceServiceClasses(int ) function it throw an exception {java.lang.IllegalArgumentException attempt to set incorrect bits}' when it takes 0x1124 as parameter & i don't know wht to do... so plz if anyone knows the solution plz tell me thnx alot ![]() |
| samooha_2020 |
| View Public Profile |
| Find all posts by samooha_2020 |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Nokia SDK Bluetooth service re-discovery problem, Help Me!:( | tomsonxu | Mobile Java Networking & Messaging & Security | 0 | 2005-11-08 08:44 |
| Nokia SDK Bluetooth service re-discovery problem, Help Me!:( | tomsonxu | Mobile Java Tools & SDKs | 0 | 2005-11-08 08:39 |
| Bluetooth Problem | israel.martinez | Mobile Java Networking & Messaging & Security | 0 | 2005-10-28 19:39 |
| Problem with the Nokia 6600, Bluetooth and Monty Thread | tenfourty | Mobile Java General | 15 | 2005-09-30 15:15 |
| Bluetooth problem in Symbian C++ code | vardhman | Bluetooth Technology | 0 | 2005-01-02 09:17 |