     Port.command(port, data)
     |> reply(state)
   end
+  def handle_call({:attach, ble}, _from, state) do
+    new_state = %__MODULE__{state | ble: ble}
+    reply(:ok, new_state)
+  end
+
 
   defp reply(ret_value, state) do
     {:reply, ret_value, state}

    GenServer.call(__MODULE__, {:cmd, cmd})
  end

  defstruct [port: nil, verbose: true, recording: true, log: nil]

  def init([]) do
    path = System.find_executable("bluetoothctl")

  """
  use GenServer
  require Bluetooth.Ctl.Macros
  require Logger
  alias Bluetooth.Ctl.Macros
  alias Bluetooth.GenBle

  def start_link(:power_on) do
    start_link()
    power :on
  end
  def start_link() do
    GenServer.start_link(__MODULE__, [], [name: __MODULE__])
  end
