Closed MaverickFP closed 9 years ago
this is my complete code
System.out.println( "Connecting BLED112 Dongle..." ); BGAPITransport bgapi = BLED112.connectBLED112(); bgapi.addListener(new BGAPIPacketLogger()); BGAPI impl = new BGAPI(bgapi); impl.addListener(new TestSndRcv());
try { Thread.sleep(500); } catch (InterruptedException ex) { Logger.getLogger(TestSndRcv.class.getName()).log(Level.SEVERE, null, ex); } System.out.println( "Requesting Version Number..." );
String strng = "NewName"; byte[] dati = strng.getBytes()
impl.send_system_hello(); impl.send_gap_set_scan_parameters(10, 250, 1); impl.send_system_address_get();
impl.send_attributes_write(2, 0, dati);
impl.send_gap_set_privacy_flags(0, 0); impl.send_gap_set_adv_parameters(32, 48, 7); impl.send_gap_set_mode(2, 2); impl.send_gap_discover(1);
Change the device name is possible if, in the gatt.xml, the device name GATT characteristic is not defined with const="true".
Thanks for posting the solution, I had no idea :-)
Hi, i need to change the name of the device on the fly, is possible? This is my code but dont'work. The name doesnt'change.
String strng = "NewName"; byte[] dati = strng.getBytes(); impl.send_attributes_write(2, 0, dati);
The callback method give me a non-zero value --> error when the app settings the attribute.