OLD | NEW |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2011 The Boeing Company | 3 * Copyright (c) 2011 The Boeing Company |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU General Public License | 14 * You should have received a copy of the GNU General Public License |
15 * along with this program; if not, write to the Free Software | 15 * along with this program; if not, write to the Free Software |
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
17 * | 17 * |
18 * Author: | 18 * Author: |
19 * Tom Henderson <thomas.r.henderson@boeing.com> | 19 * Tom Henderson <thomas.r.henderson@boeing.com> |
20 * Tommaso Pecorella <tommaso.pecorella@unifi.it> | 20 * Tommaso Pecorella <tommaso.pecorella@unifi.it> |
21 * Margherita Filippetti <morag87@gmail.com> | 21 * Margherita Filippetti <morag87@gmail.com> |
| 22 * Peter Kourzanov <peter.kourzanov@gmail.com> |
22 */ | 23 */ |
23 #ifndef LR_WPAN_TSCH_NET_DEVICE_H | 24 #ifndef LR_WPAN_TSCH_NET_DEVICE_H |
24 #define LR_WPAN_TSCH_NET_DEVICE_H | 25 #define LR_WPAN_TSCH_NET_DEVICE_H |
25 | 26 |
26 #include <ns3/net-device.h> | 27 #include <ns3/net-device.h> |
27 #include <ns3/traced-callback.h> | 28 #include <ns3/traced-callback.h> |
28 #include <ns3/lr-wpan-tsch-mac.h> | 29 #include <ns3/lr-wpan-tsch-mac.h> |
29 | 30 |
30 namespace ns3 { | 31 namespace ns3 { |
31 | 32 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 * | 87 * |
87 * \param channel the channel to be used | 88 * \param channel the channel to be used |
88 */ | 89 */ |
89 void SetChannel (Ptr<SpectrumChannel> channel); | 90 void SetChannel (Ptr<SpectrumChannel> channel); |
90 | 91 |
91 /** | 92 /** |
92 * Get the MAC used by this NetDevice. | 93 * Get the MAC used by this NetDevice. |
93 * | 94 * |
94 * \return the MAC object | 95 * \return the MAC object |
95 */ | 96 */ |
96 Ptr<LrWpanTschMac> GetMac (void) const; | 97 Ptr<LrWpanMac> GetMac (void) const; |
| 98 Ptr<LrWpanTschMac> GetNMac (void) const; |
| 99 Ptr<LrWpanMac> GetOMac (void) const; |
97 | 100 |
98 /** | 101 /** |
99 * Get the PHY used by this NetDevice. | 102 * Get the PHY used by this NetDevice. |
100 * | 103 * |
101 * \return the PHY object | 104 * \return the PHY object |
102 */ | 105 */ |
103 Ptr<LrWpanPhy> GetPhy (void) const; | 106 Ptr<LrWpanPhy> GetPhy (void) const; |
104 | 107 |
105 /** | 108 /** |
106 * Get the CSMA/CA implementation used by this NetDevice. | 109 * Get the CSMA/CA implementation used by this NetDevice. |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 * \param TSCH MAC link status | 177 * \param TSCH MAC link status |
175 */ | 178 */ |
176 void LinkConfirm (MlmeSetLinkConfirmParams params); | 179 void LinkConfirm (MlmeSetLinkConfirmParams params); |
177 | 180 |
178 /** | 181 /** |
179 * Show the setted TSCH mode status | 182 * Show the setted TSCH mode status |
180 * \param TSCH mode status | 183 * \param TSCH mode status |
181 */ | 184 */ |
182 void ModeConfirm (MlmeTschModeConfirmParams params); | 185 void ModeConfirm (MlmeTschModeConfirmParams params); |
183 | 186 |
| 187 void SetTschMode(bool enable); |
184 private: | 188 private: |
185 // Inherited from NetDevice/Object | 189 // Inherited from NetDevice/Object |
186 virtual void DoDispose (void); | 190 virtual void DoDispose (void); |
187 virtual void DoInitialize (void); | 191 virtual void DoInitialize (void); |
188 | 192 |
189 /** | 193 /** |
190 * Mark NetDevice link as up. | 194 * Mark NetDevice link as up. |
191 */ | 195 */ |
192 void LinkUp (void); | 196 void LinkUp (void); |
193 | 197 |
194 /** | 198 /** |
195 * Mark NetDevice link as down. | 199 * Mark NetDevice link as down. |
196 */ | 200 */ |
197 void LinkDown (void); | 201 void LinkDown (void); |
198 | 202 |
199 /** | 203 /** |
200 * Attribute accessor method for the "Channel" attribute. | 204 * Attribute accessor method for the "Channel" attribute. |
201 * | 205 * |
202 * \return the channel to which this NetDevice is attached | 206 * \return the channel to which this NetDevice is attached |
203 */ | 207 */ |
204 Ptr<SpectrumChannel> DoGetChannel (void) const; | 208 Ptr<SpectrumChannel> DoGetChannel (void) const; |
205 | 209 |
206 /** | 210 /** |
207 * Configure PHY, MAC and CSMA/CA. | 211 * Configure PHY, MAC and CSMA/CA. |
208 */ | 212 */ |
209 void CompleteConfig (void); | 213 void CompleteConfig (void); |
210 | 214 |
| 215 int m_isTsch; |
211 /** | 216 /** |
212 * The TSCH MAC for this NetDevice. | 217 * The TSCH MAC for this NetDevice. |
213 */ | 218 */ |
214 Ptr<LrWpanTschMac> m_mac; | 219 Ptr<LrWpanTschMac> m_mac; |
215 | 220 |
216 /** | 221 /** |
217 * The MAC for this NetDevice. | 222 * The standard MAC for this NetDevice. |
218 */ | 223 */ |
219 Ptr<LrWpanMac> m_omac; | 224 Ptr<LrWpanMac> m_omac; |
220 | 225 |
221 /** | 226 /** |
222 * The PHY for this NetDevice. | 227 * The PHY for this NetDevice. |
223 */ | 228 */ |
224 Ptr<LrWpanPhy> m_phy; | 229 Ptr<LrWpanPhy> m_phy; |
225 | 230 |
226 /** | 231 /** |
227 * The CSMA/CA implementation for this NetDevice. | 232 * The CSMA/CA implementation for this NetDevice. |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 | 267 |
263 /** | 268 /** |
264 * Upper layer callback used for notification of new data packet arrivals. | 269 * Upper layer callback used for notification of new data packet arrivals. |
265 */ | 270 */ |
266 ReceiveCallback m_receiveCallback; | 271 ReceiveCallback m_receiveCallback; |
267 }; | 272 }; |
268 | 273 |
269 } // namespace ns3 | 274 } // namespace ns3 |
270 | 275 |
271 #endif /* LR_WPAN_NET_DEVICE_H */ | 276 #endif /* LR_WPAN_NET_DEVICE_H */ |
OLD | NEW |