ieee802154_device.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /************************************************************************************
  2. * include/nuttx/wireless/ieee802154/ieee802154_device.h
  3. * IEEE802.15.4 character driver
  4. *
  5. * Copyright (C) 2017 Gregory Nutt. All rights reserved.
  6. * Author: Gregory Nutt
  7. *
  8. * Redistribution and use in source and binary forms, with or without
  9. * modification, are permitted provided that the following conditions
  10. * are met:
  11. *
  12. * 1. Redistributions of source code must retain the above copyright
  13. * notice, this list of conditions and the following disclaimer.
  14. * 2. Redistributions in binary form must reproduce the above copyright
  15. * notice, this list of conditions and the following disclaimer in
  16. * the documentation and/or other materials provided with the
  17. * distribution.
  18. * 3. Neither the name NuttX nor the names of its contributors may be
  19. * used to endorse or promote products derived from this software
  20. * without specific prior written permission.
  21. *
  22. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  23. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  24. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  25. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  26. * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  27. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  28. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  29. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  30. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  31. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  32. * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  33. * POSSIBILITY OF SUCH DAMAGE.
  34. *
  35. ************************************************************************************/
  36. #ifndef __INCLUDE_NUTTX_WIRELESS_IEEE802154_IEEE802154_DEVICE_H
  37. #define __INCLUDE_NUTTX_WIRELESS_IEEE802154_IEEE802154_DEVICE_H
  38. /************************************************************************************
  39. * Included Files
  40. ************************************************************************************/
  41. #include <nuttx/config.h>
  42. #include <nuttx/wireless/ioctl.h>
  43. #include <nuttx/wireless/ieee802154/ieee802154_mac.h>
  44. #ifdef CONFIG_WIRELESS_IEEE802154
  45. /************************************************************************************
  46. * Pre-processor Definitions
  47. ************************************************************************************/
  48. /************************************************************************************
  49. * Public Types
  50. ************************************************************************************/
  51. struct mac802154dev_txframe_s
  52. {
  53. struct ieee802154_frame_meta_s meta;
  54. FAR uint8_t *payload;
  55. uint16_t length;
  56. };
  57. struct mac802154dev_rxframe_s
  58. {
  59. struct ieee802154_data_ind_s meta;
  60. uint8_t payload[IEEE802154_MAX_PHY_PACKET_SIZE];
  61. uint8_t length;
  62. /* In promiscuous mode, the entire frame is passed to the application inside
  63. * the payload field. The offset field is used to specify the start of the
  64. * actual payload, skipping the 802.15.4 header.
  65. */
  66. uint8_t offset;
  67. };
  68. #endif /* CONFIG_WIRELESS_IEEE802154 */
  69. #endif /* __INCLUDE_NUTTX_WIRELESS_IEEE802154_IEEE802154_DEVICE_H */