Contiki 3.x
slipdev.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2001, Adam Dunkels.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * 3. The name of the author may not be used to endorse or promote
14  * products derived from this software without specific prior
15  * written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
18  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
21  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
23  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28  *
29  * This file is part of the uIP TCP/IP stack.
30  *
31  *
32  */
33 
34 /**
35  * \file
36  * SLIP header file.
37  * \author Adam Dunkels <adam@dunkels.com>
38  */
39 
40 /**
41  * \addtogroup slip
42  * @{
43  */
44 
45 #ifndef SLIPDEV_H_
46 #define SLIPDEV_H_
47 
48 #include "uip.h"
49 
50 /**
51  * Put a character on the serial device.
52  *
53  * This function is used by the SLIP implementation to put a character
54  * on the serial device. It must be implemented specifically for the
55  * system on which the SLIP implementation is to be run.
56  *
57  * \param c The character to be put on the serial device.
58  */
59 void slipdev_char_put(uint8_t c);
60 
61 /**
62  * Poll the serial device for a character.
63  *
64  * This function is used by the SLIP implementation to poll the serial
65  * device for a character. It must be implemented specifically for the
66  * system on which the SLIP implementation is to be run.
67  *
68  * The function should return immediately regardless if a character is
69  * available or not. If a character is available it should be placed
70  * at the memory location pointed to by the pointer supplied by the
71  * argument c.
72  *
73  * \param c A pointer to a byte that is filled in by the function with
74  * the received character, if available.
75  *
76  * \retval 0 If no character is available.
77  * \retval Non-zero If a character is available.
78  */
79 uint8_t slipdev_char_poll(uint8_t *c);
80 
81 void slipdev_init(void);
82 uint8_t slipdev_send(void);
83 uint16_t slipdev_poll(void);
84 
85 #endif /* SLIPDEV_H_ */
86 
87 /** @} */
void slipdev_init(void)
Initialize the SLIP module.
Definition: slipdev.c:199
Header file for the uIP TCP/IP stack.
void slipdev_char_put(uint8_t c)
Put a character on the serial device.
uint8_t slipdev_send(void)
Send the packet in the uip_buf and uip_appdata buffers using the SLIP protocol.
Definition: slipdev.c:95
uint8_t slipdev_char_poll(uint8_t *c)
Poll the serial device for a character.
uint16_t slipdev_poll(void)
Poll the SLIP device for an available packet.
Definition: slipdev.c:142