%%% -------------------------------------------------------
%%% @author huangyongxing@yeah.net
%%% @doc
%%% @end
%%% -------------------------------------------------------
-module(cli_pt_210).
-export([
        encode/2
        , decode/2
    ]).

%% 数据封包

%% 获取技能列表
encode(21002, []) ->
    {ok, <<>>};

encode(_Cmd, _Data) ->
    {error, unknown_data}.

%% 数据解包

%% 解包技能列表
decode(21002, Bin) ->
    FunReadSkill = fun(<<SkillId:32, Level:16, RestBinX/binary>>) -> {{SkillId, Level}, RestBinX} end,
    {SkillList, _RestBin} = pt:read_array(FunReadSkill, Bin),
    {ok, SkillList};

decode(_Cmd, _BinData) ->
    ignore.

