package id.kalanusa.flutter_zsdk.bluetoothconnectionhandler;

import androidx.annotation.NonNull;

import com.zebra.sdk.comm.Connection;

import io.flutter.Log;

public class BluetoothConnectionHolder {
    static public Connection connection;

    public BluetoothConnectionHolder(@NonNull Connection connection) {
        this.connection = connection;
    }

    static public void updateConnection(@NonNull Connection connection) {
        BluetoothConnectionHolder.connection = connection;
    }

    static public void getSimpleConnectionName() {
        String simpleConnectionName = BluetoothConnectionHolder.connection.getSimpleConnectionName();
        String macAddressFromSimpleConnectionName = simpleConnectionName.substring(0, 17);


        Log.w("From Native (Android)", "SimpleConnectioName: " + BluetoothConnectionHolder.connection.getSimpleConnectionName());
        Log.w("From Native (Android)", "MacAddressFromSimpleConnectionName: " + macAddressFromSimpleConnectionName);
    }
}
