diff --git a/openrtx/src/core/rtxlink_cat.c b/openrtx/src/core/rtxlink_cat.c index f1495be3..4fcfd807 100644 --- a/openrtx/src/core/rtxlink_cat.c +++ b/openrtx/src/core/rtxlink_cat.c @@ -51,6 +51,7 @@ enum catCommand CAT_OP_MODE = 0x4F4D, CAT_M17_CALLSIGN = 0x4D43, CAT_M17_DEST = 0x4D44, + CAT_M17_CAN = 0x4341, CAT_PTT = 0x5054, // Miscellaneous CAT command @@ -160,6 +161,13 @@ static size_t catCommandGet(const uint8_t *args, const size_t len, ret += sizeof(status.M17_dst); break; + case CAT_M17_CAN: + + status = rtx_getCurrentStatus(); + reply[1] = status.can; + ret += 1; + break; + default: reply[0] = CAT_FRAME_ACK; reply[1] = EBADRQC; @@ -290,6 +298,17 @@ static size_t catCommandSet(const uint8_t *args, const size_t len, catConfigureRtx(); break; + case CAT_M17_CAN: + + if (args[2] <= 15) + { + pthread_mutex_lock(&state_mutex); + state.settings.m17_can = args[2]; + pthread_mutex_unlock(&state_mutex); + catConfigureRtx(); + } + break; + case CAT_POWER_CYCLE: // TODO: to be implemented