chamberlain_code.c 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505
  1. #include "chamberlain_code.h"
  2. #include "../blocks/const.h"
  3. #include "../blocks/decoder.h"
  4. #include "../blocks/encoder.h"
  5. #include "../blocks/generic.h"
  6. #include "../blocks/math.h"
  7. #define TAG "SubGhzProtocolChamb_Code"
  8. #define CHAMBERLAIN_CODE_BIT_STOP 0b0001
  9. #define CHAMBERLAIN_CODE_BIT_1 0b0011
  10. #define CHAMBERLAIN_CODE_BIT_0 0b0111
  11. #define CHAMBERLAIN_7_CODE_MASK 0xF000000FF0F
  12. #define CHAMBERLAIN_8_CODE_MASK 0xF00000F00F
  13. #define CHAMBERLAIN_9_CODE_MASK 0xF000000000F
  14. #define CHAMBERLAIN_7_CODE_MASK_CHECK 0x10000001101
  15. #define CHAMBERLAIN_8_CODE_MASK_CHECK 0x1000001001
  16. #define CHAMBERLAIN_9_CODE_MASK_CHECK 0x10000000001
  17. #define CHAMBERLAIN_7_CODE_DIP_PATTERN "%c%c%c%c%c%c%c"
  18. #define CHAMBERLAIN_7_CODE_DATA_TO_DIP(dip) \
  19. (dip & 0x0040 ? '1' : '0'), (dip & 0x0020 ? '1' : '0'), (dip & 0x0010 ? '1' : '0'), \
  20. (dip & 0x0008 ? '1' : '0'), (dip & 0x0004 ? '1' : '0'), (dip & 0x0002 ? '1' : '0'), \
  21. (dip & 0x0001 ? '1' : '0')
  22. #define CHAMBERLAIN_8_CODE_DIP_PATTERN "%c%c%c%c%cx%c%c"
  23. #define CHAMBERLAIN_8_CODE_DATA_TO_DIP(dip) \
  24. (dip & 0x0080 ? '1' : '0'), (dip & 0x0040 ? '1' : '0'), (dip & 0x0020 ? '1' : '0'), \
  25. (dip & 0x0010 ? '1' : '0'), (dip & 0x0008 ? '1' : '0'), (dip & 0x0001 ? '1' : '0'), \
  26. (dip & 0x0002 ? '1' : '0')
  27. #define CHAMBERLAIN_9_CODE_DIP_PATTERN "%c%c%c%c%c%c%c%c%c"
  28. #define CHAMBERLAIN_9_CODE_DATA_TO_DIP(dip) \
  29. (dip & 0x0100 ? '1' : '0'), (dip & 0x0080 ? '1' : '0'), (dip & 0x0040 ? '1' : '0'), \
  30. (dip & 0x0020 ? '1' : '0'), (dip & 0x0010 ? '1' : '0'), (dip & 0x0008 ? '1' : '0'), \
  31. (dip & 0x0001 ? '1' : '0'), (dip & 0x0002 ? '1' : '0'), (dip & 0x0004 ? '1' : '0')
  32. static const SubGhzBlockConst subghz_protocol_chamb_code_const = {
  33. .te_short = 1000,
  34. .te_long = 3000,
  35. .te_delta = 200,
  36. .min_count_bit_for_found = 10,
  37. };
  38. struct SubGhzProtocolDecoderChamb_Code {
  39. SubGhzProtocolDecoderBase base;
  40. SubGhzBlockDecoder decoder;
  41. SubGhzBlockGeneric generic;
  42. };
  43. struct SubGhzProtocolEncoderChamb_Code {
  44. SubGhzProtocolEncoderBase base;
  45. SubGhzProtocolBlockEncoder encoder;
  46. SubGhzBlockGeneric generic;
  47. };
  48. typedef enum {
  49. Chamb_CodeDecoderStepReset = 0,
  50. Chamb_CodeDecoderStepFoundStartBit,
  51. Chamb_CodeDecoderStepSaveDuration,
  52. Chamb_CodeDecoderStepCheckDuration,
  53. } Chamb_CodeDecoderStep;
  54. const SubGhzProtocolDecoder subghz_protocol_chamb_code_decoder = {
  55. .alloc = subghz_protocol_decoder_chamb_code_alloc,
  56. .free = subghz_protocol_decoder_chamb_code_free,
  57. .feed = subghz_protocol_decoder_chamb_code_feed,
  58. .reset = subghz_protocol_decoder_chamb_code_reset,
  59. .get_hash_data = subghz_protocol_decoder_chamb_code_get_hash_data,
  60. .serialize = subghz_protocol_decoder_chamb_code_serialize,
  61. .deserialize = subghz_protocol_decoder_chamb_code_deserialize,
  62. .get_string = subghz_protocol_decoder_chamb_code_get_string,
  63. };
  64. const SubGhzProtocolEncoder subghz_protocol_chamb_code_encoder = {
  65. .alloc = subghz_protocol_encoder_chamb_code_alloc,
  66. .free = subghz_protocol_encoder_chamb_code_free,
  67. .deserialize = subghz_protocol_encoder_chamb_code_deserialize,
  68. .stop = subghz_protocol_encoder_chamb_code_stop,
  69. .yield = subghz_protocol_encoder_chamb_code_yield,
  70. };
  71. const SubGhzProtocol subghz_protocol_chamb_code = {
  72. .name = SUBGHZ_PROTOCOL_CHAMB_CODE_NAME,
  73. .type = SubGhzProtocolTypeStatic,
  74. .flag = SubGhzProtocolFlag_315 | SubGhzProtocolFlag_AM | SubGhzProtocolFlag_Decodable |
  75. SubGhzProtocolFlag_Load | SubGhzProtocolFlag_Save | SubGhzProtocolFlag_Send,
  76. .decoder = &subghz_protocol_chamb_code_decoder,
  77. .encoder = &subghz_protocol_chamb_code_encoder,
  78. };
  79. void* subghz_protocol_encoder_chamb_code_alloc(SubGhzEnvironment* environment) {
  80. UNUSED(environment);
  81. SubGhzProtocolEncoderChamb_Code* instance = malloc(sizeof(SubGhzProtocolEncoderChamb_Code));
  82. instance->base.protocol = &subghz_protocol_chamb_code;
  83. instance->generic.protocol_name = instance->base.protocol->name;
  84. instance->encoder.repeat = 10;
  85. instance->encoder.size_upload = 24;
  86. instance->encoder.upload = malloc(instance->encoder.size_upload * sizeof(LevelDuration));
  87. instance->encoder.is_running = false;
  88. return instance;
  89. }
  90. void subghz_protocol_encoder_chamb_code_free(void* context) {
  91. furi_assert(context);
  92. SubGhzProtocolEncoderChamb_Code* instance = context;
  93. free(instance->encoder.upload);
  94. free(instance);
  95. }
  96. static uint64_t subghz_protocol_chamb_bit_to_code(uint64_t data, uint8_t size) {
  97. uint64_t data_res = 0;
  98. for(uint8_t i = 0; i < size; i++) {
  99. if(!(bit_read(data, size - i - 1))) {
  100. data_res = data_res << 4 | CHAMBERLAIN_CODE_BIT_0;
  101. } else {
  102. data_res = data_res << 4 | CHAMBERLAIN_CODE_BIT_1;
  103. }
  104. }
  105. return data_res;
  106. }
  107. /**
  108. * Generating an upload from data.
  109. * @param instance Pointer to a SubGhzProtocolEncoderChamb_Code instance
  110. * @return true On success
  111. */
  112. static bool
  113. subghz_protocol_encoder_chamb_code_get_upload(SubGhzProtocolEncoderChamb_Code* instance) {
  114. furi_assert(instance);
  115. uint64_t data = subghz_protocol_chamb_bit_to_code(
  116. instance->generic.data, instance->generic.data_count_bit);
  117. switch(instance->generic.data_count_bit) {
  118. case 7:
  119. data = ((data >> 4) << 16) | (data & 0xF) << 4 | CHAMBERLAIN_7_CODE_MASK_CHECK;
  120. break;
  121. case 8:
  122. data = ((data >> 12) << 16) | (data & 0xFF) << 4 | CHAMBERLAIN_8_CODE_MASK_CHECK;
  123. break;
  124. case 9:
  125. data = (data << 4) | CHAMBERLAIN_9_CODE_MASK_CHECK;
  126. break;
  127. default:
  128. FURI_LOG_E(TAG, "Invalid bits count");
  129. return false;
  130. break;
  131. }
  132. #define UPLOAD_HEX_DATA_SIZE 10
  133. uint8_t upload_hex_data[UPLOAD_HEX_DATA_SIZE] = {0};
  134. size_t upload_hex_count_bit = 0;
  135. //insert guard time
  136. for(uint8_t i = 0; i < 36; i++) {
  137. subghz_protocol_blocks_set_bit_array(
  138. 0, upload_hex_data, upload_hex_count_bit++, UPLOAD_HEX_DATA_SIZE);
  139. }
  140. //insert data
  141. switch(instance->generic.data_count_bit) {
  142. case 7:
  143. case 9:
  144. for(uint8_t i = 44; i > 0; i--) {
  145. if(!bit_read(data, i - 1)) {
  146. subghz_protocol_blocks_set_bit_array(
  147. 0, upload_hex_data, upload_hex_count_bit++, UPLOAD_HEX_DATA_SIZE);
  148. } else {
  149. subghz_protocol_blocks_set_bit_array(
  150. 1, upload_hex_data, upload_hex_count_bit++, UPLOAD_HEX_DATA_SIZE);
  151. }
  152. }
  153. break;
  154. case 8:
  155. for(uint8_t i = 40; i > 0; i--) {
  156. if(!bit_read(data, i - 1)) {
  157. subghz_protocol_blocks_set_bit_array(
  158. 0, upload_hex_data, upload_hex_count_bit++, UPLOAD_HEX_DATA_SIZE);
  159. } else {
  160. subghz_protocol_blocks_set_bit_array(
  161. 1, upload_hex_data, upload_hex_count_bit++, UPLOAD_HEX_DATA_SIZE);
  162. }
  163. }
  164. break;
  165. }
  166. instance->encoder.size_upload = subghz_protocol_blocks_get_upload_from_bit_array(
  167. upload_hex_data,
  168. upload_hex_count_bit,
  169. instance->encoder.upload,
  170. instance->encoder.size_upload,
  171. subghz_protocol_chamb_code_const.te_short,
  172. SubGhzProtocolBlockAlignBitLeft);
  173. return true;
  174. }
  175. SubGhzProtocolStatus
  176. subghz_protocol_encoder_chamb_code_deserialize(void* context, FlipperFormat* flipper_format) {
  177. furi_assert(context);
  178. SubGhzProtocolEncoderChamb_Code* instance = context;
  179. SubGhzProtocolStatus ret = SubGhzProtocolStatusError;
  180. do {
  181. ret = subghz_block_generic_deserialize(&instance->generic, flipper_format);
  182. if(ret != SubGhzProtocolStatusOk) {
  183. break;
  184. }
  185. if(instance->generic.data_count_bit >
  186. subghz_protocol_chamb_code_const.min_count_bit_for_found) {
  187. FURI_LOG_E(TAG, "Wrong number of bits in key");
  188. ret = SubGhzProtocolStatusErrorValueBitCount;
  189. break;
  190. }
  191. //optional parameter parameter
  192. flipper_format_read_uint32(
  193. flipper_format, "Repeat", (uint32_t*)&instance->encoder.repeat, 1);
  194. if(!subghz_protocol_encoder_chamb_code_get_upload(instance)) {
  195. ret = SubGhzProtocolStatusErrorEncoderGetUpload;
  196. break;
  197. }
  198. instance->encoder.is_running = true;
  199. } while(false);
  200. return ret;
  201. }
  202. void subghz_protocol_encoder_chamb_code_stop(void* context) {
  203. SubGhzProtocolEncoderChamb_Code* instance = context;
  204. instance->encoder.is_running = false;
  205. }
  206. LevelDuration subghz_protocol_encoder_chamb_code_yield(void* context) {
  207. SubGhzProtocolEncoderChamb_Code* instance = context;
  208. if(instance->encoder.repeat == 0 || !instance->encoder.is_running) {
  209. instance->encoder.is_running = false;
  210. return level_duration_reset();
  211. }
  212. LevelDuration ret = instance->encoder.upload[instance->encoder.front];
  213. if(++instance->encoder.front == instance->encoder.size_upload) {
  214. instance->encoder.repeat--;
  215. instance->encoder.front = 0;
  216. }
  217. return ret;
  218. }
  219. void* subghz_protocol_decoder_chamb_code_alloc(SubGhzEnvironment* environment) {
  220. UNUSED(environment);
  221. SubGhzProtocolDecoderChamb_Code* instance = malloc(sizeof(SubGhzProtocolDecoderChamb_Code));
  222. instance->base.protocol = &subghz_protocol_chamb_code;
  223. instance->generic.protocol_name = instance->base.protocol->name;
  224. return instance;
  225. }
  226. void subghz_protocol_decoder_chamb_code_free(void* context) {
  227. furi_assert(context);
  228. SubGhzProtocolDecoderChamb_Code* instance = context;
  229. free(instance);
  230. }
  231. void subghz_protocol_decoder_chamb_code_reset(void* context) {
  232. furi_assert(context);
  233. SubGhzProtocolDecoderChamb_Code* instance = context;
  234. instance->decoder.parser_step = Chamb_CodeDecoderStepReset;
  235. }
  236. static bool subghz_protocol_chamb_code_to_bit(uint64_t* data, uint8_t size) {
  237. uint64_t data_tmp = data[0];
  238. uint64_t data_res = 0;
  239. for(uint8_t i = 0; i < size; i++) {
  240. if((data_tmp & 0xFll) == CHAMBERLAIN_CODE_BIT_0) {
  241. bit_write(data_res, i, 0);
  242. } else if((data_tmp & 0xFll) == CHAMBERLAIN_CODE_BIT_1) {
  243. bit_write(data_res, i, 1);
  244. } else {
  245. return false;
  246. }
  247. data_tmp >>= 4;
  248. }
  249. data[0] = data_res;
  250. return true;
  251. }
  252. static bool subghz_protocol_decoder_chamb_code_check_mask_and_parse(
  253. SubGhzProtocolDecoderChamb_Code* instance) {
  254. furi_assert(instance);
  255. if(instance->decoder.decode_count_bit >
  256. subghz_protocol_chamb_code_const.min_count_bit_for_found + 1)
  257. return false;
  258. if((instance->decoder.decode_data & CHAMBERLAIN_7_CODE_MASK) ==
  259. CHAMBERLAIN_7_CODE_MASK_CHECK) {
  260. instance->decoder.decode_count_bit = 7;
  261. instance->decoder.decode_data &= ~CHAMBERLAIN_7_CODE_MASK;
  262. instance->decoder.decode_data = (instance->decoder.decode_data >> 12) |
  263. ((instance->decoder.decode_data >> 4) & 0xF);
  264. } else if(
  265. (instance->decoder.decode_data & CHAMBERLAIN_8_CODE_MASK) ==
  266. CHAMBERLAIN_8_CODE_MASK_CHECK) {
  267. instance->decoder.decode_count_bit = 8;
  268. instance->decoder.decode_data &= ~CHAMBERLAIN_8_CODE_MASK;
  269. instance->decoder.decode_data = instance->decoder.decode_data >> 4 |
  270. CHAMBERLAIN_CODE_BIT_0 << 8; //DIP 6 no use
  271. } else if(
  272. (instance->decoder.decode_data & CHAMBERLAIN_9_CODE_MASK) ==
  273. CHAMBERLAIN_9_CODE_MASK_CHECK) {
  274. instance->decoder.decode_count_bit = 9;
  275. instance->decoder.decode_data &= ~CHAMBERLAIN_9_CODE_MASK;
  276. instance->decoder.decode_data >>= 4;
  277. } else {
  278. return false;
  279. }
  280. return subghz_protocol_chamb_code_to_bit(
  281. &instance->decoder.decode_data, instance->decoder.decode_count_bit);
  282. }
  283. void subghz_protocol_decoder_chamb_code_feed(void* context, bool level, uint32_t duration) {
  284. furi_assert(context);
  285. SubGhzProtocolDecoderChamb_Code* instance = context;
  286. switch(instance->decoder.parser_step) {
  287. case Chamb_CodeDecoderStepReset:
  288. if((!level) && (DURATION_DIFF(duration, subghz_protocol_chamb_code_const.te_short * 39) <
  289. subghz_protocol_chamb_code_const.te_delta * 20)) {
  290. //Found header Chamb_Code
  291. instance->decoder.parser_step = Chamb_CodeDecoderStepFoundStartBit;
  292. }
  293. break;
  294. case Chamb_CodeDecoderStepFoundStartBit:
  295. if((level) && (DURATION_DIFF(duration, subghz_protocol_chamb_code_const.te_short) <
  296. subghz_protocol_chamb_code_const.te_delta)) {
  297. //Found start bit Chamb_Code
  298. instance->decoder.decode_data = 0;
  299. instance->decoder.decode_count_bit = 0;
  300. instance->decoder.decode_data = instance->decoder.decode_data << 4 |
  301. CHAMBERLAIN_CODE_BIT_STOP;
  302. instance->decoder.decode_count_bit++;
  303. instance->decoder.parser_step = Chamb_CodeDecoderStepSaveDuration;
  304. } else {
  305. instance->decoder.parser_step = Chamb_CodeDecoderStepReset;
  306. }
  307. break;
  308. case Chamb_CodeDecoderStepSaveDuration:
  309. if(!level) { //save interval
  310. if(duration > subghz_protocol_chamb_code_const.te_short * 5) {
  311. if(instance->decoder.decode_count_bit >=
  312. subghz_protocol_chamb_code_const.min_count_bit_for_found) {
  313. instance->generic.serial = 0x0;
  314. instance->generic.btn = 0x0;
  315. if(subghz_protocol_decoder_chamb_code_check_mask_and_parse(instance)) {
  316. instance->generic.data = instance->decoder.decode_data;
  317. instance->generic.data_count_bit = instance->decoder.decode_count_bit;
  318. if(instance->base.callback)
  319. instance->base.callback(&instance->base, instance->base.context);
  320. }
  321. }
  322. instance->decoder.parser_step = Chamb_CodeDecoderStepReset;
  323. } else {
  324. instance->decoder.te_last = duration;
  325. instance->decoder.parser_step = Chamb_CodeDecoderStepCheckDuration;
  326. }
  327. } else {
  328. instance->decoder.parser_step = Chamb_CodeDecoderStepReset;
  329. }
  330. break;
  331. case Chamb_CodeDecoderStepCheckDuration:
  332. if(level) {
  333. if((DURATION_DIFF( //Found stop bit Chamb_Code
  334. instance->decoder.te_last,
  335. subghz_protocol_chamb_code_const.te_short * 3) <
  336. subghz_protocol_chamb_code_const.te_delta) &&
  337. (DURATION_DIFF(duration, subghz_protocol_chamb_code_const.te_short) <
  338. subghz_protocol_chamb_code_const.te_delta)) {
  339. instance->decoder.decode_data = instance->decoder.decode_data << 4 |
  340. CHAMBERLAIN_CODE_BIT_STOP;
  341. instance->decoder.decode_count_bit++;
  342. instance->decoder.parser_step = Chamb_CodeDecoderStepSaveDuration;
  343. } else if(
  344. (DURATION_DIFF(
  345. instance->decoder.te_last, subghz_protocol_chamb_code_const.te_short * 2) <
  346. subghz_protocol_chamb_code_const.te_delta) &&
  347. (DURATION_DIFF(duration, subghz_protocol_chamb_code_const.te_short * 2) <
  348. subghz_protocol_chamb_code_const.te_delta)) {
  349. instance->decoder.decode_data = instance->decoder.decode_data << 4 |
  350. CHAMBERLAIN_CODE_BIT_1;
  351. instance->decoder.decode_count_bit++;
  352. instance->decoder.parser_step = Chamb_CodeDecoderStepSaveDuration;
  353. } else if(
  354. (DURATION_DIFF(
  355. instance->decoder.te_last, subghz_protocol_chamb_code_const.te_short) <
  356. subghz_protocol_chamb_code_const.te_delta) &&
  357. (DURATION_DIFF(duration, subghz_protocol_chamb_code_const.te_short * 3) <
  358. subghz_protocol_chamb_code_const.te_delta)) {
  359. instance->decoder.decode_data = instance->decoder.decode_data << 4 |
  360. CHAMBERLAIN_CODE_BIT_0;
  361. instance->decoder.decode_count_bit++;
  362. instance->decoder.parser_step = Chamb_CodeDecoderStepSaveDuration;
  363. } else {
  364. instance->decoder.parser_step = Chamb_CodeDecoderStepReset;
  365. }
  366. } else {
  367. instance->decoder.parser_step = Chamb_CodeDecoderStepReset;
  368. }
  369. break;
  370. }
  371. }
  372. uint8_t subghz_protocol_decoder_chamb_code_get_hash_data(void* context) {
  373. furi_assert(context);
  374. SubGhzProtocolDecoderChamb_Code* instance = context;
  375. return subghz_protocol_blocks_get_hash_data(
  376. &instance->decoder, (instance->decoder.decode_count_bit / 8) + 1);
  377. }
  378. SubGhzProtocolStatus subghz_protocol_decoder_chamb_code_serialize(
  379. void* context,
  380. FlipperFormat* flipper_format,
  381. SubGhzRadioPreset* preset) {
  382. furi_assert(context);
  383. SubGhzProtocolDecoderChamb_Code* instance = context;
  384. return subghz_block_generic_serialize(&instance->generic, flipper_format, preset);
  385. }
  386. SubGhzProtocolStatus
  387. subghz_protocol_decoder_chamb_code_deserialize(void* context, FlipperFormat* flipper_format) {
  388. furi_assert(context);
  389. SubGhzProtocolDecoderChamb_Code* instance = context;
  390. SubGhzProtocolStatus ret = SubGhzProtocolStatusError;
  391. do {
  392. ret = subghz_block_generic_deserialize(&instance->generic, flipper_format);
  393. if(ret != SubGhzProtocolStatusOk) {
  394. break;
  395. }
  396. if(instance->generic.data_count_bit >
  397. subghz_protocol_chamb_code_const.min_count_bit_for_found) {
  398. FURI_LOG_E(TAG, "Wrong number of bits in key");
  399. ret = SubGhzProtocolStatusErrorValueBitCount;
  400. break;
  401. }
  402. } while(false);
  403. return ret;
  404. }
  405. void subghz_protocol_decoder_chamb_code_get_string(void* context, FuriString* output) {
  406. furi_assert(context);
  407. SubGhzProtocolDecoderChamb_Code* instance = context;
  408. uint32_t code_found_lo = instance->generic.data & 0x00000000ffffffff;
  409. uint64_t code_found_reverse = subghz_protocol_blocks_reverse_key(
  410. instance->generic.data, instance->generic.data_count_bit);
  411. uint32_t code_found_reverse_lo = code_found_reverse & 0x00000000ffffffff;
  412. furi_string_cat_printf(
  413. output,
  414. "%s %db\r\n"
  415. "Key:0x%03lX\r\n"
  416. "Yek:0x%03lX\r\n",
  417. instance->generic.protocol_name,
  418. instance->generic.data_count_bit,
  419. code_found_lo,
  420. code_found_reverse_lo);
  421. switch(instance->generic.data_count_bit) {
  422. case 7:
  423. furi_string_cat_printf(
  424. output,
  425. "DIP:" CHAMBERLAIN_7_CODE_DIP_PATTERN "\r\n",
  426. CHAMBERLAIN_7_CODE_DATA_TO_DIP(code_found_lo));
  427. break;
  428. case 8:
  429. furi_string_cat_printf(
  430. output,
  431. "DIP:" CHAMBERLAIN_8_CODE_DIP_PATTERN "\r\n",
  432. CHAMBERLAIN_8_CODE_DATA_TO_DIP(code_found_lo));
  433. break;
  434. case 9:
  435. furi_string_cat_printf(
  436. output,
  437. "DIP:" CHAMBERLAIN_9_CODE_DIP_PATTERN "\r\n",
  438. CHAMBERLAIN_9_CODE_DATA_TO_DIP(code_found_lo));
  439. break;
  440. default:
  441. break;
  442. }
  443. }