anchor.diff:  
   get_devices() ->
     CMD = "tdtool --list-devices | awk 'BEGIN {FS=\" |=|\\t\"} NR == 1 {printf(\"[ \")} NR > 1 {printf(\"\\n ,\")}{printf(\" {device, %s, \\\"%s\\\"}\", $4,$6)} END {printf(\" ].\\n\")}'",
  -  %io:format("~s~n", [CMD]).
  +  lager:info("devices found: " ++ CMD),
     os:cmd(CMD).
   
   %% vim: tabstop=2 shiftwidth=2 expandtab
  
positive.code: -export([terminate/2]).
  -export([code_change/3]).
  
  -export([parse_devices/0]).
  
  -record(state, {devices}).
  
  %% API.
  
negative.code: start_link() ->
    gen_server:start_link(?MODULE, [], []).
  
  -spec list_devices(pid()) -> [_].
  list_devices(Pid) ->
    gen_server:call(Pid, list_devices).
  
  %% gen_server.
  
  init([]) ->
    {ok, #state{}, 0}.
  
  handle_call(list_devices, _From, S=#state{devices=Devs}) ->
    {reply, Devs, S};
  handle_call(_Request, _From, State) ->
    {reply, ignored, State}.
  
  handle_cast(_Msg, State) ->
    {noreply, State}.
  
  handle_info(timeout, #state{devices=undefined}) ->
    NewState = #state{devices=parse_devices()},
    {noreply, NewState};
  handle_info(_Info, State) ->
    {noreply, State}.
  
  