« Previous - Version 5/8 (diff) - Next » - Current version
6lowpan group from 18-748 -, 05/05/2010 11:41 pm

= Nano-RK 6LoWPAN API =

For more information on 6LoWPAN, refer to [wiki:6LoWPAN 6LoWPAN].

For 6LoWPAN installation instructions, please refer to [wiki:6LoWPAN-installation].

  • '''void _6lp_task_config ()''' * This function configures 6LoWPAN and starts up the necessary tasks. This should be called before Nano-RK starts up.
  • '''int8_t _6lp_init(uint8_t chan)''' * This function starts 6LoWPAN. ''chan'' refers to the radio channel that packets will be sent on. Returns 1 upon success, -1 otherwise.
  • '''int8_t udp_socket()''' * This function creates a new UDP socket and returns a descriptor for the socket.
  • '''int8_t udp_bind(int8_t sock_num, int16_t port)''' * 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.
  • '''int8_t udp_send(int8_t sock_num, struct pkt_buff *pktb, int8_t len, struct ipv6_addr *dest_addr, int16_t dest_port)''' * 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.
  • '''int8_t udp_receive(int8_t sock_num, struct pkt_buff *pktb)''' * 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.
  • '''int8_t udp_release(int8_t sock_num)''' * This function unbinds a socket and releases all resources associated with it.