Android Question Set ble advertising data

giada

Member
Hi,
i need to set ble advertising data, in particular i need to set manufacturer data for 25 bytes:

19 ff ......

i tested ble2peripheral library but some bytes are fixed from the library,

how can i do ?
 

giada

Member
I've tried but i have an error, what's the problem? thanks

slc_error_image.png
 
Upvote 0

wes58

Active Member
Licensed User
Longtime User
Can someone help me please? It's the first time i try to change a library and i'm not expert...
You should post some code with what you are doing. Maybe then, someone can help you!
In the code that Erel posted (https://github.com/AnywhereSoftware...wheresoftware/b4a/objects/BlePeripheral2.java), there is a function already to set Manufacturer Data.
Java:
/**
     * Gets or sets the manufacturer specific data that will be advertised.
     *Each item in the map should have a positive int number as the key and an array of bytes as the value.
     */
    public void setManufacturerData(Map Map) {
        manufacturerData.setObject(Map.getObject());
    }
    public Map getManufacturerData() {
        return manufacturerData;
    }
So what happens when you declare something like this:
Private peripheral As BlePeripheral2
and then use
peripheral.ManufacturerData =
with the Map of your manufacturer data.
I haven't used this library so can't help you anymore. Have a look there https://www.b4x.com/android/forum/threads/ble-peripheral-as-ibeacon.105601/#post-661465,
or do a search for "ManufacturerData.
 
Upvote 0
Top