HomePlugHeader.c 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*====================================================================*
  2. *
  3. * Copyright (c) 2013 Qualcomm Atheros, Inc.
  4. *
  5. * All rights reserved.
  6. *
  7. *====================================================================*/
  8. /*====================================================================*
  9. *
  10. * signed HomePlugHeader (struct homeplug_hdr * header, uint8_t MMV, uint16_t MMTYPE);
  11. *
  12. * mme.h
  13. *
  14. * encode memory with a standard HomePlug AV header having HomePlug
  15. * protocol version (HOMEPLUG_MMV) and HomePlug message type (MMTYPE);
  16. * return the number of bytes actually encoded;
  17. *
  18. * Contributor(s):
  19. * Charles Maier <cmaier@qca.qualcomm.com>
  20. *
  21. *--------------------------------------------------------------------*/
  22. #ifndef HOMEPLUGHEADER_SOURCE
  23. #define HOMEPLUGHEADER_SOURCE
  24. #include <stdint.h>
  25. #include "../mme/mme.h"
  26. #include "../tools/endian.h"
  27. signed HomePlugHeader (struct homeplug_hdr * header, uint8_t MMV, uint16_t MMTYPE)
  28. {
  29. header->MMV = MMV;
  30. header->MMTYPE = HTOLE16 (MMTYPE);
  31. return (sizeof (* header));
  32. }
  33. #endif