 So today, I'm just going to go through real quickly about the Vehicle Hacking Village's badge that is for sale this year Basically, here's a picture of the badge That shows some of the features that the badge has Basically the hardware highlights are you know, there are four independently controllable RGB LEDs I'm just talking to the microphone. I don't know if it's coming out here Okay, so the story is there's no projector So you aren't going to be able to see anything that I'm talking about But we have to record this so that Defconn could put it online So if you want something if my opinion is if you want to get something valuable out of it Just come over to the to the automotive hacking village. I'm going to be doing this talk again this afternoon I believe it's at three o'clock over there. I'll also be doing it tomorrow morning But I'll be over there all day all day tomorrow. Just come and grab me we can go through it We could do an ad hoc if everybody in here wants me to just do it right after this we can right assuming that there's a free Spot we could do it. So this is kind of like a technicality here If there was a projector you'd be able to see so Can you guys hear the audio okay through this? Okay? so basically there are four independently controllable LEDs there's a 128 by 128 color LCD on the badge along with two more push buttons and then as far as IO goes There's a USB port that can be talked and I'll talk about that later There are two independent can channels on the badge I also break out the single wire debug Cortex header So if one wanted to blank this and use it as kind of an evaluation board feel free And then also I provide some pin headers for native IO Most important go to car hacking village calm and get the SDK the SDK has lots of documentation I wanted to provide enough documentation this year so that You know you aren't forced to use Windows for example. Let's say you wanted to use Linux and Try to use the USB port etc. I'll give you all the information about the protocols The Windows tools that we're going to talk about coming up here use to program the badge I gave the full source code for those so I wanted to try to to make it easy for For Linux users and Mac users to use the badge this year Basically the badge in a nutshell is fully scriptable Basically, you don't need to you know write raw c code per say to to control everything that you see on the badge and to have the badge do What you needed to do so the script that I the scripting language that I use just like last year is called Pawn It's it's C like it's interpreted and it's designed to run very quickly and embedded targets It's my opinion that it's easier to write than using you know traditional embedded C etc And here's some information here as far as where Pawn came from and who created it etc The documentation is excellent for the language by the way some more nuts and bolts and you can read into this more as you explore Pawn on your own it looks like C But there are some weird things and my colons are optional There's only one real type and that's a cell The other one out of here is you know, there's really no linking phase So basically you just chain multiple scripts together using pound includes There any prototypes for functions? etc So when you look at Pawn on the badge basically Pawn by itself is the interpreter But there are libraries that Pawn comes with much like how there are standard libraries with C to do core operations These things are basically implemented through what Pawn calls native extensions So basically what that means is in the Pawn land a function is called in in the Pawn world and that maps down to Something that's been implemented in C on the target So, you know some of these standard libraries there's stuff in there for strings there's stuff in there for floating point operations etc Again the SDK has all the documentation in it if you get it But More importantly the badge has a lot of native extensions that have been created by myself To do things like control the LCD control the LEDs Manipulate the CAN bus etc. And that's where the that's where the real power comes in So of course you have to start with the hello world So here it is in Pawn Looks a lot like C as you can tell Some of the more syntactic stuff like you know main main's not returning a type But it's not it's not accepting any arguments. You don't have to put void in there There's no semicolon after the printf etc, but you know this this script will run on the badge and You know when using the right tools, you will see hello world come out of the console So as I mentioned before the SDK Downloaded there's tons of great information in there I think you'll find that it's incredibly easy to customize the badge even if you don't use the badge for doing CAN bus stuff The tools that I provide etc. Let's say you just wanted the lights to change colors differently, or you wanted to put your own bitmaps on the LCD Should be incredibly easy for you to do that. So I'm really I'm really excited to see who How how people customize this badge once they start getting into this this SDK because I think this year I tried to make the badge as accessible as possible Last year it was accessible, but you needed an FTDI You know USB to your converter. It was it was a little clunky this year. It's it's of my opinion It's very streamlined There are lots of examples in fact the the what the badge does right out of the box with the LEDs and the and the The bitmaps being shown that's the script that's in the include are in the example files as well So you could go in and just modify that if you want to change something Compiling scripts, we'll talk about this a little bit more at the village, but And there are lots of readme's in the SDK on how to do this But basically you invoke a binary called pond CC and you pass it your script and out from that comes An AMX file. That's basically ponds Intermediate compiled bite code Then also in the SDK there's the utility that I call QCM dot exe That basically talks to the badge and loads the AMX file. So This is a it's a dot net application. It's a windows application It's very I think pretty intuitive to use I mean, there are two buttons at the top of it one says load script so you click on script and You click on load script you point at the AMX file kaboom down to the badge it goes and it instantly runs Again as I mentioned before to help Non windows users out. I've included the full source code for this application in the SDK With the intention of somebody being able to easily see how to talk to the badge by analyzing that source code And then creating something else either, you know a different script, you know potentially You know Python script or Pearl script or something like that on Linux So with Pawn One of the biggest powers I'm just going to go through this really quickly there's this concept of event handlers and This is what makes Pawn so powerful in the badge because think of it as they're there They're a secret is callbacks that occur in the In the interpreter so they're kind of like a interrupt service routines Or something like that to where when events happen outside of the interpreter These routines are instantly called so this lends itself very nicely to handling like timer explorations or a can Message has arrived for a particular filter on a particular channel Etc etc. Look at the examples. You'll see a lot of what I'm talking about timers Again look at the SDK, but I basically go through here and show a little bit about how timers are set up You can see it's a very small script just to kick a timer off that that expires after 250 milliseconds in main We start the timer and we have this callback that starts with the outside that where the timer expires We're gonna get a we're gonna get something out of the the console that says timer expired Console routines this this Example basically shows what happens when data is received over USB From the Windows PC it basically calls to say secret is callback called host RX It passes the data and all this example does is just print the data out and hexadecimal Can interfaces so Again look at the SDK for this to really dig into it. I'll go to the example If we look at the main routine at the bottom again We initialize the the can channel to 500 kilobits We configure a filter For that channel. Let's say it's the filters at seven E zero hex is the can ID and in the same way as the previous example Whenever we receive a message for this can channel in this filter We get this callback that starts with the add sign and in this example What we do is we print that data out, but we also transmit the same message out using QCM can TX on a different can channel. So this example kind of shows a real rudimentary gateway We're receiving 70 zero and we're forwarding on a different can channel 78 for example I'm gonna spend a lot of time on the state machine stuff lots of examples to look at Again the badge pond specifics. This is also in read me's in the SDK Basically, this is talking about some of the limitations of the batch stuff and also some of the stuff that is in the batch As I mentioned look at the examples folder I've included all of the pond documentation that's available on this pond website in there as well but if you want to look at it in more in-depth feel free to look at the the website and Here's my email address if you want to contact me feel free to contact me anytime about pond the badge Other systems that I make that basically use this system that are more robust etc I welcome the comments and look forward to any questions with that. Thank you very much