6LoWPAN-api

Version 5 (6lowpan group from 18-748 -, 05/05/2010 11:41 pm)

1 1 6lowpan group from 18-748 -
= Nano-RK 6LoWPAN API =
2 1 6lowpan group from 18-748 -
3 5 6lowpan group from 18-748 -
For more information on 6LoWPAN, refer to [wiki:6LoWPAN 6LoWPAN].
4 5 6lowpan group from 18-748 -
5 5 6lowpan group from 18-748 -
For 6LoWPAN installation instructions, please refer to [wiki:6LoWPAN-installation].
6 5 6lowpan group from 18-748 -
7 1 6lowpan group from 18-748 -
 * '''void _6lp_task_config ()'''
8 1 6lowpan group from 18-748 -
    * This function configures 6LoWPAN and starts up the necessary tasks.  This should be called before Nano-RK starts up.
9 1 6lowpan group from 18-748 -
10 1 6lowpan group from 18-748 -
 * '''int8_t _6lp_init(uint8_t chan)'''
11 1 6lowpan group from 18-748 -
    * This function starts 6LoWPAN.  ''chan'' refers to the radio channel that packets will be sent on. Returns 1 upon success, -1 otherwise.
12 2 6lowpan group from 18-748 -
13 2 6lowpan group from 18-748 -
 * '''int8_t udp_socket()'''
14 3 6lowpan group from 18-748 -
    * This function creates a new UDP socket and returns a descriptor for the socket.
15 2 6lowpan group from 18-748 -
16 4 6lowpan group from 18-748 -
 * '''int8_t udp_bind(int8_t sock_num, int16_t port)'''
17 2 6lowpan group from 18-748 -
    * This function binds a created socket with a given port and the current node's IPv6 address.  Currently there is only support for a single IPv6 address per node.
18 2 6lowpan group from 18-748 -
19 1 6lowpan group from 18-748 -
 * '''int8_t udp_send(int8_t sock_num, struct pkt_buff *pktb, int8_t len, struct ipv6_addr *dest_addr, int16_t dest_port)'''
20 5 6lowpan group from 18-748 -
    * This function transmits a UDP packet over the internet.  ''pktb'' refers to the packet structure to be sent.  ''len'' is the length of the UDP payload (does NOT include headers).  ''dest_addr'' and ''dest_port'' are the destination address and destination port respectively.
21 1 6lowpan group from 18-748 -
22 2 6lowpan group from 18-748 -
 * '''int8_t udp_receive(int8_t sock_num, struct pkt_buff *pktb)'''
23 5 6lowpan group from 18-748 -
    * This function blocks until a packet is sent to the port assigned to ''sock_num''.  Once the function returns the received IPv6 packet would be stored in the ''pktb'' structure.
24 2 6lowpan group from 18-748 -
25 2 6lowpan group from 18-748 -
 * '''int8_t udp_release(int8_t sock_num)'''
26 5 6lowpan group from 18-748 -
    * This function unbinds a socket and releases all resources associated with it.