📄 readme
字号:
A 6lowpan implementation for TinyOS 2.xThis is a 6lowpan implementation for TinyOS 2.x. Mesh Addressing andBroadcast headers are parsed, but no mesh-networking/multi-hopping isimplemented. 6lowpan fragmentation and fragment reassembly is fullysupported. The 6lowpan-specified HC1 compression of the IPv6 headerand the HC_UDP compression of the UDP header are supported as well ashandling of the uncompressed headers. The implementation can respondto ICMP echo requests and handles communication over the UDPprotocol. It has been tested on the TelosB and MicaZ hardwareplatforms. In addition a 6lowpan-translating daemon has beenimplemented to allow a linux PC to use a mote as an 802.15.4interface.Shortcomings and missing features: * 6lowpan payload is sent as Active Message payload. This means that the 802.15.4 payload is prefixed with the 1-byte AM Type field. * non-zero Traffic Class and Flow Label are not supported by the current HC1 implementation * UDP port numbers compression is not supported and port numbers are always sent in full by the current HC_UDP compression * Neighbor Discovery has not been implemented and link local broadcasts are used instead. * Not all fragments of a datagram seem to be always received by the mote. A workaround is to add a usleep(10000) before sending subsequent fragments in the serial_tun daemon on the PC. * The mspgcc compiler generates broken code using 16-bit values not aligned at 16-bit boundaries. See http://www.nabble.com/msp430-gcc-generating-unaligned-access.-t2261862.html and page 25 in http://www.eecs.harvard.edu/~konrad/projects/motetrack/ mspgcc-manual-20031127.pdf for details. This seems to only happen with packed structs, where some elements cannot be aligned. For example, a struct with an 8-bit, 16-bit, 8-bit and 16-bit value in the given order. As the struct is packed, one of the 16-bit values can be aligned at a 16-bit boundary. The current workaround is to force 8-bit operations for cases where this can happen. This is done by the set_16t(), get_16t() functions. In cases where unaligned accesses could happen, these functions have to be used.More details can be found in http://www.inf.ethz.ch/personal/mharvan/docs/msc-thesis.pdfor by reading the source code.USAGE - MOTEThe 6lowpan/IPv6 stack is implemented in the IPP module. Applicationsshould use the IPC component which takes care of wiring the necessarycomponents. The stack offers the UDPClient interface to applicationwishing to exchange UDP datagrams. Replying to ICMP echo requests isdone by the 6lowpan stack.The stack support two IPv6 addresses: * a global address * a link-local addressThe link-local address is assigned using an interface identifiercomputed from the Active Message address of the mote. This is almostlike the stateless autoconfiguration, but Duplicate Address Detectionor Router Solicitations are not implemented.The global address can be set manually withIPC.setAddress(). Alternatively, only the prefix of the global addresscan be set with IPC.setAddressAutoconf() and the suffix will begenerated from the Active Message address of the mote.A sample application using the 6lowpan stack is in apps/6lowpancli.USAGE - PCTo interact with a 6lowpan mote from a PC, a mote flashed with theBaseStation application (apps/BaseStation) has to be attached to thePC. Note that the application has to be built with CFLAGS += -D'TOSH_DATA_LENGTH=102'.Furthermore, the serial_tun daemon (support/sdk/c/6lowpan/serial_tun/)has to run on the PC.Afterwards, ping6 and nc6 should work for talking to the motes.Debugging output with printf over USB can be enabled with CFLAGS="-D'ENABLE_PRINTF_DEBUG=1'To minimize memory usage, i.e. disable everything (at the moment onlythe UDP cli) to determine minimum RAM/ROM requirements, use CFLAGS="-D'MINIMIZE_MEMORY=1'
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -