anchor.diff:  -compile([{parse_transform, lager_transform}]).
   -behaviour(gen_server).
   -behaviour(ls1mcs_protocol).
  --export([start_link/3, decode_tm/1, decode_photo_meta/1, merged_response_fragments/1, merged_response/1, merged_response/2]).
  +-export([
  +    start_link/3, decode_tm/1, decode_photo_meta/1,
  +    merged_response_fragments/1, merged_archive_fragments/1,
  +    merged_response/1, merged_response/2
  +]).
   -export([send/2, received/2]).
   -export([encode/2, decode/1]). % For tests.
   -export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
  
positive.code:     {ok, PhotoSize}.
  
  
  
  -spec merged_response_fragments(
          [{#ls1p_cmd_frame{}, [#ls1p_data_frame{}]}]
          ) ->
  
negative.code: %%  Extracts meta-info from the specified frame.
  %%
  fragment_metainfo(#ls1p_cmd_frame{addr = arduino, port = photo_data, data = Data}) ->
      <<BlkSz:8, From:16/little, Till:16/little>> = Data,
      {ok, BlkSz, From, Till};
  
  fragment_metainfo(#ls1p_cmd_frame{addr = arm, port = downlink, data = Data}) ->
      <<_BufId:8, BlkSz:8, From:16/little, Till:16/little>> = Data,
      {ok, BlkSz, From, Till}.
  
  
  
  %%
  %%
  %%
  -spec merged_archive_fragments(
          [{#ls1p_cmd_frame{}, [#ls1p_data_frame{}]}]
          ) ->
          {ok, [{From :: integer(), Till :: integer(), Data :: binary()}]}.
  
  merged_archive_fragments(CommandsWithData) ->
      BlockSets = [ merge_to_blocks(C, D) || {C, D} <- CommandsWithData ],
  
      % TODO: Implement overlay in a different way.
  
      MergedBlocks = lists:foldl(fun overlay_block_sets/2, [], BlockSets),
      {ok, MergedBlocks}.
  