Macros | Functions
slip.c File Reference

    Alternative implementation for SLIP:

#include "contiki.h"
#include <MicroInt.h>
#include "net/ipv6/uip.h"
#include "dev/slip.h"
#include "dev/uart0.h"

Go to the source code of this file.


#define ATOMIC(blah)
 A block of code may be made atomic by wrapping it with this macro. More...


void slip_set_input_callback (void(*c)(void))
 Set a function to be called when there is activity on the SLIP interface; used for detecting if a node is a gateway node.
void slip_write (const void *_ptr, int len)
 Send using SLIP len bytes starting from the location pointed to by ptr.
void slip_send (void)
 Send an IP packet from the uIP buffer with SLIP.
int slip_input_byte (unsigned char c)
 Input a SLIP byte. More...

Detailed Description

    Alternative implementation for SLIP:
  1. Accepts more than two packet
  2. Disables UART rx interrupt when buffer is full (thus invoking flow control if configured)
    Niklas Finne Beshr Al Nahas

Definition in file slip.c.

Macro Definition Documentation


#define ATOMIC (   blah)
{ \
{ blah } \

A block of code may be made atomic by wrapping it with this macro.

Something which is atomic cannot be interrupted by interrupts.

Definition at line 88 of file slip.c.

Function Documentation

◆ slip_input_byte()

int slip_input_byte ( unsigned char  c)

Input a SLIP byte.

This function is called by the RS232/SIO device driver to pass incoming bytes to the SLIP driver. The function can be called from an interrupt context.

For systems using low-power CPU modes, the return value of the function can be used to determine if the CPU should be woken up or not. If the function returns non-zero, the CPU should be powered up. If the function returns zero, the CPU can continue to be powered down.

cThe data that is to be passed to the SLIP driver
Non-zero if the CPU should be powered up, zero otherwise.

Definition at line 351 of file slip.c.

Referenced by slip_arch_init().