fix capabilities parser bug

formerly all the capabilities parsed are the same;
also add some comments about packet structure