11/** @file
2- 6SC2 - Car Remote.
2+ MIC 6SC2 - Car Remote.
33
44 Copyright (C) 2024 Ethan Halsall
55
1212#include "decoder.h"
1313
1414/**
15- 6SC2 - Car Remote (315 MHz).
15+ MIC 6SC2 - Car Remote (315 MHz).
1616
1717Manufacturer:
18- - Unknown
18+ - Unknown, MSOP-10 perhaps from MIC (Master Instrument Corporation)
1919
2020Supported Models:
2121- 6SC2 CMGU
@@ -58,20 +58,20 @@ static int six_sc_two_car_remote_decode(r_device *decoder, bitbuffer_t *bitbuffe
5858 return DECODE_ABORT_LENGTH ;
5959 }
6060
61- uint8_t * bytes = bitbuffer -> bb [row ];
61+ uint8_t * b = bitbuffer -> bb [row ];
6262
63- if (bytes [0 ] != 0x55 || bytes [1 ] != 0x54 ) {
63+ if (b [0 ] != 0x55 || b [1 ] != 0x54 ) {
6464 return DECODE_FAIL_SANITY ;
6565 }
6666
67- if (xor_bytes (bytes + 2 , 9 )) {
67+ if (xor_bytes (b + 2 , 9 )) {
6868 return DECODE_FAIL_MIC ;
6969 }
7070
7171 // The transmission is LSB first, big endian.
72- uint32_t encrypted = (uint32_t )reverse8 (bytes [5 ]) << 24 | (uint32_t )reverse8 (bytes [4 ]) << 16 | (uint32_t )reverse8 (bytes [3 ]) << 8 | reverse8 (bytes [2 ]);
73- int button = reverse8 (bytes [6 ]) & 0xf ;
74- int sequence = (reverse8 (bytes [8 ]) << 8 ) | reverse8 (bytes [7 ]);
72+ uint32_t encrypted = (uint32_t )reverse8 (b [5 ]) << 24 | (uint32_t )reverse8 (b [4 ]) << 16 | (uint32_t )reverse8 (b [3 ]) << 8 | reverse8 (b [2 ]);
73+ int button = reverse8 (b [6 ]) & 0xf ;
74+ int sequence = (reverse8 (b [8 ]) << 8 ) | reverse8 (b [7 ]);
7575
7676 char encrypted_str [9 ];
7777 snprintf (encrypted_str , sizeof (encrypted_str ), "%08X" , encrypted );
@@ -90,7 +90,7 @@ static int six_sc_two_car_remote_decode(r_device *decoder, bitbuffer_t *bitbuffe
9090
9191 /* clang-format off */
9292 data_t * data = data_make (
93- "model" , "model" , DATA_STRING , "6SC2 -CarRemote" ,
93+ "model" , "model" , DATA_STRING , "MIC6SC2 -CarRemote" ,
9494 "encrypted" , "" , DATA_STRING , encrypted_str ,
9595 "button_code" , "Button Code" , DATA_INT , button ,
9696 "button_str" , "Button" , DATA_STRING , button_str ,
@@ -114,7 +114,7 @@ static char const *const output_fields[] = {
114114};
115115
116116r_device const six_sc_two_car_remote = {
117- .name = "6SC2 Car Remote (-f 315.1M)" ,
117+ .name = "MIC 6SC2 Car Remote (-f 315.1M)" ,
118118 .modulation = OOK_PULSE_MANCHESTER_ZEROBIT ,
119119 .short_width = 250 ,
120120 .reset_limit = 10000 ,
0 commit comments