Skip to content

Commit 97679e8

Browse files
RDKEMW-1017 RDKEMW-1018: enum update
Signed-off-by: yuvaramachandran_gurusamy <[email protected]>
1 parent 47ae77c commit 97679e8

File tree

2 files changed

+46
-30
lines changed

2 files changed

+46
-30
lines changed

apis/Miracast/IMiracastPlayer.h

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,42 @@ namespace WPEFramework
3232
{
3333
enum { ID = ID_MIRACAST_PLAYER };
3434

35-
enum PlayerReasonCode : uint32_t
35+
enum State : uint8_t
3636
{
37-
REASON_CODE_SUCCESS = 200 /* @text SUCCESS */,
38-
REASON_CODE_APP_REQ_TO_STOP = 201 /* @text APP_REQ_TO_STOP */,
39-
REASON_CODE_SRC_DEV_REQ_TO_STOP = 202 /* @text SRC_DEV_REQ_TO_STOP */,
40-
REASON_CODE_RTSP_ERROR = 203 /* @text RTSP_FAILURE */,
41-
REASON_CODE_RTSP_TIMEOUT = 204 /* @text RTSP_TIMEOUT */,
42-
REASON_CODE_RTSP_METHOD_NOT_SUPPORTED = 205 /* @text RTSP_NOT_SUPPORTED */,
43-
REASON_CODE_GST_ERROR = 206 /* @text GST_FAILURE */,
44-
REASON_CODE_INT_FAILURE = 207 /* @text INTERNAL_FAILURE */,
45-
REASON_CODE_NEW_SRC_DEV_CONNECT_REQ = 208 /* @text NEW_SRC_DEV_CONNECT_REQ */,
37+
STATE_IDLE = 0 /* @text IDLE */,
38+
STATE_INITIATED = 1 /* @text INITIATED */,
39+
STATE_INPROGRESS = 2 /* @text INPROGRESS */,
40+
STATE_PLAYING = 3 /* @text PLAYING */,
41+
STATE_STOPPED = 4 /* @text STOPPED */
4642
};
4743

48-
enum PlayerStopReasonCode : uint32_t
44+
enum ErrorCode : uint8_t
4945
{
50-
MIRACAST_PLAYER_APP_REQ_TO_STOP_ON_EXIT = 301 /* @text APP_REQ_TO_STOP_ON_EXIT */,
51-
MIRACAST_PLAYER_APP_REQ_TO_STOP_ON_NEW_CONNECTION = 302 /* @text APP_REQ_TO_STOP_ON_NEW_CONNECTION */
46+
ERROR_CODE_SUCCESS = 200 /* @text SUCCESS */,
47+
ERROR_CODE_APP_REQ_TO_STOP = 201 /* @text APP_REQ_TO_STOP */,
48+
ERROR_CODE_SRC_DEV_REQ_TO_STOP = 202 /* @text SRC_DEV_REQ_TO_STOP */,
49+
ERROR_CODE_RTSP_ERROR = 203 /* @text RTSP_FAILURE */,
50+
ERROR_CODE_RTSP_TIMEOUT = 204 /* @text RTSP_TIMEOUT */,
51+
ERROR_CODE_RTSP_METHOD_NOT_SUPPORTED = 205 /* @text RTSP_NOT_SUPPORTED */,
52+
ERROR_CODE_GST_ERROR = 206 /* @text GST_FAILURE */,
53+
ERROR_CODE_INT_FAILURE = 207 /* @text INTERNAL_FAILURE */,
54+
ERROR_CODE_NEW_SRC_DEV_CONNECT_REQ = 208 /* @text NEW_SRC_DEV_CONNECT_REQ */,
55+
};
56+
57+
enum StopReasonCode : uint16_t
58+
{
59+
STOP_REASON_APP_REQ_FOR_EXIT = 301 /* @text APP_REQ_TO_STOP_ON_EXIT */,
60+
STOP_REASON_APP_REQ_FOR_NEW_CONNECTION = 302 /* @text APP_REQ_TO_STOP_ON_NEW_CONNECTION */
61+
};
62+
63+
enum LogLevel : uint8_t
64+
{
65+
LOG_LEVEL_FATAL = 0 /* @text FATAL */,
66+
LOG_LEVEL_ERROR = 1 /* @text ERROR */,
67+
LOG_LEVEL_WARNING = 2 /* @text WARNING */,
68+
LOG_LEVEL_INFO = 3 /* @text INFO */,
69+
LOG_LEVEL_VERBOSE = 4 /* @text VERBOSE */,
70+
LOG_LEVEL_TRACE = 5 /* @text TRACE */
5271
};
5372

5473
struct EXTERNAL DeviceParameters
@@ -98,7 +117,7 @@ namespace WPEFramework
98117
// @param playerState: Current state of the player (e.g., INITIATED | INPROGRESS | PLAYING | STOPPED/IDLE(Default State).)
99118
// @param reasonCode: Reason code for the player state update
100119
// @param reason: reason code Decription
101-
virtual void OnStateChange(const string &clientName /* @text name */, const string &clientMac /* @text mac */, const string &playerState /* @text state */, const PlayerReasonCode &reasonCode /* @text reason_code */, const string &reason /* @text reason */) {};
120+
virtual void OnStateChange(const string &clientName /* @text name */, const string &clientMac /* @text mac */, const State &playerState /* @text state */, const ErrorCode &reasonCode /* @text reason_code */, const string &reason /* @text reason */) {};
102121
};
103122

104123
// @json:omit
@@ -124,7 +143,7 @@ namespace WPEFramework
124143
// @param reasonCode: Reason code for the player stop request
125144
// @param reason: Reason for the player stop request
126145
// @param success: Is the operation successful or not
127-
virtual Core::hresult StopRequest(const string &clientMac /* @in @text mac */, const string &clientName /* @in @text name */, const PlayerStopReasonCode &reasonCode /* @in @text reason_code */, Result &returnPayload /* @out */) = 0;
146+
virtual Core::hresult StopRequest(const string &clientMac /* @in @text mac */, const string &clientName /* @in @text name */, const StopReasonCode &reasonCode /* @in @text reason_code */, Result &returnPayload /* @out */) = 0;
128147

129148
// @brief Set the Video Rectangle.
130149
// @text setVideoRectangle
@@ -140,7 +159,7 @@ namespace WPEFramework
140159
// @param clienMac: MacAddress of the client device
141160
// @param clienName: Name of the client device
142161
// @param success: Is the operation successful or not
143-
virtual Core::hresult SetLogging(const string &logLevel /* @in @text level */, const SeparateLogger &separateLogger /* @in @text separate_logger */, Result &returnPayload /* @out */) = 0;
162+
virtual Core::hresult SetLogging(const LogLevel &logLevel /* @in @text level */, const SeparateLogger &separateLogger /* @in @text separate_logger */, Result &returnPayload /* @out */) = 0;
144163

145164
// @brief To configure the westeros environment arguments for the Miracast Player
146165
// @text setWesterosEnvironment

apis/Miracast/IMiracastService.h

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
#pragma once
2121

2222
#include "Module.h"
23-
23+
#include "IMiracastPlayer.h"
24+
// @stubgen:include "IMiracastPlayer.h"
2425
// @stubgen:include <com/IIteratorType.h>
2526

2627
namespace WPEFramework
@@ -32,17 +33,13 @@ namespace WPEFramework
3233
{
3334
enum { ID = ID_MIRACAST_SERVICE };
3435

35-
enum PlayerReasonCode : uint32_t
36+
enum ErrorCode : uint8_t
3637
{
37-
REASON_CODE_SUCCESS = 200 /* @text SUCCESS */,
38-
REASON_CODE_APP_REQ_TO_STOP = 201 /* @text APP_REQ_TO_STOP */,
39-
REASON_CODE_SRC_DEV_REQ_TO_STOP = 202 /* @text SRC_DEV_REQ_TO_STOP */,
40-
REASON_CODE_RTSP_ERROR = 203 /* @text RTSP_FAILURE */,
41-
REASON_CODE_RTSP_TIMEOUT = 204 /* @text RTSP_TIMEOUT */,
42-
REASON_CODE_RTSP_METHOD_NOT_SUPPORTED = 205 /* @text RTSP_NOT_SUPPORTED */,
43-
REASON_CODE_GST_ERROR = 206 /* @text GST_FAILURE */,
44-
REASON_CODE_INT_FAILURE = 207 /* @text INTERNAL_FAILURE */,
45-
REASON_CODE_NEW_SRC_DEV_CONNECT_REQ = 208 /* @text NEW_SRC_DEV_CONNECT_REQ */,
38+
ERROR_CODE_SUCCESS = 100 /* @text SUCCESS */,
39+
ERROR_CODE_P2P_CONNECT_FAILURE = 101 /* @text P2P_CONNECT_FAILURE */,
40+
ERROR_CODE_P2P_GROUP_NEGOTIATION_FAILURE = 102 /* @text P2P_GROUP_NEGOTIATION_FAILURE */,
41+
ERROR_CODE_P2P_GROUP_FORMATION_FAILURE = 103 /* @text P2P_GROUP_FORMATION_FAILURE */,
42+
ERROR_CODE_GENERIC_FAILURE = 104 /* @text GENERIC_FAILURE */
4643
};
4744

4845
struct EXTERNAL DeviceParameters
@@ -82,7 +79,7 @@ namespace WPEFramework
8279
// @param clientName: Name of the client device
8380
// @param errorCode: Error code for the connection failure
8481
// @param reason: Reason for the connection failure
85-
virtual void OnClientConnectionError(const string &clientMac /* @text mac */, const string &clientName /* @text name */, const string &errorCode /* @text error_code */, const string &reason /* @text reason */) {};
82+
virtual void OnClientConnectionError(const string &clientMac /* @text mac */, const string &clientName /* @text name */, const ErrorCode &reason /* @text reason */, const string &errorCodeStr /* @text error_code */) {};
8683

8784
// @brief Miracast Service Plugin raises this Event to request RA or MiracastWidget to launch the Miracast Player
8885
// @text onLaunchRequest
@@ -131,14 +128,14 @@ namespace WPEFramework
131128
// @param reasonCode: Reason code for the player state update
132129
// @param reason: Reason for the player state update
133130
// @param success: Is the operation successful or not
134-
virtual Core::hresult UpdatePlayerState(const string &clientMac /* @in @text mac */, const string &playerState /* @in @text state */, const PlayerReasonCode &reasonCode /* @in @text reason_code */, Result &returnPayload /* @out */) = 0;
131+
virtual Core::hresult UpdatePlayerState(const string &clientMac /* @in @text mac */, const IMiracastPlayer::State &playerState /* @in @text state */, const IMiracastPlayer::ErrorCode &reasonCode /* @in @text reason_code */, Result &returnPayload /* @out */) = 0;
135132

136133
// @brief Enable or Disable or Reduce the Logging level for Miracast
137134
// @text setLogging
138135
// @param logLevel: The logging level to be set (e.g., "DEBUG", "INFO", "WARN", "ERROR")
139136
// @param separateLogger: Contains the separate logger properties
140137
// @param success: Is the operation successful or not
141-
virtual Core::hresult SetLogging(const string &logLevel /* @in @text level */, const SeparateLogger &separateLogger /* @in @text separate_logger */, Result &returnPayload /* @out */) = 0;
138+
virtual Core::hresult SetLogging(const IMiracastPlayer::LogLevel &logLevel /* @in @text level */, const SeparateLogger &separateLogger /* @in @text separate_logger */, Result &returnPayload /* @out */) = 0;
142139

143140
// @brief Sets the status of the MiracastService backend discovery
144141
// @text setP2PBackendDiscovery

0 commit comments

Comments
 (0)