diff --git a/CHANGELOG.md b/CHANGELOG.md
index dcdd2fc..d904d46 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -48,6 +48,8 @@
    Register assignment for function parameters was changed with the removal of
    some asserts in related implementations.
 
+4. platform: Support PLDM_CPER_EVENT in encode_platform_event_message_req()
+
 ### Deprecated
 
 1. oem: meta: Deprecate `decode_oem_meta_file_io_req()`
diff --git a/src/dsp/platform.c b/src/dsp/platform.c
index 4ecad13..755707a 100644
--- a/src/dsp/platform.c
+++ b/src/dsp/platform.c
@@ -1236,7 +1236,7 @@
 		return PLDM_ERROR_INVALID_LENGTH;
 	}
 
-	if (event_class > PLDM_HEARTBEAT_TIMER_ELAPSED_EVENT &&
+	if (event_class > PLDM_CPER_EVENT &&
 	    !(event_class >= 0xf0 && event_class <= 0xfe)) {
 		return PLDM_ERROR_INVALID_DATA;
 	}
diff --git a/tests/dsp/platform.cpp b/tests/dsp/platform.cpp
index 2f0240b..56e9fb3 100644
--- a/tests/dsp/platform.cpp
+++ b/tests/dsp/platform.cpp
@@ -2262,33 +2262,67 @@
 
 TEST(PlatformEventMessage, testGoodEncodeRequest)
 {
-    uint8_t formatVersion = 0x01;
-    uint8_t Tid = 0x03;
-    uint8_t eventClass = 0x00;
-    uint8_t eventData = 34;
+    static constexpr const uint8_t formatVersion = 0x01;
+    static constexpr const uint8_t eventClass = 0x00;
+    static constexpr const uint8_t eventData = 34;
+    static constexpr const uint8_t Tid = 0x03;
+    struct pldm_platform_event_message_req req;
+    struct pldm_msgbuf _buf;
+    struct pldm_msgbuf* buf = &_buf;
+    size_t len;
+    void* data;
 
-    std::array<uint8_t, hdrSize + PLDM_PLATFORM_EVENT_MESSAGE_MIN_REQ_BYTES +
-                            sizeof(eventData)>
-        requestMsg{};
+    PLDM_MSG_DEFINE_P(request, PLDM_PLATFORM_EVENT_MESSAGE_MIN_REQ_BYTES +
+                                   sizeof(eventData));
 
-    // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
-    auto request = reinterpret_cast<pldm_msg*>(requestMsg.data());
+    /* Test with the minimum event type value */
     auto rc = encode_platform_event_message_req(
-        0, formatVersion, Tid, eventClass,
-        // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
-        reinterpret_cast<uint8_t*>(&eventData), sizeof(eventData), request,
-        sizeof(eventData) + PLDM_PLATFORM_EVENT_MESSAGE_MIN_REQ_BYTES);
+        0, formatVersion, Tid, eventClass, &eventData, sizeof(eventData),
+        request, sizeof(eventData) + PLDM_PLATFORM_EVENT_MESSAGE_MIN_REQ_BYTES);
+    ASSERT_EQ(rc, PLDM_SUCCESS);
 
-    struct pldm_platform_event_message_req* req =
-        // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
-        reinterpret_cast<struct pldm_platform_event_message_req*>(
-            request->payload);
+    rc = pldm_msgbuf_init_errno(
+        buf, PLDM_PLATFORM_EVENT_MESSAGE_MIN_REQ_BYTES, request->payload,
+        PLDM_PLATFORM_EVENT_MESSAGE_MIN_REQ_BYTES + sizeof(eventData));
+    ASSERT_EQ(rc, 0);
 
-    EXPECT_EQ(rc, PLDM_SUCCESS);
-    EXPECT_EQ(formatVersion, req->format_version);
-    EXPECT_EQ(Tid, req->tid);
-    EXPECT_EQ(eventClass, req->event_class);
-    EXPECT_EQ(0, memcmp(&eventData, req->event_data, sizeof(eventData)));
+    pldm_msgbuf_extract_uint8(buf, req.format_version);
+    pldm_msgbuf_extract_uint8(buf, req.tid);
+    pldm_msgbuf_extract_uint8(buf, req.event_class);
+    data = nullptr;
+    pldm_msgbuf_span_remaining(buf, &data, &len);
+    ASSERT_EQ(pldm_msgbuf_destroy_consumed(buf), 0);
+
+    EXPECT_EQ(formatVersion, req.format_version);
+    EXPECT_EQ(Tid, req.tid);
+    EXPECT_EQ(eventClass, req.event_class);
+    ASSERT_EQ(sizeof(eventData), len);
+    EXPECT_EQ(0, memcmp(&eventData, data, len));
+
+    /* Test with the maximum event type value */
+    rc = encode_platform_event_message_req(
+        0, formatVersion, Tid, PLDM_CPER_EVENT, &eventData, sizeof(eventData),
+        request, sizeof(eventData) + PLDM_PLATFORM_EVENT_MESSAGE_MIN_REQ_BYTES);
+    ASSERT_EQ(rc, PLDM_SUCCESS);
+
+    rc = pldm_msgbuf_init_errno(
+        buf, PLDM_PLATFORM_EVENT_MESSAGE_MIN_REQ_BYTES, request->payload,
+        PLDM_PLATFORM_EVENT_MESSAGE_MIN_REQ_BYTES + sizeof(eventData));
+    ASSERT_EQ(rc, 0);
+
+    pldm_msgbuf_extract_uint8(buf, req.format_version);
+    pldm_msgbuf_extract_uint8(buf, req.tid);
+    pldm_msgbuf_extract_uint8(buf, req.event_class);
+
+    data = nullptr;
+    pldm_msgbuf_span_remaining(buf, &data, &len);
+    ASSERT_EQ(pldm_msgbuf_destroy_consumed(buf), 0);
+
+    EXPECT_EQ(formatVersion, req.format_version);
+    EXPECT_EQ(Tid, req.tid);
+    EXPECT_EQ(PLDM_CPER_EVENT, req.event_class);
+    ASSERT_EQ(sizeof(eventData), len);
+    EXPECT_EQ(0, memcmp(&eventData, data, len));
 }
 
 TEST(PlatformEventMessage, testBadEncodeRequest)
@@ -2296,36 +2330,35 @@
     uint8_t Tid = 0x03;
     uint8_t eventClass = 0x00;
     uint8_t eventData = 34;
-    size_t sz_eventData = sizeof(eventData);
-    size_t payloadLen =
-        sz_eventData + PLDM_PLATFORM_EVENT_MESSAGE_MIN_REQ_BYTES;
     uint8_t formatVersion = 0x01;
+    static constexpr const size_t payloadLen =
+        PLDM_PLATFORM_EVENT_MESSAGE_MIN_REQ_BYTES + sizeof(eventData);
 
-    std::array<uint8_t, hdrSize + PLDM_PLATFORM_EVENT_MESSAGE_MIN_REQ_BYTES +
-                            sizeof(eventData)>
-        requestMsg{};
-    // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
-    auto request = reinterpret_cast<pldm_msg*>(requestMsg.data());
+    PLDM_MSG_DEFINE_P(request, payloadLen);
 
     auto rc = encode_platform_event_message_req(
-        0, formatVersion, Tid, eventClass,
-        // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
-        reinterpret_cast<uint8_t*>(&eventData), sz_eventData, nullptr,
-        payloadLen);
+        0, formatVersion, Tid, eventClass, &eventData, sizeof(eventData),
+        nullptr, payloadLen);
     EXPECT_EQ(rc, PLDM_ERROR_INVALID_DATA);
-    rc = encode_platform_event_message_req(
-        // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
-        0, 0, Tid, eventClass, reinterpret_cast<uint8_t*>(&eventData),
-        sz_eventData, request, payloadLen);
+
+    rc = encode_platform_event_message_req(0, 0, Tid, eventClass, &eventData,
+                                           sizeof(eventData), request,
+                                           payloadLen);
     EXPECT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+
     rc = encode_platform_event_message_req(0, formatVersion, Tid, eventClass,
                                            nullptr, 0, request, payloadLen);
     EXPECT_EQ(rc, PLDM_ERROR_INVALID_DATA);
-    rc = encode_platform_event_message_req(
-        0, formatVersion, Tid, eventClass,
-        // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
-        reinterpret_cast<uint8_t*>(&eventData), sz_eventData, request, 0);
+
+    rc = encode_platform_event_message_req(0, formatVersion, Tid, eventClass,
+                                           &eventData, sizeof(eventData),
+                                           request, 0);
     EXPECT_EQ(rc, PLDM_ERROR_INVALID_LENGTH);
+
+    rc = encode_platform_event_message_req(
+        0, formatVersion, Tid, PLDM_CPER_EVENT + 1, &eventData,
+        sizeof(eventData), request, payloadLen);
+    EXPECT_EQ(rc, PLDM_ERROR_INVALID_DATA);
 }
 
 TEST(PlatformEventMessage, testGoodDecodeResponse)
