Skip to content

Firmware: Android #7

@kolsha

Description

@kolsha

Hey
I wonder, is it possible to create firmsoftware on android, to make it behave like AirTag.

At the moment I'm trying to experiment with android.bluetooth.le.BluetoothLeAdvertiser, but not sure that if it's right direction and it's capable of doing so.

Here is my snippet, any comments, guidances, ideas would be helpful.
Thanks!

// manufacturerData is similar to 
// https://github.com/positive-security/find-you/blob/ab7a3a9eaa4559d34fcdf37142729bef3ae38a36/Firmware/Microbit_v1/offline-finding/main.c#L32

        val settings = AdvertiseSettings.Builder()
            .setAdvertiseMode(AdvertiseSettings.ADVERTISE_MODE_LOW_LATENCY)
            .setConnectable(false)
            .setTxPowerLevel(AdvertiseSettings.ADVERTISE_TX_POWER_HIGH)
            .build()

        val manufacturerData = createManufacturerData()
        val data: AdvertiseData = AdvertiseData.Builder()
            .setIncludeDeviceName(false)
            .addManufacturerData(0x004C, manufacturerData)
            .build()

        try {
            bluetoothLeAdvertiser?.startAdvertising(settings, data, advertiseCallback)
        } catch (e: Throwable) {
            Log.e(TAG, "SecurityException: ${e.message}")
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions