function [] = TestCanCallback(rxCh)

CONVERTER_ID = 2;

disp('Can msg recieved');

rxMsg = receive(rxCh, Inf);

for Msg = rxMsg  %Loop through all messaged returned from "recieve".
  [srcID dataID seq_num] = DecodeCanID(Msg);

   if(srcID == CONVERTER_ID)  %Data is from power converter controller
   switch dataID
    case {1, 2}  % 4 16 bit integers
      i(1) = unpack(Msg, 0, 16, 'LittleEndian', 'uint16');
      i(2) = unpack(Msg, 16, 16, 'LittleEndian', 'uint16');  
      i(3) = unpack(Msg, 32, 16, 'LittleEndian', 'uint16');
      i(4) = unpack(Msg, 48, 16, 'LittleEndian', 'uint16'); 
      disp([num2str(srcID) '  ' num2str(dataID) '   ' num2str(seq_num) '     ' num2str(i(1)) '  ' num2str(i(2)) '  ' num2str(i(3)) '  ' num2str(i(4))]);
    case  {0,3,4,5,6}  %2 32 bit floats
      f(1) = unpack(Msg, 0, 32, 'LittleEndian', 'single');
      f(2) = unpack(Msg, 32, 32, 'LittleEndian', 'single'); 
      disp([num2str(srcID) '  ' num2str(dataID) '   ' num2str(seq_num) '     ' num2str(f(1)) '   ' num2str(f(2))]);
    otherwise
        warning(['Unknown dataID:  ' num2str(dataID)]);
   end
  end  
end
        
    
    
    
    
end
    


