4 Flipper Zero
vanous edited this page 3 months ago

Flipper Zero

A Multi-tool Device for Geeks

Support in Gadgetbridge

It's main purpose currently is to provide an Intent-based API to Tasker and similar apps to play sub-GHz files.

In the future, file management and other features might be useful.

Using Intent based API to play a file

Check if Flipper Zero is connected:

     adb shell am broadcast \
    -a "nodomain.freeyourgadget.gadgetbridge.BLUETOOTH_CONNECT" \
    -e "EXTRA_DEVICE_ADDRESS" "xx:xx:xx:xx:xx"

Gadgetbridge then checks if the device is already connected. If it isn't, it tries to establish a connection. Whenever the device is initialized, Gb responds with the intent nodomain.freeyourgadget.gadgetbridge.BLUETOOTH_CONNECTED, and by reading the extra EXTRA_DEVICE_ADDRESS I can determine whether it's the Flipper that recently connected.

If so, I send the following Intent to play the file:

	adb shell am broadcast \
	-a "nodomain.freeyourgadget.gadgetbridge.flipper.zero.PLAY_FILE" \
	-e "EXTRA_FILE_PATH" "/ext/subghz/Vehicles/Tesla/charge_650_long.sub" \
	-e "EXTRA_DURATION" "5000"

Optional parameters

Optionally, you can specify EXTRA_APP_NAMEwithinfrared, NFCor any other app. In case ofinfrared, you also need to add EXTRA_BUTTON_NAME` with the value of a button of a remote.

I then listen for the Intent nodomain.freeyourgadget.gadgetbridge.flipper.zero.PLAY_DONE from Gb to react to the file play finishing.