0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-04-28 22:31:25 +03:00

mdc1200 update

This commit is contained in:
OneOfEleven 2023-10-20 20:14:47 +01:00
parent 0c231148fe
commit 06a19ee05c
4 changed files with 31 additions and 3 deletions

View File

@ -1930,22 +1930,26 @@ void BK4819_PlayRogerMDC1200(void)
uint16_t fsk_reg59; uint16_t fsk_reg59;
#ifdef ENABLE_MDC1200 #ifdef ENABLE_MDC1200
const uint8_t op = 0x12; const uint8_t op = MDC1200_OP_CODE_POST_ID;
const uint8_t arg = 0x34; const uint8_t arg = 0x00;
const uint16_t id = 0x5678; const uint16_t id = 0x5678;
uint8_t packet[8 + 40]; uint8_t packet[8 + 40];
memset(packet + 0, 0x00, 4); memset(packet + 0, 0x00, 4);
memset(packet + 4, 0xff, 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 #else
static const uint8_t packet[] = { static const uint8_t packet[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
// this needs properly computing for MDC1200 // this needs properly computing for MDC1200
0xA2, 0xF1, 0x46, 0x74, 0xA4, 0x61, 0x44, 0x65, 0x8A, 0x4E, 0x44, 0xE0, 0x84, 0xEA 0xA2, 0xF1, 0x46, 0x74, 0xA4, 0x61, 0x44, 0x65, 0x8A, 0x4E, 0x44, 0xE0, 0x84, 0xEA
};
const unsigned int size = sizeof(packet); const unsigned int size = sizeof(packet);
}; };
#endif #endif

Binary file not shown.

Binary file not shown.

View File

@ -4,6 +4,30 @@
#include <stdint.h> #include <stdint.h>
// 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_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); 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);