irda_nec_spec.c 853 B

12345678910111213141516171819202122232425262728
  1. #include "../irda_i.h"
  2. #include "irda_protocol_defs_i.h"
  3. static const IrdaProtocolSpecification irda_nec_protocol_specification = {
  4. .name = "NEC",
  5. .address_length = 8,
  6. .command_length = 8,
  7. .frequency = IRDA_COMMON_CARRIER_FREQUENCY,
  8. .duty_cycle = IRDA_COMMON_DUTY_CYCLE,
  9. };
  10. static const IrdaProtocolSpecification irda_necext_protocol_specification = {
  11. .name = "NECext",
  12. .address_length = 16,
  13. .command_length = 8,
  14. .frequency = IRDA_COMMON_CARRIER_FREQUENCY,
  15. .duty_cycle = IRDA_COMMON_DUTY_CYCLE,
  16. };
  17. const IrdaProtocolSpecification* irda_nec_get_spec(IrdaProtocol protocol) {
  18. if (protocol == IrdaProtocolNEC)
  19. return &irda_nec_protocol_specification;
  20. else if (protocol == IrdaProtocolNECext)
  21. return &irda_necext_protocol_specification;
  22. else
  23. return NULL;
  24. }