• Sounds great! I had a little try last night with something that'd grab a URL, pull data out of it and broadcast it. The BLE code you need is:

            BluetoothManager mBluetoothManager = (BluetoothManager)mContext.getSystemService(Context.BLUETOOTH_SERVICE);
            BluetoothAdapter mBluetoothAdapter = mBluetoothManager.getAdapter();
            BluetoothLeAdvertiser mBluetoothLeAdvertiser = mBluetoothAdapter.getBluetoothLeAdvertiser();
    
            AdvertiseSettings.Builder settingsBuilder = new AdvertiseSettings.Builder();
            settingsBuilder.setAdvertiseMode(AdvertiseSettings.ADVERTISE_MODE_BALANCED); // was ADVERTISE_MODE_LOW_POWER
            settingsBuilder.setTimeout(0); // always!
            //setTxPowerLevel(ADVERTISE_TX_POWER_HIGH.)
            AdvertiseSettings settings = settingsBuilder.build();
    
            AdvertiseData.Builder dataBuilder = new AdvertiseData.Builder();
            dataBuilder.addManufacturerData(0x0590, foundData.getBytes());
            //dataBuilder.setIncludeDeviceName(true);
            AdvertiseData data = dataBuilder.build();
    
            mAdvertiseCallback = new SampleAdvertiseCallback();
    
            mBluetoothLeAdvertiser.stopAdvertising(mAdvertiseCallback);
            mBluetoothLeAdvertiser.startAdvertising(settings, data,
                    mAdvertiseCallback);
    
About

Avatar for Gordon @Gordon started