!661 xts_hats 新增HDI接口

Merge pull request !661 from Aurora/master
This commit is contained in:
openharmony_ci 2023-06-15 03:01:41 +00:00 committed by Gitee
commit 1e3a0a0498
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -143,6 +143,9 @@ enum class HdiId {
HREQ_NETWORK_SET_LOCATE_UPDATES,
HREQ_NETWORK_SET_NOTIFICATION_FILTER,
HREQ_NETWORK_SET_DEVICE_STATE,
HREQ_NETWORK_GET_RRC_CONNECTION_STATE,
HREQ_NETWORK_SET_NR_OPTION_MODE,
HREQ_NETWORK_GET_NR_OPTION_MODE,
HREQ_COMMON_BASE = 500,
HREQ_MODEM_SHUT_DOWN,
@ -157,6 +160,8 @@ enum class HdiId {
enum class DeviceStateType { POWER_SAVE_MODE, CHARGING_STATE, LOW_DATA_STATE };
enum class NrMode { NR_MODE_UNKNOWN, NR_MODE_NSA_ONLY, NR_MODE_SA_ONLY, NR_MODE_NSA_AND_SA };
enum class NotificationFilter {
NOTIFICATION_FILTER_ALL = -1,
NOTIFICATION_FILTER_NONE = 0,
@ -400,6 +405,10 @@ public:
int32_t SetLocateUpdatesResponse(const RilRadioResponseInfo &responseInfo) override;
int32_t SetNotificationFilterResponse(const RilRadioResponseInfo &responseInfo) override;
int32_t SetDeviceStateResponse(const RilRadioResponseInfo &responseInfo) override;
int32_t GetRrcConnectionStateResponse(const RilRadioResponseInfo &responseInfo, int32_t state) override;
int32_t SetNrOptionModeResponse(const RilRadioResponseInfo &responseInfo) override;
int32_t GetNrOptionModeResponse(const RilRadioResponseInfo &responseInfo, int32_t mode) override;
int32_t GetRrcConnectionStateUpdated(const RilRadioResponseInfo &responseInfo, int32_t state) override;
// Sms
int32_t NewSmsNotify(
@ -1165,6 +1174,39 @@ int32_t RilCallback::SetDeviceStateResponse(const RilRadioResponseInfo &response
return 0;
}
int32_t RilCallback::GetRrcConnectionStateResponse(const RilRadioResponseInfo &responseInfo, int32_t state)
{
HDF_LOGI("RilCallback::GetRrcConnectionStateResponse state:%{public}d", state);
hdiId_ = HdiId::HREQ_NETWORK_GET_RRC_CONNECTION_STATE;
resultInfo_ = responseInfo;
NotifyAll();
return 0;
}
int32_t RilCallback::SetNrOptionModeResponse(const RilRadioResponseInfo &responseInfo)
{
HDF_LOGI("RilCallback::SetDeviceStateResponse error:%{public}d", responseInfo.error);
hdiId_ = HdiId::HREQ_NETWORK_SET_NR_OPTION_MODE;
resultInfo_ = responseInfo;
NotifyAll();
return 0;
}
int32_t RilCallback::GetNrOptionModeResponse(const RilRadioResponseInfo &responseInfo, int32_t state)
{
HDF_LOGI("RilCallback::GetNrOptionModeResponse state:%{public}d", state);
hdiId_ = HdiId::HREQ_NETWORK_GET_NR_OPTION_MODE;
resultInfo_ = responseInfo;
NotifyAll();
return 0;
}
int32_t RilCallback::GetRrcConnectionStateUpdated(const RilRadioResponseInfo &responseInfo, int32_t state)
{
HDF_LOGI("RilCallback::GetRrcConnectionStateUpdated state:%{public}d", state);
return 0;
}
// Call
int32_t RilCallback::CallEmergencyNotice(
const RilRadioResponseInfo &responseInfo, const EmergencyInfoList &emergencyInfoList)
@ -3230,6 +3272,74 @@ HWTEST_F(HdfRilHdiTest, Telephony_DriverSystem_SetDeviceState_V1_0200, Function
ASSERT_TRUE(GetBoolResult(HdiId::HREQ_NETWORK_SET_DEVICE_STATE));
}
HWTEST_F(HdfRilHdiTest, Telephony_DriverSystem_GetRrcConnectionState_V1_0100, Function | MediumTest | Level3)
{
if (!IsReady(SLOTID_1)) {
return;
}
int32_t ret = g_rilInterface->GetRrcConnectionState(SLOTID_1, GetSerialId());
WaitFor(WAIT_TIME_SECOND);
EXPECT_EQ(SUCCESS, ret);
ASSERT_TRUE(GetBoolResult(HdiId::HREQ_NETWORK_GET_RRC_CONNECTION_STATE));
}
HWTEST_F(HdfRilHdiTest, Telephony_DriverSystem_GetRrcConnectionState_V1_0200, Function | MediumTest | Level3)
{
if (!IsReady(SLOTID_2)) {
return;
}
int32_t ret = g_rilInterface->GetRrcConnectionState(SLOTID_2, GetSerialId());
WaitFor(WAIT_TIME_SECOND);
EXPECT_EQ(SUCCESS, ret);
ASSERT_TRUE(GetBoolResult(HdiId::HREQ_NETWORK_GET_RRC_CONNECTION_STATE));
}
HWTEST_F(HdfRilHdiTest, Telephony_DriverSystem_SetNrOptionMode_V1_0100, Function | MediumTest | Level3)
{
if (!IsReady(SLOTID_1)) {
return;
}
int32_t ret =
g_rilInterface->SetNrOptionMode(SLOTID_1, GetSerialId(), static_cast<int32_t>(NrMode::NR_MODE_NSA_AND_SA));
WaitFor(WAIT_TIME_SECOND);
EXPECT_EQ(SUCCESS, ret);
ASSERT_TRUE(GetBoolResult(HdiId::HREQ_NETWORK_SET_NR_OPTION_MODE));
}
HWTEST_F(HdfRilHdiTest, Telephony_DriverSystem_SetNrOptionMode_V1_0200, Function | MediumTest | Level3)
{
if (!IsReady(SLOTID_2)) {
return;
}
int32_t ret =
g_rilInterface->SetNrOptionMode(SLOTID_2, GetSerialId(), static_cast<int32_t>(NrMode::NR_MODE_NSA_AND_SA));
WaitFor(WAIT_TIME_SECOND);
EXPECT_EQ(SUCCESS, ret);
ASSERT_TRUE(GetBoolResult(HdiId::HREQ_NETWORK_SET_NR_OPTION_MODE));
}
HWTEST_F(HdfRilHdiTest, Telephony_DriverSystem_GetNrOptionMode_V1_0100, Function | MediumTest | Level3)
{
if (!IsReady(SLOTID_1)) {
return;
}
int32_t ret = g_rilInterface->GetNrOptionMode(SLOTID_1, GetSerialId());
WaitFor(WAIT_TIME_SECOND);
EXPECT_EQ(SUCCESS, ret);
ASSERT_TRUE(GetBoolResult(HdiId::HREQ_NETWORK_GET_NR_OPTION_MODE));
}
HWTEST_F(HdfRilHdiTest, Telephony_DriverSystem_GetNrOptionMode_V1_0200, Function | MediumTest | Level3)
{
if (!IsReady(SLOTID_2)) {
return;
}
int32_t ret = g_rilInterface->GetNrOptionMode(SLOTID_2, GetSerialId());
WaitFor(WAIT_TIME_SECOND);
EXPECT_EQ(SUCCESS, ret);
ASSERT_TRUE(GetBoolResult(HdiId::HREQ_NETWORK_GET_NR_OPTION_MODE));
}
/**
* modem Test
**/