You can ask your doubts here or you can email me at prakharbansal1 gmail. I'll try to answer to my best. The SlideShare family just got bigger. Home Explore Login Signup. Successfully reported this slideshow. We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Next SlideShares. You are reading a preview. Create your free account to continue reading. Sign Up. Upcoming SlideShare. Embed Size px. Start on. Show related SlideShares at end. WordPress Shortcode. Share Email. Top clipped slide. Download Now Download Download to read offline. Let's step through the parameters one by one:.
The null platform is a special platform which is convenient to use as the target when using mig. It includes all the standard system components, but with dummy do-nothing implementations. Building an application for the null platform is useless, but it allows mig to extract the layout of packets. Let's build a Java packet object for BlinkToRadio. Open the Makefile for BlinkToRadio and add a dependency:.
Note that there must be a tab before javac, and not just spaces. Finally, add the line which explains how to create BlinkToRadioMsg. As with javac, there must be a tab not spaces before mig.
One part of the TinyOS communication toolchain requires being able to figure out which AM types correspond to what kinds of packets. Modify BlinkToRadio. Recompile the application, and you should see no warning. Install it on a mote. Now that we have a Java message class, we can use it to print out the messages we see from the BaseStation.
Now, when the BaseStation sends a packet to the serial port, MsgReader reads it, looks at its AM type, and if it matches the AM type of one of the Java message classes passed at the command line, it prints out the packet. You should see output like this:. One problem with directly using the serial port is that only one PC program can interact with the mote. Additionally, it requires you to run the application on the PC which is physically connected to the mote. The SerialForwarder tool is a simple way to remove both of these limitations.
For example, you can run a SerialForwarder whose packet source is the serial port; instead of connecting to the serial port directly, applications connect to the SerialForwarder, which acts as a proxy to read and write packets. The first step is to run a SerialForwarder; since it takes one packet source and exports it as an sf source, it takes a packet source parameter just like the other tools we've used so far: you can pass a -comm parameter, use MOTECOM, or just rely on the default.
Close your MsgReader application so that it no longer uses the serial port, and run a SerialForwarder:. Since SerialForwarder takes any packet source as its source, you can even string SerialForwaders along:. This command opens a second SerialForwarder, whose source is the first SerialForwarder. You'll see that the client count of the first one has increased to one. It's rare that you'd ever want to do this, but it demonstrates that in the message support libraries you can use a variety of packet sources.
Close the second SerialForwarder the one listening on port Run MsgReader again, but this time tell it to connect to your SerialForwarder:. In addition to serial ports and SerialForwarders, the TinyOS messaging library supports a third packet source, motes which are connected to an ethernet port through a Crossbow MIB ethernet board.
This is the full set of packet sources:. In the network packet source, the default MIB port is Code for the Java messaging toolchain lives in two java packages: net. The packet package contains all of the code for packet sources and their protocols: it is what reads and writes bytes.
The message package is what turns streams of bytes into meaningful messages and provides packet source independent classes for communicating with motes.
The key class for sending and receiving packets is MoteIF. It has methods for registering packet listeners callbacks when a packet arrives and sending packets. The tools MsgReader , Listen , and Send are good places to start to learn how to get Java applications to communicate with motes. The serial stack will send it over the serial port regardless of the AM address specified. The TinyOS serial stack follows the same programming model as the radio stack.
There is a SerialActiveMessageC for turning the stack on and off mote processors often cannot enter their lowest power state while the serial stack is on , and generic components for sending and receiving packets. As the serial stack is a dedicated link, however, it does not provide a snooping interface, and it does not filter based on the destination address of the packet. These are the serial communication components and their radio analogues:. Because serial AM communication has the same interfaces as radio AM communication, you can in most situations use them interchangably.
For example, to make BlinkToRadio send packets to the serial port rather than the radio, all you have to do is change the BlinkToRadioAppC configuration:.
Now, rather than have BlinkToRadio send packets which a BaseStation recieves and forwards to the serial port, the application will send them directly to a serial port. Connect a MsgReader to test that this is happening. See our Privacy Policy and User Agreement for details. Create your free account to read unlimited documents. This is the second part of the TinyOS 2. The SlideShare family just got bigger. Home Explore Login Signup. Successfully reported this slideshow. We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads.
You can change your ad preferences anytime. Next SlideShares. You are reading a preview. Create your free account to continue reading. Sign Up. Upcoming SlideShare. Embed Size px. Start on. Show related SlideShares at end. WordPress Shortcode. Share Email. Top clipped slide. Download Now Download Download to read offline.
0コメント