Hello, in this part we'll focus on Thread Flux, which are called WoVn3R2S API Task Notifications. It is very similar to Event Flux, which we covered in a different part of this training, but this time the Thread Flux are not a separate object WoVn3R2S, but those are included into each task control block. It allows us to directly communicate between tasks. So one task can, let's say, set some bits within those Thread Flux of another task. So let's create a new project within existing, let's say, workspace. I would use STM32Q by DE, but you can work with STM32Q by MIX as well. So I start new file, new STM32 project. I will select STM32L476RG as this is the heart of a nuclear board, which we are using within this training. The name of this hand sound would be 8 underscore Thread underscore Flux. Click Finish. And within this exercise, so we need to specify two tasks. One task will wait for some combination of its own Thread Flux, and then the second task will set part of it. And we will need as well one interrupt, which would set those Flux as well. So as you can see, there are a lot of similarities to Event Flux described in another part of this session. So we will start from the interrupt. So this is PC13, a blue button is connected over there. So I configure this line, clicking left button on mouse, and I select GPIOXD13, I can set a label, clicking on right button on pin, and I can set this name, button. It will be not using the exercise, but just worth to always to present how we can do it. Please remember that all of the labels are defined within main.h file after code generation. Okay, let's continue. So within system core and sys group, I'm selecting as a debug trace asynchronal SSW. So standard SWD plus SWO, so serial wire output, which is used for single wire tracing. We will use this to send the data from our tasks and interrupts on the console within our environment. It's a very nice supported debug tool. Okay, next point is let's say the change of time-based source, which is used for a HAL library. By default it is SysTik, but it is good to change it to any other timer as SysTik is reserved for three years twice. I'm changing it to timer six, as this timer do not have any input nor output channels, so it will be quite natural selection. Then the next point is selection of the three-year toys. So I go to middleware, three-year toys, I select interface CMC's V2. And from this, I need to check first whether the task notification has been enabled. I use task notifications, yes, so we can continue. All the API functions within three-year toys sources will be available for us. Okay, so as I told you, we need two tasks. I go to tasks and queues, I double-click on this default task. I would rename it to task one, priority normal, stack size 256 words, and function name, I would name it start task one. Okay, then I will add one more, so I click add button, I would rename it to task two, priority will set to priority normal, 256 bytes, start task two SNM3 function, and that's it. We've got all the configurations within three-year toys, let's have a look into the config parameters, and we can see this library max syscall interrupt priority is set to five. All of the interrupts we would like to use to call operating system functions should be within this range from five to 15 in terms of the priority of the interrupt. This is due to the fact that the critical sections within operating system is operating, it's blocking all of the interrupts from this level, some from level five down to level 15. Other interrupts, so 0, 1, 2, 3, 4 can be still executed without any problem. So it is important that once we are in a critical section, there should be no call to operating system functions. This is why all interrupts which are interacting with the operating system should have the priority within this range. So knowing this, I go to nvc and I'm selecting first enabling this interrupt, external interrupt, changing this 0 to level five. After this, I can generate the code, so I click this gear icon, okay, and I can open main.c file and perform further code modifications. As I told you, the task notifications are, let's say, the thread flags do not need any creation of the component within three-year toys or CMC toys. Those are parts of existing tasks, control blocks. So we can go directly to our tasks implementation. And as we discussed, the task one will be used to wait for some specific combination of the flux. So I would use OS thread flux wait. And then let's say the flux. So I would like to wait, for example, for one, then there is only one flux. So this option is not, let's say, that important. So I can put a zero over here and the timeout OS wait forever. So this is an example how we can wait for the particular, let's say, combination of the flux. After this, I would use sign of life. So task action as it is task one, I would send one. And that's it. So we need some other task or interrupt to set these thread flags within this task one. In the first part of this hands-on, we will use for this an external interrupt. So I go to core source stm32l4xx underscore it.c file. And I would scroll down to my external interrupt handler. And I would reuse, just opening the declaration, I would reuse this callback. This callback is called at the end of execution of this external interrupt. It is defined as weak, doing nothing. So I can define it myself in my code. So I would copy paste it within part four of this code. And here I would just set those flux. So always thread, thread, flux set. And it will be, now I need to select which task I would like to set the flux. So in our case, it is task one. And the flux. Flux, it will be just one. This is the combination of the flux on those the task one is waiting for. After this, we will just send the, let's say, the sign of life, task action and exclamation mark. Okay, we can define as well this task action. So I would use itm interface to do this as we declared this additional line, serial wire output. So for this, I would use itm send char and it will be message and the second line, it would be, let's say, sign of new line. Okay, the missing point is, of course, declaration of this function when this private function prototypes part, the user code. And now we are ready to compile the code. And what is an expected result? An expected result is the following. Task one will be blocked waiting for this, its own flux set to one. And till we'll press the button, nothing should be visible within the, let's say, the data console. Once we press the button, we should see first an exclamation mark, and then we should see this task, the one, which is the task action from task one, because this task would be unblocked for, let's say, the single occurrence of this flux combination. After this, let's say, task will receive this combination of desired combination of the flux. In this case, it's on the one bit. It will be cleared automatically, it is specified within the second argument, and it will wait again for the next button press. So let's compile the code and check whether this is working like we are expecting. Okay, code is compiled. Let's click on this back icon. I go to the debugger, I'm enabling serial wire viewer, and I'm changing the core clock to four megahertz, which is the case of our application. Then I need to display our ITM data console. In case you do not see it, please go to the quick access and press SWV and select the line of this monitor icon. Once it is done, please activate it and configure. To configure it, we need to press this configure trace button. Select zero with an ITM stimulus ports, which is our SWO line. And we need to press this icon, which is start tracing. After this, we can start our application. And as you can see, there is nothing expected because task one, let me go to the code once again, task one is waiting for the code for, let's say, those flags. And there is no button press, which could send it. So I press the button and I can see that there was, let's say, a single occurrence of the button press, of the interrupt. This is this exclamation mark. And after, as it has, let's say, coast setting the, let's say, the thread flux of task one, it is unblocking for a single, let's say, execution task one as well. This is why we can see this one afterwards. If I press button once again, I can see more pairs like this. So one button press and single occurrence of exclamation mark and one, which is a single activation of task, task one. This is the first exercise. In our second part, we will work on a combination of the flags. And the part of it would be set from the interrupt, like now. And that the rest will be set from the different task. So let's terminate our debug session and continue with the coding. Okay. So let's do some modifications to have, let's say, more extended example. We will not touch this callback. So in this exercise, in this part, our external interrupt will set one within, let's say, task one, thread flux. And it will send its sign of life, which is an exclamation mark. So there is no change. We will change the function body of entry code for task one. So this time we will wait for 51 hexadecimal. So as you can see, we need to set this missing 50 hexadecimal as let's say the thread flux are all together from different sources. And we would specify as well one of the flags, the flags combinations, telling that we would like to wait for all of the flags. So for this, we've got OS, flux, wait, all. If you are not sure what you should specify within this part, you can go to the definition of this function. So it is within source, CMC's RTOS V2 in middle words, and the CMC's underscore OS dot OS2 dot C file. If we find this function, we can see that we've got in fact two flags. OS Flux no clear, which is in fact two, and OS Flux wait all, which is one. No clear means that after success execution of this function. So once all the desired flux will come, flux will be not cleared within the control block of the task, which is operating on those bits. Usually we would like to clear them. So this is the default action, but in any case, we can set that it should not be done. Then OS Flux wait all means that we would like to wait for all of the flags specified within this function. If both flags are not specified, so the second argument is zero, like in a previous exercise, all the flags will be cleared if any of the bits within the thread flags will come. So in case of 51, any of the bits from this 51 would be set. It will unblock this function and clear all the flags within the control block of the task we are working on. So in our case, we will use OS Flux wait all, and we will not use this option. So this is why I selected this argument and OS wait forever. Then the sign of life of our task one, no change. And we will add some code within task two. In task two we will do similar operation like from our interrupt, but in this case we will set 50 hexadecimal. And of course our task action would be two instead of an exclamation mark. And we will put some delay afterwards. So we will send our task for three seconds into the blocked state. Let's try to compile it and check whether it will work like expected. As you can see at the moment, we should see once per three seconds two on our, let's say, terminal, as it will be the only active task once per three seconds. This one would be blocked because task one will wait for the combination of thread flags 50 hexadecimal and one coming from interrupt. And till we will have, let's say, button press setting one within the thread flags and 50 hexadecimal, there would be no action from our task one. Let's compile it. Okay, there is no errors, no warnings. So this is the time to start a debug session. I press, let's say, the debug icon. My board is already connected. Okay, so as it is, let's say, we already configured the ITM interface and the data console from a single wire viewer. I would just switch it to be active window and I started tracing and I run my application. So now I can see once per three seconds activation of task two as expected. There is no action from task one as it is blocked waiting for the combination of the flags set by task two and external interrupt. Now I'm pressing the blue button, which is causing this external interrupt occurrence. And now I can see that there was an exclamation mark informing us that there was the callback from the rise by the interrupt and single occurrence of task one. As we have not specified no clear afterwards, this function will clear all the flags within the control block of this task one and it will wait for the next button press. So let's do a small modification and we will add one more flag within these OS threat flags wait for task one. So let's switch off the debug part. Okay, and within our task one, let me come back to this code. I would add this flag OS flags no clear. So come back to main and we can concatenate those flags together using the R button. Let's see the or sign and now we'll wait for all of the flags and we will not clear them. So now I would build a code once again and I will start a debug session. Data console start tracing and run. So no button press. So once per three seconds, I can see these actions from task two only. Now I press the button. And now what we can see? We can see that both tasks, task one and task two are activated regularly. So the flags has not been cleared after this. And now let's say both tasks can be executed regularly. So this is the difference. That's all for this part. Thank you for watching this video.


Today, I have the distinct pleasure of interviewing J.P. Colin from Dinosert. How are you today? I am good. How are you, Tracy? Well, let's start with a big congratulations for your news. You just put out your trading has resumed. Can you tell us more about this news? Sure. It's excellent news coming out of Europe. We had certification and homologation in Europe in Germany. It took us two years to get that. We announced that a few months ago. Now we have in Germany. We've announced today that we have a strategic alliance with Mozalf. They're one of the largest truck servicing companies in Europe, very credible, very related. And they have agreed to purchase 1,000 units right off the bat, represent us in five countries in the European Union. So we're delighted. Well, of course, those of you out there following Dinosert, Jim Payne, the CEO, of course has got the largest following I've seen of almost any CEO on LinkedIn. And he tells me you're going to win one diesel engine at a time. Well, that's right. We're marketing through dealers and because we're a small Toronto company, we actually have to expand our marketing through other people. So Dinosert sells our units through dealers and we now have a great 30 or 40 dealers around the world now who are selling our products. And they're selling to small truck owners as well as fleets, governments, organizations that can use diesel engines. There's a billion diesel engines in the world. So we have a long way to go. Of course, those of you out there following the news have seen that the Nobel Prize for Chemistry was awarded for the lithium-ion batteries. So everybody's looking at batteries right now. They're looking at vehicles. Would you say that's correct to diversify their portfolio from, say, cannabis winnings? Well, I won't give investment advice, but what we propose as an investment, but also as a technology or value proposition to the end user, is we reduce fuel consumption and diesel engines by up to 20%. And as well, the added benefit is we reduce carbon emissions by significant amounts as well. And our technology is patented. We have five families of different patents, and we've been certified around the world, in Germany, in Canada, in India. These are very difficult certifications to get, and they do a lot of rigorous testing. So our technology is now enjoying the one diesel at a time sales. Well, you just recently put out a news release, for instance, that you received European approval for your hydrogen technology. Let's just talk about that for a minute. Sure. Well, it took us two years. When we first approached two of North and two of South, they were skeptical. They said, how can that be? How can you save fuel by 20%? They have some of the world's greatest experts in diesel engine technology in Germany. We had to convince them to even test our products, and they did. They tested it first time. They got good results. They started questioning their own test. They tested it a second. They went on for four different tests. That took two years. It took—they brought in some of their top engineers in the automotive industry to validate our tests. And now we're proud to say we've passed with flying colors, which is why we have companies like Mozov today coming to us, to Toronto, and saying, we want to be your dealer. This technology will change the world. And, of course, not only will it change the world, you're backed by numerous awards. Can you talk to us a little bit about that? We've been very blessed by numerous awards. We have awards based on our technology. This year in 2019, we got an award in Colorado from the mining industry. We've now penetrated the diesel consumption in the mining industry. We won the top gold award in Colorado this year. We've got the German Innovation Award as well in Germany. We actually have a subsidiary company now, full-time in Germany. So we have a big presence in Europe right now. In the US, we're getting awards all the time. And our future is carbon credits. We now—our telematics now measures our fuel savings, our carbon emissions savings. Now that we can prove by each individual diesel engine at a time that we can save on fuel and carbon emissions, we are applying to have our telematics certified with the organizations that certify carbon credits. So that is getting us a lot of international notoriety as well. Well, congratulations on your awards. Congratulations on your news today. And of course, you're doing exactly what you told us you would do, which is of course your winning one diesel engine at a time. Thank you so much, JP. Thank you, Tracy. Thank you very much.


Alright, you guys ready to go? Look like we've got a packed house here. I'd like to think that's a good thing and not that I have a room full of criminals. My name's Steve Dunker. I'm a college professor out of Oklahoma. Got a few okies in here. I'm going to tell you a little bit more about myself. Number one, I'm a Christian. Number two, I am a lawyer. For Missouri, I have a Missouri license. So if you have a question later on, it has to be a hypothetical or it has to happen in Missouri or they'll nab me for a practice in law without a license in Nevada. Number three, I've got a family. I've got a wife and kids and some of you are going, what are you even telling us all this for?  Hopefully, if they're in the room right now, they've got the hidden camera, supposedly, and they're undercover and they're going to try to figure out how evil you guys are. I figured my talk was a great talk for the news. I figured, oh, this is a guy. He's going to teach you guys how to be evil. That's not what my talk is about. I'm an ex-police officer. I'm very pro-police. I teach future police officers. I know a few of you are already, well, that's a small percentage of you. This is my fourth or fifth DEF CON. It's not in my experience full of rampant criminals running wild. Well, maybe that's my first one. There's a little bit of trouble. As I look at, I used to be, just four or five years ago, I used to be the only one with a white shirt. I did get a lot of weird looks. I don't know if anyone's experienced that, but it used to be you had to have a black shirt. That was part of the culture. Now, I was going to look for the guy in the white shirt, but there's many, many of us now.  Now, once again, the reason I'm saying all this is because of the press. I'm not here to teach you guys how to be criminals. I teach my future police officers this. When we're talking about police criminal procedure, we're talking about honoring the Constitution of the United States, because that's what it's about. That's what this whole country is built on, is the Constitution of the United States. I'm on the Oklahoma Veterans I can't remember what it is now, under pressure. Anyway, I talked to a lot of veterans. They were over there fighting for the flag, and I never correct them because they were over there fighting for the flag, but I also, in my mind, the Constitution, because the Constitution is what built this country, that's what runs this country, and that's what I'm here to talk about today. Police criminal procedure has everything to do about the Constitution. If you're the press and you're trying to catch someone, you're in the wrong talk, you might as well get up and leave. We'll wait. That's not what we're here to do. What we're here to do is make sure you know what your constitutional rights are about by the police. I'll tell you, if you are a criminal, the best way not to have contact with the police is to stop doing anything evil. But for the rest of us, I'll tell you the truth. I got stopped two weeks ago for a headlight out, and the guy searched my car, and I was like, hey dude, it's just a headlight. But he was looking for, I don't know, I know what he's looking for, he's looking for a rest, but he didn't get it for me. Let's get right into it. When can the police make a stop? Well, anytime you're out, whether you're on foot or in a car, the police have to have either reasonable suspicion or probable cause.  Now I'm going to boil this down. If there's a lawyer in the room, they're going to say, oh man, I can't believe he's put in one sentence. But basically, for the normal everyday person, such as myself and you guys, that's what it is. Reasonable suspicion. The officer has to have at least a 25% belief that there's some kind of crime afoot, right? I always like using the word afoot, sounds like sure you like homes. But basically what we're looking at is that cop can't stop you for no reason at all. And that's a constitutional rule. It means they just can't walk up to you and stop you for no reason and force you to talk to them. Now, there's a catch there. Any cop in the world can walk up to you and start asking questions, but they can't hold you there unless they have at least reasonable suspicion or probable cause. Very common tactic police officers use is they come up and say, hey, could I talk to you for a second? And if you say yes, you're voluntarily talking to them. And you bet you can always turn them down. No, I'm busy, I've got to do this, I've got to do that. And they can't force you to talk to them unless they have this reasonable suspicion or probable cause. Probable cause, we bump it up even more. We're going to assign a 51% probability there's some kind of criminal activity afoot. Hang on with me because now we're going to talk about how we determine exactly what evidence we can use to figure out this reasonable suspicion or probable cause. And what we're going to look at and this comes right out of the case, I didn't make this up, we're going to look at the totality of the circumstances. We're going to look at everything that that officer knows and that officer is going to make a judgment whether or not they have reasonable suspicion, probable cause, or something else. And that includes suspects actions.  My headlight was out. What does that mean? Well that means I'm in violation of a law. Yes a very very terrible law, but he has enough to stop me. So he had plenty of what's called probable cause to stop me or write a ticket. He can write a ticket but for you guys, you say well, you know, when I'm out how can those officers stop me for whatever? Let's say I know none of you guys are going to be out drinking tonight, okay? But let's assume one or two if you do, okay?  When can that officer stop you for being too intoxicated in public? Now I realize this is Vegas and what flies at home and what flies here is a big difference, but you can still get arrested, okay? Obviously your actions, right? If you're staggering, you're slobbering, you're just way out of line, all that officer has to do is observe you. And that's probably the most common way these officers pick up if there's enough evidence to reach these reasonable standards that they're going to decide whether or not to arrest you, okay? They're going to look at everything. Now some of you watch like CSI, right? Which I don't watch very often, but every once in a while. And basically what that whole process is, is them gathering evidence to get to the level of probable cause. They want to get to the point where they can arrest that person and haul them in. And as we all know, we need proof beyond a reasonable doubt, which is even a higher standard to convict somebody, right? If I had to put a number of proof beyond a reasonable doubt, it's like 99.5%, right? Or even higher. Well when do you get frisk? Now, I just came through the TSA checkpoint in my airport in Tulsa, Oklahoma. And I got to be frisk. And he was eating. He basically just ordered me around. It wasn't a whole lot of evidence. But he decided he was going to frisk me. Well that's totally separate than what we're talking about. Because when you go through an airport checkout you're kind of, it's a consent type thing. I guess you could refuse. I don't know what they do if they physically, you know, frishe decide, well I'm not going to fly. I'm leaving now. I don't think I'd try it. You probably end up on a no-fly list later on. But out in the public, what can happen? When can an officer just walk up to you and frisk you? Well this goes back to a case called Terry versus Ohio. And that case is just a really good example about when an officer can and can't frisk you. And in that particular case, there's a detective in plain clothes and he knows the guy standing outside a jewelry store, I think it was. And he's standing there and every once in a while the guy would walk over and look in the window and then he'd walk back around the corner. And he did that several times. He also noticed that the guy's wearing a coat. Well it was summertime, right? Now this is where I was going to insert but I don't see any... I think it was like three years ago or four years ago or right after the matrix came out.  And it was at least a hundred degrees. I don't know how they survived. If you're here, don't get mad at me. It's just a good interesting... I don't see them here today. Anyone see a leather trench coat? Anyway, it's summertime. What would you say is going on if you're that officer? Well it's pretty clear. The guy's wearing a heavy jacket. It's summertime. It's hot. And it certainly looks like he's casing the joint, right? In fact, the officer went over. He put the guy up against the wall and padded him down. Founder, I think, was a revolver in his pocket and made a rest. Well that case got appealed all the way to Supreme Court. Supreme Court said, you know what, that's reasonable. We're going to look at the circumstances. And that works not only on a person. If there's something about that individual's activity that makes him suspicious and that's something that the cop can actually state then we're probably going to be able to pad him down. And that is if you think about it, that's common sense, right?  No, you have to have that. You have to reasonably believe criminal activity has taken place and the suspect may be armed. Well, what is a frisk? Well, the Supreme Court ruling basically said what we're going to do is allow you to look for weapons because that's what this is all about. It's about safety to the public, about safety to the officer and when you pat someone down, you're only going to look for weapons. Well, what's a weapon? Well, it can be a gun. It can be a knife. Those are either ones, right?  Some of you are carrying a pocket knife. Well, what size pocket knife can be a weapon, all right? You could be carrying fingernail clippers. The airline reference? Okay, not that funny, I guess. All right, I'm trying. Well, whatever. If it can be a weapon, the officer can make you take it out of the pocket or more so likely they'll take it out of your pocket and so on and so forth. Well, what about, and here's what what if you have something in your pocket that is not a weapon but it's contraband, okay? For example, when I was a police officer and I always liked this was I pat someone down and it was clearly a bag of marijuana in their pocket and I look at them and say, is that a bag of marijuana? I'd be surprised how many people said yes it is, okay? Well, the basic rule is if the officer can determine from filling that pocket what it is and let's face it I've never used marijuana in my life.  That has a lot of sticks and seeds in it. I know none of you guys know what I'm talking about, okay? But if you got a bag of marijuana in your pocket and it has the sticks and seeds and a cop feels that, can the cop I mean, let's face it, everyone knows what that is, right?  There's a bag in my pocket? Yeah, there is. Anyway, the general rule is if the officer can figure out what that is from touching it, that it is contraband they can seize it, okay? Here's a big one that I always get from my own students, they ask a lot they'll even break it in the class. I got stopped and the officer did not even read me my rights. Okay, now here's the general rule we've all been programmed if I asked you all to recite the Miranda rules Miranda warning right now, you'd all could do it. I mean, we could have a little course going here, okay? Because we've seen it on TV so much, okay? But here's a rule you have to think about. The cop is never ever required to read you your Miranda rights. Now let me because that kind of pops a lot of bubbles here but let me clarify just a little bit. That cop does not have to read you your Miranda rights unless they want to use your information in court, okay?  And you get caught by the police and there's all this good evidence the reality is the cop doesn't have to say let me read your rights. Now they'd be kind of lax it wouldn't be following their protocol if they didn't, but the reality is they don't ever have to read you your Miranda rights unless they want to use whatever you're going to tell them in court, okay? So, that's the thing to you know, I have people that didn't read my Miranda rights, does that mean I'm free? I can get the case overturned and my answer always is, well it depends it depends on if they're using whatever came out of your mouth as part of the evidence if that's what they're going to use to convict you then you're right, you know we can get the case overturned, okay?  Well, if you're at handcuffed and back at the patrol car you can pretty much be assured you're in custody, okay? If you're down the jail cell you're in custody but that's usually not, you know when I was a detective what I would do to avoid being putting people in custody I would say, hey, hey, you know why don't you talk to me over here and why don't we go down the station and talk and I'm not going to drive you down there, you know because I got something to do later why don't you get in your car and follow me, okay? and I drive and this guy would get in his car and he'd follow me down the station and I'd say, you sure you want to talk to me? Yeah, yeah, you don't have to talk to me I understand but what I was doing was setting it up so I don't have to do Miranda because if he's not in custody, if he followed me to the police station, okay he's not in my car, okay I'm not following him if you ever had a cop behind you none of you have okay and you're worried oh my gosh there's a cop behind me I better do everything, if he tells me to go to the station then gets behind me, I feel like and you could argue that you're in custody, right? Well I always say, hey, follow me down there well it looks and at this stage of the proceedings there's any type of legal challenge I mean, look what I'm going to tell the judge judge, he wasn't in custody, I told him he didn't have to come and I told him to follow me have you ever heard anyone being arrested by, hey, get that car, follow me down you're under arrest, that doesn't happen, right? and so I would get this guy to come in and talk to me and force me the evil ones who are here, the one percent then he might say, oh that's terrible you tricked him, I didn't trick him follow me down, the guy followed me down it's like robbing 7-Eleven without a mask don't do it, okay? now, if anything if there is a press person here, that's the sound clip that's going to show up, right? I told you to rob 7-Eleven wearing a mask I can see that now on Dateline and then this lawyer told him to rob no okay it's a good thing I'm a lawyer because I'll sue not win, but I'll sue, damn it okay now here's the other things you need to worry about is Miranda Miranda is not required for common traffic stops if you get it, do get stopped for speeding or headlight they don't have to read your Miranda at no time and I'll tell you as a police officer I guess this might be verging into the area how to tell you how to commit crimes but we've all been stopped for speeding, or if you haven't living near work and don't have a car or something one of the things as an officer I do, if I'm writing tickets, I'd walk up and I'd say, you know, driver's license insurance, and while they're getting I'd say, you know what I stopped you for and if they said, yeah, speeding what is that? Confession, it's a confession and I'd write down back when I took it yeah, they said blah blah blah I couldn't lose, okay, they confessed not only did I have it on my radar but the police officer judgment well they can't come back later because there's a case out there, say hey, you know how it's common traffic stop, we do not need to do Miranda for that type of stuff another time they don't need it is booking questions you're under arrest, you're downtown you're being booked into the computer, what's your name what's your address you're allergic to any type of medicine, are you on any type of medicine they go through this big, I mean, anyone ever been arrested just checking see look at this, dateline if you're here Zero arrest, okay. Booking questions are not, does not require Miranda. Now I stuck DWI out here not because DWI were, I'm from, stands for driving law intoxicated, okay. That's what the charge is. There is, and I don't know if there's a case on this, but I'll tell you my secret that when I was a police officer, it was not my secret, it's not even a secret I guess, because it comes up in court. Basically, if you're slurring your words and say, what's your name? And you say, well, my name is Steve, and you forget your last name, okay. That's going to be used against you for drunk driving, okay, rightfully so. And the one thing I know is I have arrested a lot of drunk drivers. And I'll say this, you know, don't drink and drive, especially in Vegas, there's no need to drink and drive.  But drinking and driving, usually the people who get arrested are so, I'm a Christian, so I'll say crap-faced drunk, okay. They are very, very, very drunk. You're not getting that, I mean, it's kind of a, it's obvious to everybody, okay. Let's talk about searches for a second, and we're going to talk about it in a way that you may not have thought of a search, and that is the definition of the search that we're going to use today is this, a government agent invading your privacy. And that's what you should always think about when it comes down to the search, okay. And there's a couple things that we need to take out of that. First of all, government agent, okay. And I get this question a lot. You're in Walmart. Walmart security stops you.  And every once in a while I get students, you know, they're always from another department, besides mine, they show up in my office, and, oh, Professor Donker, I've been, my constitutional rights have been violated by Walmart. Okay. It'd be a lot more funny after, I guess I should have told you the rule, Walmart cannot violate most of your constitutional rights. There's a few they can, you know, some of the protected classes, race, religion, that type of stuff. As far as searches, Walmart cannot violate your searches in 99.5% of the cases. They can't violate your constitutional rights because they're not a government agent. The Constitution, and if you're not paying attention, that's where you need to pay attention right here, okay. The Constitution protects the people from the government. It doesn't protect us from each other. It protects us from the government. If it isn't the government doing the action, then the Constitution, in most cases, and that's lawyer talk, most cases, most of the time, it just protects you from a government actor, okay. Now, that can be someone who's employed, you know, if you're, someone comes in your house and they're working for the police, may not actually be carrying a badge. They might just be in a form or something like that. They're still a government agent most of the time, okay. Now, search and seizure, when I teach this at, you know, at the university, it takes me weeks and weeks and weeks. I can't really, you know, I got five minutes, okay. You know, there's a lot more out there. The other thing you have to look at is reasonable expectation of privacy. Do you have a reasonable expectation of privacy? That's one of the questions you have to ask. And right now, if you think about it, do you guys have a reasonable expectation of privacy in your backpack, your purse, and the answer, you shake your head, yes, okay.  I'll pick on the guy in the front row with a big red backpack. You're American, aren't you? Okay, just checking. Not if you're not American, you're bad. I'm just worried about terrorists. We actually, was it last year, we had the guy who wore the turban. He won't remember. A year before, I don't know. When you get old, your mind starts to go, your guy wearing a turban carrying a backpack around DEF CON.  And I thought about doing it to help me get through the crowds. You know, I thought, that's pretty cool. I'll just put a tap. No, I won't go there. Reasonable expectation of privacy. Search isn't it to arrest, legal arrest will offer search of the suspect in the surrounding area. Now this can be bad if your friend comes over your house and gets arrested in your living room and you have something in your living room that you don't want the cops to find out, right? Because the basic constitutional rules are that if you get arrested, the police can search anywhere in the general area. It used to be called the lunge, wherever they could lunge and grab a hold of a weapon or the wingspan, whatever they could actually touch. The cops could search. And what they were searching for is weapons, okay? And of course, if they found contraband, that could certainly be seized. But if you get arrested out of the car or Bob or Sue is riding with you in your car and you get stopped and they have a warrant, your car is going to get searched because Bob and Sue were arrested out of your car, okay? And that may not make you very happy, especially if you had, you know, it's a hitchhiker, right? It could be bad, right? No, we're all good here. Motor vehicle searches. As long as they have probable cause, probable slides, you know, this idea that we have enough evidence, believe some kind of criminal activities occurring, they're going to be able to search your car. And the idea behind that goes way back before, almost before they even had cars, believe it or not, it goes way back to some of the, like the very first car case ever. They said, well, we can't get a warrant and these cars are mobile, they move around a lot and we're going to require no search warrant for an officer to search these cars. The other thing that comes up when I get questions on this is, all right, they've searched my car. They have probable cause. And believe it or not, one of the common things I used to get at least once a week is a domestic violence case when I was a police officer.  Well, when the cop catches up to Bob, can Bob search his car? And the answer is yes. What's he looking for? A handgun. If there's a little film caster, and I know this is at a digital age, but those of you who are old enough, remember the 35 millimeter film casters? If you're a doper, you probably remember that today. I don't know.  My students hate it when I use the word doper. I don't know, maybe they're dopers or something. It's not dope. It's weed. I don't know from my generation if you're smoking. Well, anyway, I used to put it in the film casters, you know, trip down memory lane. They put it in the film casters. Well, if I'm searching for a gun, can I pop open that film caster? Well, the general rule is no, if I had probably called to search for a gun, I can't look for a gun in a film caster. Why? This isn't a trick question. It's because the film caster's too small to hold a gun. Now, if they had a briefcase, can I pop the briefcase to look for that weapon? Yeah, okay. All right, let's see. I can't hear you. I'm going to have a question ashen period just in a second here, and we're real close to being done with the overheads here. When can the police kick your door in? Not that you hackers ever worry about this. Some of you lay awake at night. No, we're all good here. We don't do anything, right? Just shake your head, yes. Smile at the person next to you in case they have a date-line camera in their bag. You knock and announce as a general rule.  Now, if you ever watch cops, you know, sometimes it's police, and then they kick the door, right? Believe it or not, that satisfies that rule. Now, I don't think... I don't think that's what the Supreme Court justices had in mind, right? But I haven't seen a case where, you know, it's like knock and wait for them to answer, you know, to do that. Well, there are some exceptions to that. Safety, if you think the person on the other side of the door has a gun, okay, or some other weapon they may use against you, and I remember one case, a guy on the other side of the door had a sword. I'm not sure what was going on there, but they had a sword. Destruction of evidence, and I will go back. But at the only time I've ever had an actual... an actual... an actual... an actual... an actual guy come up, and he did not follow my rules of saying hypothetical, and he was also kind of a criminal. If you're here today, don't be mad, but he came up to me and asked me the best way to destroy his hard drive in case they kicked the door and do it in a very fast manner. And all I said was, get away from me, you know. My FBI files, I don't want it to be thick, okay?  By the way, you probably all have files now, okay, but I'm coming here. I take that back. Alright, destruction of evidence. If they think, you know, if you're really a hacker and they've tracked you down, they're probably going to kick your door on this... exception, destruction of evidence. They don't want you wiping your hard drive, right? Exclusionary rule, exclusionary rule says that if they don't follow all the procedures we just talked about, then we can not use that against you in court of law. Okay, so if they have a bad search, they read you, or did not read you your Miranda rights and... but they want to use what they found out from your testimony in the interrogation room against you in a court of law, they're not going to let that happen. If there's a legal search, they're not going to let any type of evidence be used that's gained from that illegal search. Finally, double jeopardy. And this, we have to go back and visit OJ, because you guys care. Remember OJ, okay?  Allegedly, the guy did it, okay? He can sue me if he wants. No, actually, he's a killer, okay? And you guys are like easy, aren't you? OJ, bad man, okay? All right. Anyway, double jeopardy. Double jeopardy says that if there is a criminal statute at both the state and federal levels, you can be charged at both the state and federal levels. Now, when we talk about computer crime, I know there are a few of the criminals that are in this room, they're coming after you, both state and federal, if you are a really bad dude. Now, for the rest of us, what we just need to know next time we watch, you know, those crime TV shows, basically double jeopardy prevents you from being tried for the crime twice. Once you are acquitted, they can't try you ever again. And in the OJ case, it's a good representation of that. OJ was tried in state court and there was two murders, right? There's a murder of his ex-wife and the murder of the waiter. And some of the questions I got, well, why didn't they just try him for the wife first and then when that failed, they could turn around and try again for the waiter. And there's some legal principles in there we're not going to get too deep into, but basically it all kind of comes back to double jeopardy. You're going to be tried for crime one time. But if there had been a federal criminal statute, which there isn't for killing your wife, he could have been tried in federal court, but that's non-existent, okay? And the only way you could do that nowadays is if your wife was a federal agent and you killed her, you could be tried in state court and federal court, okay? All right, listen up here so you don't get this wrong, okay? Questions for the criminal justice professor must be hypothetical. Look at that as a good college professor. I even gave you the definition of hypothetical, okay? And there's always one person that blows this. Do not start your question here with I, okay? Just say, hypothetically, all right? We used to have some microphones. I guess they didn't put none in. I guess I'm not speaking very well. They didn't put none in. Speak up loud, so, yes, sir? Okay, everyone, I'll say, I have to repeat your question because some people couldn't hear it. His hypothetical, which he failed to use the word, a police officer breaks into your house, does not have a search warrant, actually stills a piece of evidence, and later on it's determined in court action, I assume, that that evidence cannot be used against the person whose house that was. The question was, why cannot, or why can that police officer not be charged with burglary? And the answer is, he can, okay?  Now, the way it works though in those charges is a prosecutor. And so, if the prosecutor declines to file charges, those charges aren't going to be um, uh, on, okay? Now, the only exception is that some counties have, uh, what's called grand juries, which are made up of people. Just out, they pick them, off the voter rolls or driver's license, and they get them together once a year, and they go through cases that basically their job is to keep the prosecutor honest, so there isn't stuff like that happening, okay? So you might look for a grand jury in your area if there is one, if there isn't. You could also do a civil 1983 action where you sue the police officer for violation of your constitutional rights. And that's, I mean, I can teach a whole class in 1983, so I can't tell you much more on that. 1983 is just a civil rights action, a federal civil rights action for people who violate uh, go ahead and stand up who violate your civil rights, and you gotta yell out, are you that guy I talked to a couple years ago? Get away from us all. Okay, you know, I answered this question, this question doesn't go away. I will tell you this, okay? In my experience, destroying evidence is gonna get you more time than just letting them find evidence, okay? Now let me explain why, okay? It's a federal law and state law that says that destruction of evidence is a felony, okay? And the fact that you have this alarm system rigged up, I mean, can you ask for better proof?  But I know, you know, if you have your alarm system rigged up to wipe your hard drive, you're going to jail, maybe not for what's on your hard drive, but you're going to jail for destruction of evidence.  I can tell criminals from miles away. Let me ask this guy in the front row. No. His, I'm sorry, the question was, use of encryption, is that probable cause for any crime answers? No. Now, once again, I'm not tech guy, I don't know, you might ask the EFF people or something, and you guys probably know this better than me. I think there is a law about exporting encryption, you know, so don't do that. Make sure you're not giving away what, okay, you know, keep it to yourself here in America. The question was, if I'd ask or if I talk about checkpoints, you know, DWI checkpoint, DUI checkpoint, those are exceptions to this rule for reasonable suspicion and probable cause.  We sit there and it's always, you know, your papers please, I can't do a German accent, but just insert German accent there, the Gestapo or your papers please. And when I became a police officer, I was actually a police officer against checkpoints, okay, because it was very Nazi-like, okay. But unfortunately, the old men on the Supreme Court and old women on the Supreme Court don't believe that's the same thing, okay. I don't, I think as Americans, we should be able to go and not be impeded by the government unless we have committed a crime. And I'll tell you, as a police officer, I never ever had a problem finding a drunk, okay.  Checkpoints are just to me, for what we traded off for the right to have checkpoints, it's illegal to do checkpoints. It wasn't worth it. He said lazy cops. He said lazy cops. Uh, boy. Let's go over here by the door. The question was, search warrants for car. Okay, I haven't heard that. I couldn't help you out with that at all. I'll talk about that in class. Yeah, I don't know. In Oklahoma, as long as you're breathing, you don't have a criminal record you get a gun, okay. It could still carry for a minute, okay. I'm not kidding, you know. And that's a good thing, I think. And I'm actually, but let me say this, because I know the guy coming on after me actually is a friend of mine and so gave him a lot of heck, okay. But they're talking about guns on Sunday, and I'll tell you my experience, before you run out and spend all this money on weapons and training and everything, I used to carry a gun for a living, and it was actually irritating to carry this big heavy. It felt like I had a pocket full lead off duty, okay. Now on duty I realized I had to carry it. But I got to the point, I hated to carry it again. I know you might think it's weird, but I don't want you to go out and spend a thousand bucks and say I'm going to carry a gun, because you won't carry it very much, okay. Let's go right here. Yeah. I think there's some current cases on that, and I don't know the answer on it. I would say, don't do it until you talk to your lawyer, you know. Wait for the subpoena. And once you get the subpoena, that's when the court and argued, no, we're not going to do this. But my gut feeling is just from similar type cases, you're going to end up having to give it. Let me go to the guy next to him. Maybe we do have criminals in here. Hypothetically, if his house is being searched by the feds, go ahead. Okay, the question is, can the feds bring help? Can they bring along their state and local police officers? The answer is yes they can. It says they can't bring along the media anymore, okay. But they can bring along local police. How much time I got left? Okay. Okay, I got seven minutes left. Let me go to this guy on the corner. He's been waiting patiently. Another criminal wants to know about the hard drive wipe. Just kidding, he's a good guy. The question is this. What happens if you just wipe your hard drive every week?  You guys can all come over and I'm going to ask you to come help me. Shake hands. Another Oklahoma professor. One more. Let's go. He wants to know about, let's say he's carrying a cell phone or he's carrying a small PC, a laptop, whatever in your car. I don't know, maybe have a van full of computer electronics. What are the rules?  And a cop stops you and there's a laptop sitting there. Can the cop search your laptop? The answer is no, they can't. They can't, can they look at your cell phone and look up who you've been calling and who's in your cell and the answer is no, they can't. Unless there's some probable cause there but even on the street, they're not going to be able to I think, I'm kind of looking here at the other professor and he's ignoring me, but I think the rule is they have to have a search warrant. There's a case out there where they looked up, a guy had a cell phone, they looked up they tried to establish he was with some druggers and I think they threw that out. He's ignoring. Alright. Let's go over here. Same. I can't hear you. You got to yell a little bit louder. How can the schools search lockers and so on and so forth? Cell phones. Because the Supreme Court basically has said that the public schools are about three steps below God and they can do that. Okay. And it goes to safety. If you're a school and you go before the Supreme Court you're almost always going to win this idea that they're acting in the best interest of the kids. Let me go back here. He can just say shut up and stand over there and he can make everyone get out. Let me say this real quick, because I got probably two minutes left. Three minutes. When you come to the police officer it's just like you. Wherever you are working at let's say you're working and I don't mean this in a draugatory way. This is just like one of the first jobs I ever had when I was 16. I was working Taco Bell. Well someone comes up to the counter and they're ordering from me.  No, not really. But maybe you're not going to get as good as you see it. The same thing with police officers if you're nice to them. I'll tell you the truth, I got stopped a couple weeks over the headlight. I was real nice and polite and not only because that's kind of my nature but because I also know that if I said what are you stopping me for? I'll tell you the truth. He was running a, we used to call him Honey Holes back where I worked at and what it was it's a big stretch of highway where the speed limit is so low and that's what he was working. He needs, and I know if there's copy, oh no, no, that's not true. But every cop actually has a ticket quota. They have to fill their quota.  And it was late at night, his shift was just about over and this highway patrolman had to get his ticket count up. And that's what he's doing.  He used the cops, he let me go, he could have wrote me, I think he told me, oh this is a $198 ticket, I'm not going to write it though, I'm going to let you go, just get that fixed. Yes sir. Hypothetically, how can Walmart detain you and take you in the back room? Okay. It's going to be based on your state citizens arrest laws. Remember Barney Fife?  Man, I might be too old for most of you. Most states actually have a statute that allows citizens to arrest other citizens and that's what Walmart's going on. What I would do, you know, this is going to make dateline, he told shoplifters how to shoplift. No. If anyone ever comes up to you and says hey I need you to come with me, you're under suspicion for doing this, say hey wait a minute, what are you talking about? And question them out there, don't do anything violent, just remain passive, don't raise your voice and make them talk to you because I don't know, if someone comes up to me they'd better talk to me because there's enough strange weird people, this is Vegas that would ask you to do stuff that you should do.  We've had people that wait outside payday loan companies and when you come out with your money they get you to stop and then it turns out their robbers are not even on authority. Yes, last person probably, two minutes. That's probably, that's way beyond me. I will say this about the feds, okay? Two minutes? Okay, two minutes. I will say this about the feds and this is one of the reasons I actually talk here. You guys are actually our future defense. Now you may not know that right now, some of you do. There's a reason, you know why the feds come here every afternoon. They're here this afternoon, right? Meet the feds. You know what that is. You think they're just being nice? Come on in, meet me.  You know here, have some teen cookies. You know what they're doing? No, they're recruiting.  We'll put him in our database. No, they want to recruit Bob and Sue into the federal service.  I mean, the feds don't show up here just because they're after criminals. They're after recruits. You guys are the future defense of this country, right? Now let me say something on that, because I do post a lot of students through the system and I got federal officers, state officers, all kinds of people doing stuff. But one of the things that does get you in trouble if you try to go into federal service or any other type of law enforcement is your past behavior. Say no to drugs now, okay? I'm serious.  But it's time to put if you're looking for federal service or federal job, you need to stop the marijuana right now and certainly don't experiment with anything heavier if that's what you're looking for.  You know, the cyber war. That's the future. And you guys are the soldiers in that. That's going to save my eBay account, okay? And you better do it, okay? We need you.  All right, any more questions come across the hall? I'll be there and I'm drafting this other answer to be there.