Contiki 2.5
ieee-15-4-manager.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008, Swedish Institute of Computer Science.
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. Neither the name of the Institute nor the names of its contributors
14  * may be used to endorse or promote products derived from this software
15  * without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
18  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
21  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27  * SUCH DAMAGE.
28  *
29  * This file is part of the Contiki operating system.
30  *
31  * $Id: ieee-15-4-manager.h,v 1.2 2008/10/14 18:38:09 c_oflynn Exp $
32  */
33 /**
34  * \addtogroup rf230mac
35  * \{
36  */
37 
38 /**
39  * \file
40  * \brief Example glue code between the existing MAC code and the
41  * Contiki mac interface
42  *
43  * \author
44  * Mike Vidales <mavida404@gmail.com>
45  *
46  * \ingroup ieee_15_4
47  *
48  */
49 
50 #ifndef __IEEEMANAGER_H__
51 #define __IEEEMANAGER_H__
52 
53 /** \brief The interface structure for the 802.15.4 quasi-MAC. */
54 typedef struct ieee_15_4_manager{
55  /** Turn the MAC layer on. */
56  int (* wake)(void);
57  /** Turn the MAC layer off. */
58  int (* sleep)(void);
59 
60  /** Set the operating channel. */
61  void (* set_channel)(int channel);
62  /** Get the operating channel. */
63  int (* get_channel)(void);
64 
65  /** Set the Destination PAN_ID. */
66  void (* set_dst_panid)(int panid);
67  /** Get the Destination PAN_ID. */
68  int (* get_dst_panid)(void);
69 
70  /** Set the Source PAN_ID. */
71  void (* set_src_panid)(int panid);
72  /** Get the Source PAN_ID. */
73  int (* get_src_panid)(void);
74 
75  /** Set the Automatic TRX modes. */
76  void (* set_auto_mode)(bool mode);
77  /** Get the current state of Automatic TRX modes. */
78  bool (* get_auto_mode)(void);
79 
80  /** Set the Long Address. */
81  void (* set_long_addr)(uint64_t address);
82  /** Get the Long Address. */
83  uint64_t (* get_long_addr)(void);
84 
85  /** Set the Short Address. */
86  void (* set_short_addr)(int address);
87  /** Get the short Address. */
88  int (* get_short_addr)(void);
89 
90  /** Set the iAmCoord bit. */
91  void (* set_iamcoord_bit)(bool iamcoord);
92  /** Get the iAmCoord bit. */
93  bool (* get_iamcoord_bit)(void);
94 
95  /** Set the Coordinator Long address. */
96  void (* set_coord_long_addr)(uint64_t address);
97  /** Get the Coordinator Long address. */
98  uint64_t (* get_coord_long_addr)(void);
99 
100  /** Set the Coordinator Long address. */
101  void (* set_coord_short_addr)(int address);
102  /** Get the Coordinator Long address. */
103  int (* get_coord_short_addr)(void);
104 
105  /** Set the Destination address. */
106  void (* set_dest_long_addr)(uint64_t address);
107  /** Get the Destination address. */
108  uint64_t (* get_dest_long_addr)(void);
110 
111 
112 void ieee_15_4_init(struct ieee_15_4_manager *pieee_15_4_manager);
113 
114 #endif /* __IEEEMANAGER_H__ */
115 /** \} */