diff --git a/driver/bk4819.c b/driver/bk4819.c index 2f13dfd..7c6e05a 100644 --- a/driver/bk4819.c +++ b/driver/bk4819.c @@ -1930,22 +1930,26 @@ void BK4819_PlayRogerMDC1200(void) uint16_t fsk_reg59; #ifdef ENABLE_MDC1200 - const uint8_t op = 0x12; - const uint8_t arg = 0x34; + const uint8_t op = MDC1200_OP_CODE_POST_ID; + const uint8_t arg = 0x00; const uint16_t id = 0x5678; uint8_t packet[8 + 40]; memset(packet + 0, 0x00, 4); memset(packet + 4, 0xff, 4); - const unsigned int size = MDC1200_encode_single_packet(packet + 8, op, arg, id); + const unsigned int size = 8 + MDC1200_encode_single_packet(packet + 8, op, arg, id); #else + static const uint8_t packet[] = { 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, // this needs properly computing for MDC1200 0xA2, 0xF1, 0x46, 0x74, 0xA4, 0x61, 0x44, 0x65, 0x8A, 0x4E, 0x44, 0xE0, 0x84, 0xEA + }; + const unsigned int size = sizeof(packet); + }; #endif diff --git a/firmware.bin b/firmware.bin index 975e9f0..0ad8142 100644 Binary files a/firmware.bin and b/firmware.bin differ diff --git a/firmware.packed.bin b/firmware.packed.bin index 07e9fd9..203b668 100644 Binary files a/firmware.packed.bin and b/firmware.packed.bin differ diff --git a/mdc1200.h b/mdc1200.h index 3681193..2f2ebfb 100644 --- a/mdc1200.h +++ b/mdc1200.h @@ -4,6 +4,30 @@ #include +// 0x01 (0x80) is PTT ID +// 0x01 (0x00) is POST ID +// 0x11 (0x8A) is REMOTE MONITOR +// 0x22 (0x06) is STATUS REQ +// 0x2B (0x0C) is RADIO ENABLE +// 0x2B (0x00) is RADIO DISABLE +// 0x35 (0x89) is CALL ALERT +// 0x46 (0xXX) is STS XX +// 0x47 (0xXX) is MSG XX +// 0x63 (0x85) is RADIO CHECK + +enum mdc1200_op_code_e { + MDC1200_OP_CODE_PTT_ID = 0x01, + MDC1200_OP_CODE_POST_ID = 0x01, + MDC1200_OP_CODE_REMOTE_MONITOR = 0x11, + MDC1200_OP_CODE_STATUS_REQ = 0x22, + MDC1200_OP_CODE_RADIO_ENABLE = 0x2B, + MDC1200_OP_CODE_RADIO_DISABLE = 0x2B, + MDC1200_OP_CODE_CALL_ALERT = 0x35, + MDC1200_OP_CODE_STS_XX = 0x46, + MDC1200_OP_CODE_MSG_XX = 0x47, + MDC1200_OP_CODE_RADIO_CHECK = 0x63 +}; + int MDC1200_encode_single_packet(uint8_t *data, const uint8_t op, const uint8_t arg, const uint16_t unit_id); int MDC1200_encode_double_packet(uint8_t *data, const uint8_t op, const uint8_t arg, const uint16_t unit_id, const uint8_t b0, const uint8_t b1, const uint8_t b2, const uint8_t b3);