Example #1
0
    public void Initialize()
    {
        EventDispatcher.Bind(BluetoothConnector.eBT_CONNECTED, BTConnected);
        EventDispatcher.Bind(BluetoothConnector.eBT_CONNECTION_ERROR, BTConnectionError);
        EventDispatcher.Bind(BluetoothConnector.eBT_CONNECTION_STATUS, BTConnectionStatus);
        EventDispatcher.Bind(BluetoothConnector.eBT_DISCONNECTED, BTDisonnected);
        EventDispatcher.Bind(BluetoothConnector.eBT_DATA_RECIVED, BTDataRecived);


        BluetoothAdapter.askEnableBluetooth();

        if (BluetoothAdapter.isBluetoothEnabled())
        {
            checkConnection();
        }
    }