SHARE
TWEET

Untitled

a guest Nov 11th, 2019 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  override fun onBluetoothMsgObjectReceived(p0: Any?) {}
  2.  
  3.     override fun setUUIDappIdentifier(): String {
  4.         return "e0917680-d427-11e4-8830"
  5.     }
  6.  
  7.     override fun onBluetoothStartDiscovery() {}
  8.  
  9.     override fun onServeurConnectionFail() {
  10.         Toast.makeText(applicationContext, "Server fail", Toast.LENGTH_LONG).show()
  11.     }
  12.  
  13.     override fun onBluetoothMsgStringReceived(p0: String?) {}
  14.  
  15.     override fun onBluetoothNotAviable() {
  16.         Toast.makeText(applicationContext, "Not available", Toast.LENGTH_LONG).show()
  17.     }
  18.  
  19.     override fun onClientConnectionSuccess() {
  20.         Toast.makeText(applicationContext, "Client success", Toast.LENGTH_LONG).show()
  21.     }
  22.  
  23.     override fun onServeurConnectionSuccess() {
  24.         Toast.makeText(applicationContext, "Server success", Toast.LENGTH_LONG).show()
  25.     }
  26.  
  27.     override fun myNbrClientMax(): Int {
  28.         return 7
  29.     }
  30.  
  31.     override fun onBluetoothMsgBytesReceived(p0: ByteArray?) {}
  32.  
  33.     override fun onBluetoothDeviceFound(p0: BluetoothDevice?) {
  34.         macAddress.append("${p0?.address}")
  35. //        createClient(macAddress.text.toString())
  36.     }
  37.  
  38.     override fun onClientConnectionFail() {}
  39.  
  40.     override fun onCreate(savedInstanceState: Bundle?) {
  41.         super.onCreate(savedInstanceState)
  42.         setContentView(R.layout.activity_bluetooth)
  43.  
  44.         server.setOnClickListener {
  45.             setTimeDiscoverable(BluetoothManager.BLUETOOTH_TIME_DICOVERY_3600_SEC)
  46.             selectServerMode()
  47.             scanAllBluetoothDevice()
  48.         }
  49.  
  50.         client.setOnClickListener {
  51.             setTimeDiscoverable(BluetoothManager.BLUETOOTH_TIME_DICOVERY_120_SEC)
  52.             selectClientMode()
  53. //            createClient(macAddress.text.toString())
  54.         }
  55.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top