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) 2010 Network Security Lab, University of Washington, Seattle. | 3 * Copyright (c) 2010 Network Security Lab, University of Washington, Seattle. |
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 |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 /** | 348 /** |
349 * \brief Changes state of the WifiRadioEnergyMode. | 349 * \brief Changes state of the WifiRadioEnergyMode. |
350 * | 350 * |
351 * \param newState New state the wifi radio is in. | 351 * \param newState New state the wifi radio is in. |
352 * | 352 * |
353 * Implements DeviceEnergyModel::ChangeState. | 353 * Implements DeviceEnergyModel::ChangeState. |
354 */ | 354 */ |
355 void ChangeState (int newState); | 355 void ChangeState (int newState); |
356 | 356 |
357 /** | 357 /** |
| 358 * \param state the wifi state |
| 359 * |
| 360 * \returns the time the radio can stay in that state based on the remaining e
nergy. |
| 361 */ |
| 362 Time GetMaximumTimeInState (int state) const; |
| 363 |
| 364 /** |
358 * \brief Handles energy depletion. | 365 * \brief Handles energy depletion. |
359 * | 366 * |
360 * Implements DeviceEnergyModel::HandleEnergyDepletion | 367 * Implements DeviceEnergyModel::HandleEnergyDepletion |
361 */ | 368 */ |
362 void HandleEnergyDepletion (void); | 369 void HandleEnergyDepletion (void); |
363 | 370 |
364 /** | 371 /** |
365 * \brief Handles energy recharged. | 372 * \brief Handles energy recharged. |
366 * | 373 * |
367 * Implements DeviceEnergyModel::HandleEnergyRecharged | 374 * Implements DeviceEnergyModel::HandleEnergyRecharged |
368 */ | 375 */ |
369 void HandleEnergyRecharged (void); | 376 void HandleEnergyRecharged (void); |
370 | 377 |
371 /** | 378 /** |
| 379 * \brief Handles energy changed. |
| 380 * |
| 381 * Implements DeviceEnergyModel::HandleEnergyChanged |
| 382 */ |
| 383 void HandleEnergyChanged (void); |
| 384 |
| 385 /** |
372 * \returns Pointer to the PHY listener. | 386 * \returns Pointer to the PHY listener. |
373 */ | 387 */ |
374 WifiRadioEnergyModelPhyListener * GetPhyListener (void); | 388 WifiRadioEnergyModelPhyListener * GetPhyListener (void); |
375 | 389 |
376 | 390 |
377 private: | 391 private: |
378 void DoDispose (void); | 392 void DoDispose (void); |
379 | 393 |
380 /** | 394 /** |
381 * \returns Current draw of device, at current state. | 395 * \returns Current draw of device, at current state. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 uint8_t m_nPendingChangeState; ///< pending state change | 427 uint8_t m_nPendingChangeState; ///< pending state change |
414 | 428 |
415 /// Energy depletion callback | 429 /// Energy depletion callback |
416 WifiRadioEnergyDepletionCallback m_energyDepletionCallback; | 430 WifiRadioEnergyDepletionCallback m_energyDepletionCallback; |
417 | 431 |
418 /// Energy recharged callback | 432 /// Energy recharged callback |
419 WifiRadioEnergyRechargedCallback m_energyRechargedCallback; | 433 WifiRadioEnergyRechargedCallback m_energyRechargedCallback; |
420 | 434 |
421 /// WifiPhy listener | 435 /// WifiPhy listener |
422 WifiRadioEnergyModelPhyListener *m_listener; | 436 WifiRadioEnergyModelPhyListener *m_listener; |
| 437 |
| 438 EventId m_switchToOffEvent; ///< switch to off event |
423 }; | 439 }; |
424 | 440 |
425 } // namespace ns3 | 441 } // namespace ns3 |
426 | 442 |
427 #endif /* WIFI_RADIO_ENERGY_MODEL_H */ | 443 #endif /* WIFI_RADIO_ENERGY_MODEL_H */ |
OLD | NEW |