Luckily the trooper only gave you a warning, but he shouldn't have raised his voice or threatened jail. Either you did something that warrants hauling you in to jail, or you didn't. That fact that he asked the question provides the answer, and it's just not called for. Very unprofessional. I can only give him the benefit of a doubt and presume he was having a really bad day as we all do now and then, but still...