BluetoothState.kt 999 Bytes
Newer Older
Zaihang's avatar
init  
Zaihang committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
package xyz.zhzh.flutter_bt_bluetooth

internal object BluetoothState {
    // Constants that indicate the current connection state
    const val STATE_NONE = 0 // we're doing nothing
    const val STATE_LISTEN = 1 // now listening for incoming connections
    const val STATE_CONNECTING = 2 // now initiating an outgoing connection
    const val STATE_CONNECTED = 3 // now connected to a remote device
    const val STATE_NULL = -1 // now service is null
    const val MESSAGE_STATE_CHANGE = 1
    const val MESSAGE_READ = 2
    const val MESSAGE_WRITE = 3
    const val MESSAGE_DEVICE_NAME = 4
    const val MESSAGE_TOAST = 5
    const val REQUEST_CONNECT_DEVICE = 384
    const val REQUEST_ENABLE_BT = 385
    const val DEVICE_NAME = "device_name"
    const val DEVICE_ADDRESS = "device_address"
    const val TOAST = "toast"
    const val DEVICE_ANDROID = true
    const val DEVICE_OTHER = false
    // Return Intent extra
    var EXTRA_DEVICE_ADDRESS = "device_address"
}