diff --git a/src/dsp/platform.c b/src/dsp/platform.c
index 693727e..297a033 100644
--- a/src/dsp/platform.c
+++ b/src/dsp/platform.c
@@ -2504,6 +2504,101 @@
 }
 
 LIBPLDM_ABI_TESTING
+int decode_set_numeric_sensor_enable_req(
+	const struct pldm_msg *msg, size_t payload_length,
+	struct pldm_set_numeric_sensor_enable_req *req)
+{
+	PLDM_MSGBUF_DEFINE_P(buf);
+	uint8_t event_enable = 0;
+	uint8_t op_state = 0;
+	int rc;
+
+	if (msg == NULL || req == NULL) {
+		return -EINVAL;
+	}
+
+	rc = pldm_msgbuf_init_errno(buf, 0, msg->payload, payload_length);
+	if (rc) {
+		return rc;
+	}
+
+	pldm_msgbuf_extract(buf, req->sensor_id);
+	pldm_msgbuf_extract(buf, op_state);
+	pldm_msgbuf_extract(buf, event_enable);
+
+	rc = pldm_msgbuf_complete_consumed(buf);
+	if (rc) {
+		return rc;
+	}
+
+	if (op_state > PLDM_SET_SENSOR_UNAVAILABLE) {
+		return -EPROTO;
+	}
+
+	if (event_enable > PLDM_STATE_EVENTS_ONLY_ENABLED) {
+		return -EPROTO;
+	}
+
+	req->op_state = op_state;
+	req->event_enable = event_enable;
+
+	return 0;
+}
+
+LIBPLDM_ABI_TESTING
+int decode_set_state_sensor_enables_req(
+	const struct pldm_msg *msg, size_t payload_length,
+	struct pldm_set_state_sensor_enables_req *req)
+{
+	PLDM_MSGBUF_DEFINE_P(buf);
+	int rc;
+
+	if (msg == NULL || req == NULL) {
+		return -EINVAL;
+	}
+
+	rc = pldm_msgbuf_init_errno(buf, 3, msg->payload, payload_length);
+	if (rc) {
+		return rc;
+	}
+
+	pldm_msgbuf_extract(buf, req->sensor_id);
+	rc = pldm_msgbuf_extract(buf, req->field_count);
+	if (rc) {
+		return rc;
+	}
+
+	if (req->field_count < 1 ||
+	    req->field_count > PLDM_SET_STATE_SENSOR_ENABLES_MAX_COUNT) {
+		return -EPROTO;
+	}
+
+	for (uint8_t i = 0; i < req->field_count; i++) {
+		uint8_t event_enable_val = 0;
+		uint8_t op_state_val = 0;
+
+		pldm_msgbuf_extract(buf, op_state_val);
+		rc = pldm_msgbuf_extract(buf, event_enable_val);
+		if (rc) {
+			return pldm_msgbuf_discard(buf, rc);
+		}
+
+		if (op_state_val > PLDM_SET_SENSOR_UNAVAILABLE) {
+			return pldm_msgbuf_discard(buf, -EPROTO);
+		}
+
+		if (event_enable_val > PLDM_STATE_EVENTS_ONLY_ENABLED) {
+			return pldm_msgbuf_discard(buf, -EPROTO);
+		}
+
+		req->fields[i].op_state = op_state_val;
+		req->fields[i].event_enable = event_enable_val;
+	}
+
+	return pldm_msgbuf_complete_consumed(buf);
+}
+
+LIBPLDM_ABI_TESTING
 int encode_get_event_receiver_req(uint8_t instance_id, struct pldm_msg *msg,
 				  size_t payload_length LIBPLDM_CC_UNUSED)
 {
