OpenWSN Firmware
openwsn.h File Reference
#include <stdint.h>
#include "toolchain_defs.h"
#include "board_info.h"

Go to the source code of this file.

Data Structures

struct  asn_t
 
struct  open_addr_t
 
struct  OpenQueueEntry_t
 

Macros

#define OPENWSN_VERSION_MAJOR   1
 
#define OPENWSN_VERSION_MINOR   4
 
#define OPENWSN_VERSION_PATCH   1
 
#define FLOW_LABEL_RPL_DOMAIN   1
 
#define TRUE   1
 
#define FALSE   0
 
#define LENGTH_ADDR16b   2
 
#define LENGTH_ADDR64b   8
 
#define LENGTH_ADDR128b   16
 

Typedefs

typedef uint16_t errorparameter_t
 
typedef uint16_t dagrank_t
 
typedef uint8_t owerror_t
 

Enumerations

enum  { E_SUCCESS = 0, E_FAIL = 1 }
 
enum  {
  ADDR_NONE = 0, ADDR_16B = 1, ADDR_64B = 2, ADDR_128B = 3,
  ADDR_PANID = 4, ADDR_PREFIX = 5, ADDR_ANYCAST = 6
}
 
enum  { OW_LITTLE_ENDIAN = TRUE, OW_BIG_ENDIAN = FALSE }
 
enum  {
  IANA_IPv6HOPOPT = 0x00, IANA_TCP = 0x06, IANA_UDP = 0x11, IANA_IPv6ROUTE = 0x2b,
  IANA_ICMPv6 = 0x3a, IANA_ICMPv6_ECHO_REQUEST = 128, IANA_ICMPv6_ECHO_REPLY = 129, IANA_ICMPv6_RS = 133,
  IANA_ICMPv6_RA = 134, IANA_ICMPv6_RA_PREFIX_INFORMATION = 3, IANA_ICMPv6_RPL = 155, IANA_ICMPv6_RPL_DIO = 0x01,
  IANA_ICMPv6_RPL_DAO = 0x02, IANA_RSVP = 46, IANA_UNDEFINED = 250
}
 
enum  {
  WKP_TCP_HTTP = 80, WKP_TCP_ECHO = 7, WKP_TCP_INJECT = 2188, WKP_TCP_DISCARD = 9,
  WKP_UDP_COAP = 5683, WKP_UDP_HELI = 2192, WKP_UDP_IMU = 2190, WKP_UDP_ECHO = 7,
  WKP_UDP_INJECT = 2188, WKP_UDP_DISCARD = 9, WKP_UDP_RAND = 61000, WKP_UDP_LATENCY = 61001
}
 
enum  {
  STATUS_ISSYNC = 0, STATUS_ID = 1, STATUS_DAGRANK = 2, STATUS_OUTBUFFERINDEXES = 3,
  STATUS_ASN = 4, STATUS_MACSTATS = 5, STATUS_SCHEDULE = 6, STATUS_BACKOFF = 7,
  STATUS_QUEUE = 8, STATUS_NEIGHBORS = 9, STATUS_KAPERIOD = 10, STATUS_MAX = 11
}
 
enum  {
  COMPONENT_NULL = 0x00, COMPONENT_OPENWSN = 0x01, COMPONENT_IDMANAGER = 0x02, COMPONENT_OPENQUEUE = 0x03,
  COMPONENT_OPENSERIAL = 0x04, COMPONENT_PACKETFUNCTIONS = 0x05, COMPONENT_RANDOM = 0x06, COMPONENT_RADIO = 0x07,
  COMPONENT_IEEE802154 = 0x08, COMPONENT_IEEE802154E = 0x09, COMPONENT_SIXTOP_TO_IEEE802154E = 0x0a, COMPONENT_IEEE802154E_TO_SIXTOP = 0x0b,
  COMPONENT_SIXTOP = 0x0c, COMPONENT_NEIGHBORS = 0x0d, COMPONENT_SCHEDULE = 0x0e, COMPONENT_SIXTOP_RES = 0x0f,
  COMPONENT_OPENBRIDGE = 0x10, COMPONENT_IPHC = 0x11, COMPONENT_FORWARDING = 0x12, COMPONENT_ICMPv6 = 0x13,
  COMPONENT_ICMPv6ECHO = 0x14, COMPONENT_ICMPv6ROUTER = 0x15, COMPONENT_ICMPv6RPL = 0x16, COMPONENT_OPENTCP = 0x17,
  COMPONENT_OPENUDP = 0x18, COMPONENT_OPENCOAP = 0x19, COMPONENT_TCPECHO = 0x1a, COMPONENT_TCPINJECT = 0x1b,
  COMPONENT_TCPPRINT = 0x1c, COMPONENT_UDPECHO = 0x1d, COMPONENT_UDPINJECT = 0x1e, COMPONENT_UDPPRINT = 0x1f,
  COMPONENT_RSVP = 0x20, COMPONENT_OHLONE = 0x21, COMPONENT_HELI = 0x22, COMPONENT_IMU = 0x23,
  COMPONENT_RLEDS = 0x24, COMPONENT_RREG = 0x25, COMPONENT_RWELLKNOWN = 0x26, COMPONENT_RT = 0x27,
  COMPONENT_REX = 0x28, COMPONENT_RXL1 = 0x29, COMPONENT_RINFO = 0x2a, COMPONENT_RHELI = 0x2b,
  COMPONENT_RRUBE = 0x2c, COMPONENT_LAYERDEBUG = 0x2d, COMPONENT_UDPRAND = 0x2e, COMPONENT_UDPSTORM = 0x2f,
  COMPONENT_UDPLATENCY = 0x30, COMPONENT_TEST = 0x31, COMPONENT_R6T = 0x32, COMPONENT_SWARMBAND = 0x33,
  COMPONENT_RRT = 0x34
}
 
enum  {
  ERR_RCVD_ECHO_REQUEST = 0x01, ERR_RCVD_ECHO_REPLY = 0x02, ERR_GETDATA_ASKS_TOO_FEW_BYTES = 0x03, ERR_INPUT_BUFFER_OVERFLOW = 0x04,
  ERR_COMMAND_NOT_ALLOWED = 0x05, ERR_WRONG_TRAN_PROTOCOL = 0x06, ERR_WRONG_TCP_STATE = 0x07, ERR_TCP_RESET = 0x08,
  ERR_UNSUPPORTED_PORT_NUMBER = 0x09, ERR_UNEXPECTED_DAO = 0x0a, ERR_UNSUPPORTED_ICMPV6_TYPE = 0x0b, ERR_6LOWPAN_UNSUPPORTED = 0x0c,
  ERR_NO_NEXTHOP = 0x0d, ERR_INVALID_PARAM = 0x0e, ERR_INVALID_FWDMODE = 0x0f, ERR_LARGE_DAGRANK = 0x10,
  ERR_HOP_LIMIT_REACHED = 0x11, ERR_LOOP_DETECTED = 0x12, ERR_WRONG_DIRECTION = 0x13, ERR_NEIGHBORS_FULL = 0x14,
  ERR_NO_SENT_PACKET = 0x15, ERR_NO_RECEIVED_PACKET = 0x16, ERR_SCHEDULE_OVERFLOWN = 0x17, ERR_WRONG_CELLTYPE = 0x18,
  ERR_IEEE154_UNSUPPORTED = 0x19, ERR_DESYNCHRONIZED = 0x1a, ERR_SYNCHRONIZED = 0x1b, ERR_LARGE_TIMECORRECTION = 0x1c,
  ERR_WRONG_STATE_IN_ENDFRAME_SYNC = 0x1d, ERR_WRONG_STATE_IN_STARTSLOT = 0x1e, ERR_WRONG_STATE_IN_TIMERFIRES = 0x1f, ERR_WRONG_STATE_IN_NEWSLOT = 0x20,
  ERR_WRONG_STATE_IN_ENDOFFRAME = 0x21, ERR_MAXTXDATAPREPARE_OVERFLOW = 0x22, ERR_MAXRXACKPREPARE_OVERFLOWS = 0x23, ERR_MAXRXDATAPREPARE_OVERFLOWS = 0x24,
  ERR_MAXTXACKPREPARE_OVERFLOWS = 0x25, ERR_WDDATADURATION_OVERFLOWS = 0x26, ERR_WDRADIO_OVERFLOWS = 0x27, ERR_WDRADIOTX_OVERFLOWS = 0x28,
  ERR_WDACKDURATION_OVERFLOWS = 0x29, ERR_BUSY_SENDING = 0x2a, ERR_UNEXPECTED_SENDDONE = 0x2b, ERR_NO_FREE_PACKET_BUFFER = 0x2c,
  ERR_FREEING_UNUSED = 0x2d, ERR_FREEING_ERROR = 0x2e, ERR_UNSUPPORTED_COMMAND = 0x2f, ERR_MSG_UNKNOWN_TYPE = 0x30,
  ERR_WRONG_ADDR_TYPE = 0x31, ERR_BRIDGE_MISMATCH = 0x32, ERR_HEADER_TOO_LONG = 0x33, ERR_INPUTBUFFER_LENGTH = 0x34,
  ERR_BOOTED = 0x35, ERR_INVALIDSERIALFRAME = 0x36, ERR_INVALIDPACKETFROMRADIO = 0x37, ERR_BUSY_RECEIVING = 0x38,
  ERR_WRONG_CRC_INPUT = 0x39
}
 error codes used throughout the OpenWSN stack More...
 

Functions

void openwsn_init (void)
 General OpenWSN definitions. More...
 

Macro Definition Documentation

#define FALSE   0
#define FLOW_LABEL_RPL_DOMAIN   1
#define LENGTH_ADDR128b   16
#define LENGTH_ADDR16b   2
#define LENGTH_ADDR64b   8
#define OPENWSN_VERSION_MAJOR   1
#define OPENWSN_VERSION_MINOR   4
#define OPENWSN_VERSION_PATCH   1
#define TRUE   1

Typedef Documentation

typedef uint16_t dagrank_t
typedef uint16_t errorparameter_t
typedef uint8_t owerror_t

Enumeration Type Documentation

anonymous enum
Enumerator
ADDR_NONE 
ADDR_16B 
ADDR_64B 
ADDR_128B 
ADDR_PANID 
ADDR_PREFIX 
ADDR_ANYCAST 
anonymous enum
Enumerator
OW_LITTLE_ENDIAN 
OW_BIG_ENDIAN 
anonymous enum
Enumerator
IANA_IPv6HOPOPT 
IANA_TCP 
IANA_UDP 
IANA_IPv6ROUTE 
IANA_ICMPv6 
IANA_ICMPv6_ECHO_REQUEST 
IANA_ICMPv6_ECHO_REPLY 
IANA_ICMPv6_RS 
IANA_ICMPv6_RA 
IANA_ICMPv6_RA_PREFIX_INFORMATION 
IANA_ICMPv6_RPL 
IANA_ICMPv6_RPL_DIO 
IANA_ICMPv6_RPL_DAO 
IANA_RSVP 
IANA_UNDEFINED 
anonymous enum
Enumerator
WKP_TCP_HTTP 
WKP_TCP_ECHO 
WKP_TCP_INJECT 
WKP_TCP_DISCARD 
WKP_UDP_COAP 
WKP_UDP_HELI 
WKP_UDP_IMU 
WKP_UDP_ECHO 
WKP_UDP_INJECT 
WKP_UDP_DISCARD 
WKP_UDP_RAND 
WKP_UDP_LATENCY 
anonymous enum
Enumerator
STATUS_ISSYNC 
STATUS_ID 
STATUS_DAGRANK 
STATUS_OUTBUFFERINDEXES 
STATUS_ASN 
STATUS_MACSTATS 
STATUS_SCHEDULE 
STATUS_BACKOFF 
STATUS_QUEUE 
STATUS_NEIGHBORS 
STATUS_KAPERIOD 
STATUS_MAX 
anonymous enum
Enumerator
COMPONENT_NULL 
COMPONENT_OPENWSN 
COMPONENT_IDMANAGER 
COMPONENT_OPENQUEUE 
COMPONENT_OPENSERIAL 
COMPONENT_PACKETFUNCTIONS 
COMPONENT_RANDOM 
COMPONENT_RADIO 
COMPONENT_IEEE802154 
COMPONENT_IEEE802154E 
COMPONENT_SIXTOP_TO_IEEE802154E 
COMPONENT_IEEE802154E_TO_SIXTOP 
COMPONENT_SIXTOP 
COMPONENT_NEIGHBORS 
COMPONENT_SCHEDULE 
COMPONENT_SIXTOP_RES 
COMPONENT_OPENBRIDGE 
COMPONENT_IPHC 
COMPONENT_FORWARDING 
COMPONENT_ICMPv6 
COMPONENT_ICMPv6ECHO 
COMPONENT_ICMPv6ROUTER 
COMPONENT_ICMPv6RPL 
COMPONENT_OPENTCP 
COMPONENT_OPENUDP 
COMPONENT_OPENCOAP 
COMPONENT_TCPECHO 
COMPONENT_TCPINJECT 
COMPONENT_TCPPRINT 
COMPONENT_UDPECHO 
COMPONENT_UDPINJECT 
COMPONENT_UDPPRINT 
COMPONENT_RSVP 
COMPONENT_OHLONE 
COMPONENT_HELI 
COMPONENT_IMU 
COMPONENT_RLEDS 
COMPONENT_RREG 
COMPONENT_RWELLKNOWN 
COMPONENT_RT 
COMPONENT_REX 
COMPONENT_RXL1 
COMPONENT_RINFO 
COMPONENT_RHELI 
COMPONENT_RRUBE 
COMPONENT_LAYERDEBUG 
COMPONENT_UDPRAND 
COMPONENT_UDPSTORM 
COMPONENT_UDPLATENCY 
COMPONENT_TEST 
COMPONENT_R6T 
COMPONENT_SWARMBAND 
COMPONENT_RRT 
anonymous enum

error codes used throughout the OpenWSN stack

Note
The comments are used in the Python parsing tool:
  • {0} refers to the value of the first argument,
  • {1} refers to the value of the second argument,
Enumerator
ERR_RCVD_ECHO_REQUEST 
ERR_RCVD_ECHO_REPLY 
ERR_GETDATA_ASKS_TOO_FEW_BYTES 
ERR_INPUT_BUFFER_OVERFLOW 
ERR_COMMAND_NOT_ALLOWED 
ERR_WRONG_TRAN_PROTOCOL 
ERR_WRONG_TCP_STATE 
ERR_TCP_RESET 
ERR_UNSUPPORTED_PORT_NUMBER 
ERR_UNEXPECTED_DAO 
ERR_UNSUPPORTED_ICMPV6_TYPE 
ERR_6LOWPAN_UNSUPPORTED 
ERR_NO_NEXTHOP 
ERR_INVALID_PARAM 
ERR_INVALID_FWDMODE 
ERR_LARGE_DAGRANK 
ERR_HOP_LIMIT_REACHED 
ERR_LOOP_DETECTED 
ERR_WRONG_DIRECTION 
ERR_NEIGHBORS_FULL 
ERR_NO_SENT_PACKET 
ERR_NO_RECEIVED_PACKET 
ERR_SCHEDULE_OVERFLOWN 
ERR_WRONG_CELLTYPE 
ERR_IEEE154_UNSUPPORTED 
ERR_DESYNCHRONIZED 
ERR_SYNCHRONIZED 
ERR_LARGE_TIMECORRECTION 
ERR_WRONG_STATE_IN_ENDFRAME_SYNC 
ERR_WRONG_STATE_IN_STARTSLOT 
ERR_WRONG_STATE_IN_TIMERFIRES 
ERR_WRONG_STATE_IN_NEWSLOT 
ERR_WRONG_STATE_IN_ENDOFFRAME 
ERR_MAXTXDATAPREPARE_OVERFLOW 
ERR_MAXRXACKPREPARE_OVERFLOWS 
ERR_MAXRXDATAPREPARE_OVERFLOWS 
ERR_MAXTXACKPREPARE_OVERFLOWS 
ERR_WDDATADURATION_OVERFLOWS 
ERR_WDRADIO_OVERFLOWS 
ERR_WDRADIOTX_OVERFLOWS 
ERR_WDACKDURATION_OVERFLOWS 
ERR_BUSY_SENDING 
ERR_UNEXPECTED_SENDDONE 
ERR_NO_FREE_PACKET_BUFFER 
ERR_FREEING_UNUSED 
ERR_FREEING_ERROR 
ERR_UNSUPPORTED_COMMAND 
ERR_MSG_UNKNOWN_TYPE 
ERR_WRONG_ADDR_TYPE 
ERR_BRIDGE_MISMATCH 
ERR_HEADER_TOO_LONG 
ERR_INPUTBUFFER_LENGTH 
ERR_BOOTED 
ERR_INVALIDSERIALFRAME 
ERR_INVALIDPACKETFROMRADIO 
ERR_BUSY_RECEIVING 
ERR_WRONG_CRC_INPUT 
anonymous enum
Enumerator
E_SUCCESS 
E_FAIL 

Function Documentation

void openwsn_init ( void  )

General OpenWSN definitions.

Author
Thomas Watteyne watte.nosp@m.yne@.nosp@m.eecs..nosp@m.berk.nosp@m.eley..nosp@m.edu, September 2012