close all
clear all

db = canDatabase("UW_Harbor_External_CAN_v1.0.dbc");

N = length(db.Messages);

SRC_ID = NaN(1,N);
CMD_ID = NaN(1,N);
SEQ_NUM = NaN(1,N);


for i = 1:N

  [SRC_ID(i) CMD_ID(i) SEQ_NUM(i)] = DecodeCanID(db.MessageInfo(i).ID);

end


for i = 1:N

  %  disp([db.Messages{i} ' CANID = '  num2str(db.MessageInfo(i).ID) '    SRC_ID = ' num2str(SRC_ID(i))]);
fprintf("%23s   CANID = 0x%5x   SRC_ID = %1d   CMD_ID = %2d  SEQ_NUM = %1d\n",db.Messages{i},db.MessageInfo(i).ID,SRC_ID(i),CMD_ID(i),SEQ_NUM(i));
end