Configuration

To configure the SDK properly for both transfer target and source, WPTConfig instance is needed.

Configuration must be the same on both sides of the transfer otherwise the Bluetooth connection won’t be successful.

The same configuration also needs to be implemented on iOS.

Configuration items

  • serviceUUID - UUID used for the Bluetooth service
  • coder - will provide encryption and decryption for the transfer

Coder

Currently, only one coder is available via WPTCoder.aes. To configure this coder, you need to provide two byte arrays:

  • salt - salt that will be mixed into the cipher. No length limitation.
  • iv - IV for the cipher. Needs to be 16 bytes long. Smaller IV will produce an error and longer will be truncated.

Example configuration

val config = WPTConfig(
    ParcelUuid.fromString("21f8190c-e4bc-11ed-b5ea-0242ac120001"), 
    WPTCoder.aes(
        "MyApplicationDemoSalt!".toByteArray(), // static data
        "7x9ZEvEVf4IqlBxuYmzKhw==".decodeBase64()!!.toByteArray() // 16 bytes encoded in Base64
    )
)
Last updated on Feb 01, 2024 (13:48) Edit on Github Send Feedback
Search

1.0.0

Proximity Transfer for Android