Contiki 3.x
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  */
32 /**
33  * \addtogroup rf230mac
34  * \{
35  */
36 
37 /**
38  * \file
39  * \brief Example glue code between the existing MAC code and the
40  * Contiki mac interface
41  *
42  * \author
43  * Mike Vidales <mavida404@gmail.com>
44  *
45  * \ingroup ieee_15_4
46  *
47  */
48 
49 #ifndef IEEEMANAGER_H_
50 #define IEEEMANAGER_H_
51 
52 /** \brief The interface structure for the 802.15.4 quasi-MAC. */
53 typedef struct ieee_15_4_manager{
54  /** Turn the MAC layer on. */
55  int (* wake)(void);
56  /** Turn the MAC layer off. */
57  int (* sleep)(void);
58 
59  /** Set the operating channel. */
60  void (* set_channel)(int channel);
61  /** Get the operating channel. */
62  int (* get_channel)(void);
63 
64  /** Set the Destination PAN_ID. */
65  void (* set_dst_panid)(int panid);
66  /** Get the Destination PAN_ID. */
67  int (* get_dst_panid)(void);
68 
69  /** Set the Source PAN_ID. */
70  void (* set_src_panid)(int panid);
71  /** Get the Source PAN_ID. */
72  int (* get_src_panid)(void);
73 
74  /** Set the Automatic TRX modes. */
75  void (* set_auto_mode)(bool mode);
76  /** Get the current state of Automatic TRX modes. */
77  bool (* get_auto_mode)(void);
78 
79  /** Set the Long Address. */
80  void (* set_long_addr)(uint64_t address);
81  /** Get the Long Address. */
82  uint64_t (* get_long_addr)(void);
83 
84  /** Set the Short Address. */
85  void (* set_short_addr)(int address);
86  /** Get the short Address. */
87  int (* get_short_addr)(void);
88 
89  /** Set the iAmCoord bit. */
90  void (* set_iamcoord_bit)(bool iamcoord);
91  /** Get the iAmCoord bit. */
92  bool (* get_iamcoord_bit)(void);
93 
94  /** Set the Coordinator Long address. */
95  void (* set_coord_long_addr)(uint64_t address);
96  /** Get the Coordinator Long address. */
97  uint64_t (* get_coord_long_addr)(void);
98 
99  /** Set the Coordinator Long address. */
100  void (* set_coord_short_addr)(int address);
101  /** Get the Coordinator Long address. */
102  int (* get_coord_short_addr)(void);
103 
104  /** Set the Destination address. */
105  void (* set_dest_long_addr)(uint64_t address);
106  /** Get the Destination address. */
107  uint64_t (* get_dest_long_addr)(void);
109 
110 
111 void ieee_15_4_init(struct ieee_15_4_manager *pieee_15_4_manager);
112 
113 #endif /* IEEEMANAGER_H_ */
114 /** \} */
int(* get_src_panid)(void)
Get the Source PAN_ID.
int(* get_coord_short_addr)(void)
Get the Coordinator Long address.
void(* set_long_addr)(uint64_t address)
Set the Long Address.
int(* get_dst_panid)(void)
Get the Destination PAN_ID.
uint64_t(* get_long_addr)(void)
Get the Long Address.
int(* sleep)(void)
Turn the MAC layer off.
void(* set_dest_long_addr)(uint64_t address)
Set the Destination address.
void(* set_src_panid)(int panid)
Set the Source PAN_ID.
The interface structure for the 802.15.4 quasi-MAC.
void ieee_15_4_init(ieee_15_4_manager_t *pieee_15_4_manager)
initializes the 802.15.4 manager layer.
uint64_t(* get_dest_long_addr)(void)
Get the Destination address.
void(* set_short_addr)(int address)
Set the Short Address.
void(* set_auto_mode)(bool mode)
Set the Automatic TRX modes.
uint64_t(* get_coord_long_addr)(void)
Get the Coordinator Long address.
void(* set_iamcoord_bit)(bool iamcoord)
Set the iAmCoord bit.
void(* set_dst_panid)(int panid)
Set the Destination PAN_ID.
void(* set_coord_short_addr)(int address)
Set the Coordinator Long address.
struct ieee_15_4_manager ieee_15_4_manager_t
The interface structure for the 802.15.4 quasi-MAC.
bool(* get_iamcoord_bit)(void)
Get the iAmCoord bit.
bool(* get_auto_mode)(void)
Get the current state of Automatic TRX modes.
int(* get_channel)(void)
Get the operating channel.
void(* set_channel)(int channel)
Set the operating channel.
int(* get_short_addr)(void)
Get the short Address.
void(* set_coord_long_addr)(uint64_t address)
Set the Coordinator Long address.
int(* wake)(void)
Turn the MAC layer on.