搜索
bottom↓
回复: 14

一个开源红外软解码代码:IRMP - Infrarot-Multiprotokoll-Decoder

  [复制链接]

出5入0汤圆

发表于 2020-5-4 11:24:56 | 显示全部楼层 |阅读模式
attach://512271.zip

IRMP - Infrarot-Multiprotokoll-Decoder

刚刚看有人问红外解码的代码,我想起以前测试过的一个方案,把代码撸下来放这里备份。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x

阿莫论坛20周年了!感谢大家的支持与爱护!!

月入3000的是反美的。收入3万是亲美的。收入30万是移民美国的。收入300万是取得绿卡后回国,教唆那些3000来反美的!

出5入0汤圆

 楼主| 发表于 2020-5-4 11:25:44 | 显示全部楼层


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x

出5入0汤圆

 楼主| 发表于 2020-5-4 11:27:45 | 显示全部楼层
supported protocols
Protocol        Vendor
A1TVBOX        ADB (Advanced Digital Broadcast), z.B. A1 TV Box
APPLE        Apple
ACP24        Stiebel Eltron
B&O        Bang & Olufsen
BOSE        Bose
DENON        Denon, Sharp
FAN        FAN, remote for fans
FDC        FDC Keyboard
GRUNDIG        Grundig
NOKIA        Nokia, e.g. D-Box
IR60 (SDA2008)        various european vendors
JVC        JVC
KASEIKYO        Panasonic, Technics, Denon and other japanese vendors which are members of the "Japan's Association for Electric Home Application".
KATHREIN        KATHREIN
LEGO        Lego
LGAIR        LG Air Conditioner
MATSUSHITA        Matsushita
MITSU_HEAVY        Mitsubishi Air Conditioner
NEC16        JVC, Daewoo
NEC42        JVC
MERLIN        MERLIN remote (Pollin article number: 620 185)
NEC        NEC, Yamaha, Canon, Tevion, Harman/Kardon, Hitachi, JVC, Pioneer, Toshiba, Xoro, Orion, NoName and many more asian vendors.
NETBOX        Netbox
NIKON        NIKON
NUBERT        Nubert, e.g. Subwoofer Systems
ORTEK        Ortek, Hama
PANASONIC        PANASONIC Beamer
PENTAX        PENTAX
RC5        Philips and other european vendors
RC6A        Philips, Kathrein and others, e.g. XBOX
RC6        Philips and other european vendors
RCCAR        RC Car: IR remote for RC toys
RCII        T+A (NEW!)
RECS80        Philips, Nokia, Thomson, Nordmende, Telefunken, Saba
RECS80EXT        Philips, Technisat, Thomson, Nordmende, Telefunken, Saba
RCMM        Fujitsu-Siemens e.g. Activy keyboard
ROOMBA        iRobot Roomba vacuum cleaner
S100        similar to RC5, but 14 instead of 13 Bits and 56kHz modulation. vendor unknown.
SAMSUNG32        Samsung
SAMSUNG48        various air conditions
SAMSUNG        Samsung
RUWIDO        RUWIDO (e.g. T-Home-Mediareceiver, MERLIN-keyboard(Pollin))
SIEMENS        Siemens, z.B. Gigaset M740AV
SIRCS        Sony
SPEAKER        Speaker Systems like X-Tensions
TECHNICS        Technics
TELEFUNKEN        Telefunken
THOMSON        Thomson
VINCENT        Vincent
Each of these protocols can be activated separately. If you want, you can activate all protocols. If you need only one protocol, you can disable all others. It will only be compiled the code that has been selected by the user.

出0入33汤圆

发表于 2020-5-4 11:44:30 | 显示全部楼层
顶楼主,这个不错,感谢!

出0入8汤圆

发表于 2020-5-4 12:33:58 来自手机 | 显示全部楼层
非常不错,感谢分享

出0入0汤圆

发表于 2020-5-4 13:11:24 | 显示全部楼层
感谢分享!!!

出0入0汤圆

发表于 2020-5-4 13:51:21 | 显示全部楼层
谢谢分享!

出0入13汤圆

发表于 2020-5-4 13:53:10 来自手机 | 显示全部楼层
感谢分享开源红外软解码代码,支持的协议还挺多

出0入0汤圆

发表于 2020-5-4 14:04:13 | 显示全部楼层
谢谢分享!

出0入0汤圆

发表于 2020-5-4 16:18:28 | 显示全部楼层
多谢分享,怎么同一个遥控器的同一个按键,使能不同的解码协议后解出的command不同呢?而且我发现我这个遥控器的数据格式是16位地址+16命令+16位命令,IRMP只解析了8位的命令,这16位的命令我扩展的话容易做到吗?谢谢

比如采用如下配置,得到按键的编码为:
Protocol=SAMSG32, Addr=0xB24D, Cmd=0x29D6
  1. // typical protocols, disable here!             Enable  Remarks                 F_INTERRUPTS            Program Space
  2. #define IRMP_SUPPORT_SIRCS_PROTOCOL             1       // Sony SIRCS           >= 10000                 ~150 bytes
  3. #define IRMP_SUPPORT_NEC_PROTOCOL               1       // NEC + APPLE + ONKYO  >= 10000                 ~300 bytes
  4. #define IRMP_SUPPORT_SAMSUNG_PROTOCOL           1       // Samsung + Samsg32    >= 10000                 ~300 bytes
  5. #define IRMP_SUPPORT_KASEIKYO_PROTOCOL          1       // Kaseikyo             >= 10000                 ~250 bytes

  6. // more protocols, enable here!                 Enable  Remarks                 F_INTERRUPTS            Program Space
  7. #define IRMP_SUPPORT_JVC_PROTOCOL               1       // JVC                  >= 10000                 ~150 bytes
  8. #define IRMP_SUPPORT_NEC16_PROTOCOL             1       // NEC16                >= 10000                 ~100 bytes
  9. #define IRMP_SUPPORT_NEC42_PROTOCOL             1       // NEC42                >= 10000                 ~300 bytes
  10. #define IRMP_SUPPORT_MATSUSHITA_PROTOCOL        1       // Matsushita           >= 10000                  ~50 bytes
  11. #define IRMP_SUPPORT_DENON_PROTOCOL             1       // DENON, Sharp         >= 10000                 ~250 bytes
  12. #define IRMP_SUPPORT_RC5_PROTOCOL               1       // RC5                  >= 10000                 ~250 bytes
  13. #define IRMP_SUPPORT_RC6_PROTOCOL               1       // RC6 & RC6A           >= 10000                 ~250 bytes
  14. #define IRMP_SUPPORT_IR60_PROTOCOL              1       // IR60 (SDA2008)       >= 10000                 ~300 bytes
  15. #define IRMP_SUPPORT_GRUNDIG_PROTOCOL           1       // Grundig              >= 10000                 ~300 bytes
  16. #define IRMP_SUPPORT_SIEMENS_PROTOCOL           1       // Siemens Gigaset      >= 15000                 ~550 bytes
  17. #define IRMP_SUPPORT_NOKIA_PROTOCOL             1       // Nokia                >= 10000                 ~300 bytes

  18. // exotic protocols, enable here!               Enable  Remarks                 F_INTERRUPTS            Program Space
  19. #define IRMP_SUPPORT_BOSE_PROTOCOL              0       // BOSE                 >= 10000                 ~150 bytes
  20. #define IRMP_SUPPORT_KATHREIN_PROTOCOL          0       // Kathrein             >= 10000                 ~200 bytes
  21. #define IRMP_SUPPORT_NUBERT_PROTOCOL            0       // NUBERT               >= 10000                  ~50 bytes
  22. #define IRMP_SUPPORT_FAN_PROTOCOL               0       // FAN (ventilator)     >= 10000                  ~50 bytes
  23. #define IRMP_SUPPORT_SPEAKER_PROTOCOL           0       // SPEAKER (~NUBERT)    >= 10000                  ~50 bytes
  24. #define IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL      0       // Bang & Olufsen       >= 10000                 ~200 bytes
  25. #define IRMP_SUPPORT_RECS80_PROTOCOL            0       // RECS80 (SAA3004)     >= 15000                  ~50 bytes
  26. #define IRMP_SUPPORT_RECS80EXT_PROTOCOL         0       // RECS80EXT (SAA3008)  >= 15000                  ~50 bytes
  27. #define IRMP_SUPPORT_THOMSON_PROTOCOL           0       // Thomson              >= 10000                 ~250 bytes
  28. #define IRMP_SUPPORT_NIKON_PROTOCOL             0       // NIKON camera         >= 10000                 ~250 bytes
  29. #define IRMP_SUPPORT_NETBOX_PROTOCOL            0       // Netbox keyboard      >= 10000                 ~400 bytes (PROTOTYPE!)
  30. #define IRMP_SUPPORT_ORTEK_PROTOCOL             0       // ORTEK (Hama)         >= 10000                 ~150 bytes
  31. #define IRMP_SUPPORT_TELEFUNKEN_PROTOCOL        0       // Telefunken 1560      >= 10000                 ~150 bytes
  32. #define IRMP_SUPPORT_FDC_PROTOCOL               0       // FDC3402 keyboard     >= 10000 (better 15000)  ~150 bytes (~400 in combination with RC5)
  33. #define IRMP_SUPPORT_RCCAR_PROTOCOL             0       // RC Car               >= 10000 (better 15000)  ~150 bytes (~500 in combination with RC5)
  34. #define IRMP_SUPPORT_ROOMBA_PROTOCOL            0       // iRobot Roomba        >= 10000                 ~150 bytes
  35. #define IRMP_SUPPORT_RUWIDO_PROTOCOL            0       // RUWIDO, T-Home       >= 15000                 ~550 bytes
  36. #define IRMP_SUPPORT_A1TVBOX_PROTOCOL           0       // A1 TV BOX            >= 15000 (better 20000)  ~300 bytes
  37. #define IRMP_SUPPORT_LEGO_PROTOCOL              0       // LEGO Power RC        >= 20000                 ~150 bytes
  38. #define IRMP_SUPPORT_RCMM_PROTOCOL              0       // RCMM 12,24, or 32    >= 20000                 ~150 bytes
  39. #define IRMP_SUPPORT_LGAIR_PROTOCOL             0       // LG Air Condition     >= 10000                 ~300 bytes
  40. #define IRMP_SUPPORT_SAMSUNG48_PROTOCOL         0       // Samsung48            >= 10000                 ~100 bytes (SAMSUNG must be enabled!)
  41. #define IRMP_SUPPORT_MERLIN_PROTOCOL            0       // Merlin               >= 15000 (better 20000)  ~300 bytes
  42. #define IRMP_SUPPORT_PENTAX_PROTOCOL            0       // Pentax               >= 10000                 ~150 bytes
  43. #define IRMP_SUPPORT_S100_PROTOCOL              0       // S100                 >= 10000                 ~250 bytes
  44. #define IRMP_SUPPORT_ACP24_PROTOCOL             0       // ACP24                >= 10000                 ~250 bytes
  45. #define IRMP_SUPPORT_TECHNICS_PROTOCOL          0       // TECHNICS             >= 10000                 ~250 bytes
  46. #define IRMP_SUPPORT_PANASONIC_PROTOCOL         0       // PANASONIC Beamer     >= 10000                 ~250 bytes
  47. #define IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL       0       // Mitsubishi Aircond   >= 10000                 ~250 bytes
  48. #define IRMP_SUPPORT_VINCENT_PROTOCOL           0       // VINCENT              >= 10000                 ~250 bytes
  49. #define IRMP_SUPPORT_SAMSUNGAH_PROTOCOL         0       // SAMSUNG AH           >= 10000                 ~250 bytes
  50. #define IRMP_SUPPORT_IRMP16_PROTOCOL            0       // IRMP specific        >= 15000                 ~250 bytes
  51. #define IRMP_SUPPORT_GREE_PROTOCOL              0       // GREE CLIMATE         >= 10000                 ~250 bytes
  52. #define IRMP_SUPPORT_RCII_PROTOCOL              0       // RCII T+A             >= 15000                 ~250 bytes
  53. #define IRMP_SUPPORT_METZ_PROTOCOL              0       // METZ                 >= 15000                 ~250 bytes
  54. #define IRMP_SUPPORT_RADIO1_PROTOCOL            0       // RADIO, e.g. TEVION   >= 10000                 ~250 bytes (experimental)
复制代码



Protocol=SAMSG48, Addr=0xB24D, Cmd=0x07D6  【协议名称和cmd码与前面的不同】
  1. // typical protocols, disable here!             Enable  Remarks                 F_INTERRUPTS            Program Space
  2. #define IRMP_SUPPORT_SIRCS_PROTOCOL             1       // Sony SIRCS           >= 10000                 ~150 bytes
  3. #define IRMP_SUPPORT_NEC_PROTOCOL               1       // NEC + APPLE + ONKYO  >= 10000                 ~300 bytes
  4. #define IRMP_SUPPORT_SAMSUNG_PROTOCOL           1       // Samsung + Samsg32    >= 10000                 ~300 bytes
  5. #define IRMP_SUPPORT_KASEIKYO_PROTOCOL          1       // Kaseikyo             >= 10000                 ~250 bytes

  6. // more protocols, enable here!                 Enable  Remarks                 F_INTERRUPTS            Program Space
  7. #define IRMP_SUPPORT_JVC_PROTOCOL               1       // JVC                  >= 10000                 ~150 bytes
  8. #define IRMP_SUPPORT_NEC16_PROTOCOL             1       // NEC16                >= 10000                 ~100 bytes
  9. #define IRMP_SUPPORT_NEC42_PROTOCOL             1       // NEC42                >= 10000                 ~300 bytes
  10. #define IRMP_SUPPORT_MATSUSHITA_PROTOCOL        1       // Matsushita           >= 10000                  ~50 bytes
  11. #define IRMP_SUPPORT_DENON_PROTOCOL             1       // DENON, Sharp         >= 10000                 ~250 bytes
  12. #define IRMP_SUPPORT_RC5_PROTOCOL               1       // RC5                  >= 10000                 ~250 bytes
  13. #define IRMP_SUPPORT_RC6_PROTOCOL               1       // RC6 & RC6A           >= 10000                 ~250 bytes
  14. #define IRMP_SUPPORT_IR60_PROTOCOL              1       // IR60 (SDA2008)       >= 10000                 ~300 bytes
  15. #define IRMP_SUPPORT_GRUNDIG_PROTOCOL           1       // Grundig              >= 10000                 ~300 bytes
  16. #define IRMP_SUPPORT_SIEMENS_PROTOCOL           1       // Siemens Gigaset      >= 15000                 ~550 bytes
  17. #define IRMP_SUPPORT_NOKIA_PROTOCOL             1       // Nokia                >= 10000                 ~300 bytes

  18. // exotic protocols, enable here!               Enable  Remarks                 F_INTERRUPTS            Program Space
  19. #define IRMP_SUPPORT_BOSE_PROTOCOL              1       // BOSE                 >= 10000                 ~150 bytes
  20. #define IRMP_SUPPORT_KATHREIN_PROTOCOL          1       // Kathrein             >= 10000                 ~200 bytes
  21. #define IRMP_SUPPORT_NUBERT_PROTOCOL            1       // NUBERT               >= 10000                  ~50 bytes
  22. #define IRMP_SUPPORT_FAN_PROTOCOL               1       // FAN (ventilator)     >= 10000                  ~50 bytes
  23. #define IRMP_SUPPORT_SPEAKER_PROTOCOL           1       // SPEAKER (~NUBERT)    >= 10000                  ~50 bytes
  24. #define IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL      1       // Bang & Olufsen       >= 10000                 ~200 bytes
  25. #define IRMP_SUPPORT_RECS80_PROTOCOL            1       // RECS80 (SAA3004)     >= 15000                  ~50 bytes
  26. #define IRMP_SUPPORT_RECS80EXT_PROTOCOL         1       // RECS80EXT (SAA3008)  >= 15000                  ~50 bytes
  27. #define IRMP_SUPPORT_THOMSON_PROTOCOL           1       // Thomson              >= 10000                 ~250 bytes
  28. #define IRMP_SUPPORT_NIKON_PROTOCOL             1       // NIKON camera         >= 10000                 ~250 bytes
  29. #define IRMP_SUPPORT_NETBOX_PROTOCOL            1       // Netbox keyboard      >= 10000                 ~400 bytes (PROTOTYPE!)
  30. #define IRMP_SUPPORT_ORTEK_PROTOCOL             1       // ORTEK (Hama)         >= 10000                 ~150 bytes
  31. #define IRMP_SUPPORT_TELEFUNKEN_PROTOCOL        1       // Telefunken 1560      >= 10000                 ~150 bytes
  32. #define IRMP_SUPPORT_FDC_PROTOCOL               1       // FDC3402 keyboard     >= 10000 (better 15000)  ~150 bytes (~400 in combination with RC5)
  33. #define IRMP_SUPPORT_RCCAR_PROTOCOL             1       // RC Car               >= 10000 (better 15000)  ~150 bytes (~500 in combination with RC5)
  34. #define IRMP_SUPPORT_ROOMBA_PROTOCOL            1       // iRobot Roomba        >= 10000                 ~150 bytes
  35. #define IRMP_SUPPORT_RUWIDO_PROTOCOL            1       // RUWIDO, T-Home       >= 15000                 ~550 bytes
  36. #define IRMP_SUPPORT_A1TVBOX_PROTOCOL           1       // A1 TV BOX            >= 15000 (better 20000)  ~300 bytes
  37. #define IRMP_SUPPORT_LEGO_PROTOCOL              1       // LEGO Power RC        >= 20000                 ~150 bytes
  38. #define IRMP_SUPPORT_RCMM_PROTOCOL              1       // RCMM 12,24, or 32    >= 20000                 ~150 bytes
  39. #define IRMP_SUPPORT_LGAIR_PROTOCOL             1       // LG Air Condition     >= 10000                 ~300 bytes
  40. #define IRMP_SUPPORT_SAMSUNG48_PROTOCOL         1       // Samsung48            >= 10000                 ~100 bytes (SAMSUNG must be enabled!)
  41. #define IRMP_SUPPORT_MERLIN_PROTOCOL            1       // Merlin               >= 15000 (better 20000)  ~300 bytes
  42. #define IRMP_SUPPORT_PENTAX_PROTOCOL            1       // Pentax               >= 10000                 ~150 bytes
  43. #define IRMP_SUPPORT_S100_PROTOCOL              1       // S100                 >= 10000                 ~250 bytes
  44. #define IRMP_SUPPORT_ACP24_PROTOCOL             1       // ACP24                >= 10000                 ~250 bytes
  45. #define IRMP_SUPPORT_TECHNICS_PROTOCOL          1       // TECHNICS             >= 10000                 ~250 bytes
  46. #define IRMP_SUPPORT_PANASONIC_PROTOCOL         1       // PANASONIC Beamer     >= 10000                 ~250 bytes
  47. #define IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL       1       // Mitsubishi Aircond   >= 10000                 ~250 bytes
  48. #define IRMP_SUPPORT_VINCENT_PROTOCOL           1       // VINCENT              >= 10000                 ~250 bytes
  49. #define IRMP_SUPPORT_SAMSUNGAH_PROTOCOL         1       // SAMSUNG AH           >= 10000                 ~250 bytes
  50. #define IRMP_SUPPORT_IRMP16_PROTOCOL            1       // IRMP specific        >= 15000                 ~250 bytes
  51. #define IRMP_SUPPORT_GREE_PROTOCOL              1       // GREE CLIMATE         >= 10000                 ~250 bytes
  52. #define IRMP_SUPPORT_RCII_PROTOCOL              1       // RCII T+A             >= 15000                 ~250 bytes
  53. #define IRMP_SUPPORT_METZ_PROTOCOL              1       // METZ                 >= 15000                 ~250 bytes
  54. #define IRMP_SUPPORT_RADIO1_PROTOCOL            1       // RADIO, e.g. TEVION   >= 10000                 ~250 bytes (experimental)
复制代码

出0入0汤圆

发表于 2020-5-4 16:30:07 | 显示全部楼层
顶楼主,以前也做过红外解码,做通用的还是停累的!

出0入9汤圆

发表于 2020-5-4 22:41:22 | 显示全部楼层
这个不错,20年前曾经搞过空调自学习遥控。
额,我真老了。。。

出110入12汤圆

发表于 2020-5-4 23:10:56 | 显示全部楼层
用过这个,很方便

出0入0汤圆

发表于 2020-5-4 23:13:45 | 显示全部楼层
这不是一个老帖子的内容吗?又翻出来了。
https://www.amobbs.com/forum.php ... &highlight=%E7%

出5入0汤圆

 楼主| 发表于 2020-5-4 23:45:21 | 显示全部楼层
9509238 发表于 2020-5-4 23:13
这不是一个老帖子的内容吗?又翻出来了。
https://www.amobbs.com/forum.php?mod=viewthread&tid=5596999&h ...

果然,挖坟了
回帖提示: 反政府言论将被立即封锁ID 在按“提交”前,请自问一下:我这样表达会给举报吗,会给自己惹麻烦吗? 另外:尽量不要使用Mark、顶等没有意义的回复。不得大量使用大字体和彩色字。【本论坛不允许直接上传手机拍摄图片,浪费大家下载带宽和论坛服务器空间,请压缩后(图片小于1兆)才上传。压缩方法可以在微信里面发给自己(不要勾选“原图),然后下载,就能得到压缩后的图片】。另外,手机版只能上传图片,要上传附件需要切换到电脑版(不需要使用电脑,手机上切换到电脑版就行,页面底部)。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|Archiver|amobbs.com 阿莫电子技术论坛 ( 粤ICP备2022115958号, 版权所有:东莞阿莫电子贸易商行 创办于2004年 (公安交互式论坛备案:44190002001997 ) )

GMT+8, 2024-4-25 18:44

© Since 2004 www.amobbs.com, 原www.ourdev.cn, 原www.ouravr.com

快速回复 返回顶部 返回列表