HomePlugHeader1.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*====================================================================*
  2. *
  3. * Copyright (c) 2013 Qualcomm Atheros, Inc.
  4. *
  5. * All rights reserved.
  6. *
  7. *====================================================================*/
  8. /*====================================================================*
  9. *
  10. * signed HomePlugHeader1 (struct homeplug_fmi * 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 HOMEPLUGHEADER1_SOURCE
  23. #define HOMEPLUGHEADER1_SOURCE
  24. #include <stdint.h>
  25. #include "../mme/mme.h"
  26. #include "../tools/endian.h"
  27. signed HomePlugHeader1 (struct homeplug_fmi * header, uint8_t MMV, uint16_t MMTYPE)
  28. {
  29. header->MMV = MMV;
  30. header->MMTYPE = HTOLE16 (MMTYPE);
  31. header->FMSN = 0;
  32. header->FMID = 0;
  33. return (sizeof (* header));
  34. }
  35. #endif