Signed-off-by: liujiandong <liujiandong1@huawei.com>
This commit is contained in:
YOUR_NAME 2022-06-07 21:14:11 +08:00
parent dad6009be9
commit b05447a1e6
5 changed files with 263 additions and 180 deletions

View File

@ -17,6 +17,7 @@
#define OHOS_RIL_RADIO_RESPONSE_TEST_H
#include <ipc_object_stub.h>
#include "ril_manager_test.h"
namespace OHOS {
namespace Telephony {
@ -81,6 +82,8 @@ public:
void OnResponseSendSmsAck(OHOS::MessageParcel &data);
void OnResponseGetSmscAddr(OHOS::MessageParcel &data);
void OnResponseSetSmscAddr(OHOS::MessageParcel &data);
void OnResponseLockStatus(OHOS::MessageParcel &data);
void OnResponseGetSimLockStatus(OHOS::MessageParcel &data);
private:
RilManagerTest *mRilManager_;

View File

@ -15,11 +15,10 @@
#include "ril_manager_test.h"
#include "ril_radio_response_test.h"
#include "ril_radio_indication_test.h"
#include "telephony_log_wrapper.h"
#include "hril_request.h"
#include "ril_radio_indication_test.h"
#include "ril_radio_response_test.h"
#include "telephony_log_wrapper.h"
namespace OHOS {
namespace Telephony {
@ -42,7 +41,7 @@ int32_t RilManagerTest::SendInt32Event(int32_t dispatchId, int32_t value)
OHOS::MessageParcel reply;
data.WriteInt32(slotId_);
data.WriteInt32(value);
OHOS::MessageOption option = {OHOS::MessageOption::TF_ASYNC};
OHOS::MessageOption option = { OHOS::MessageOption::TF_ASYNC };
status = cellularRadio_->SendRequest(dispatchId, data, reply, option);
}
return status;
@ -59,7 +58,7 @@ int32_t RilManagerTest::SendStringEvent(int32_t dispatchId, const char *value)
OHOS::MessageParcel data;
OHOS::MessageParcel reply;
data.WriteCString(value);
OHOS::MessageOption option = {OHOS::MessageOption::TF_ASYNC};
OHOS::MessageOption option = { OHOS::MessageOption::TF_ASYNC };
status = cellularRadio_->SendRequest(dispatchId, data, reply, option);
}
return status;
@ -70,7 +69,7 @@ int32_t RilManagerTest::SendBufferEvent(int32_t dispatchId, OHOS::MessageParcel
int32_t status = 0;
if (cellularRadio_ != nullptr) {
OHOS::MessageParcel reply;
OHOS::MessageOption option = {OHOS::MessageOption::TF_ASYNC};
OHOS::MessageOption option = { OHOS::MessageOption::TF_ASYNC };
status = cellularRadio_->SendRequest(dispatchId, eventData, reply, option);
}
return status;
@ -84,7 +83,7 @@ int32_t RilManagerTest::SendCommonBufferEvent(int32_t dispatchId, const void *ev
OHOS::MessageParcel data;
OHOS::MessageParcel reply;
data.WriteBuffer(eventData, (dataLength + INCREMENT_VALUE));
OHOS::MessageOption option = {OHOS::MessageOption::TF_ASYNC};
OHOS::MessageOption option = { OHOS::MessageOption::TF_ASYNC };
status = cellularRadio_->SendRequest(dispatchId, data, reply, option);
}
return status;
@ -240,7 +239,7 @@ void RilManagerTest::Hangup(int32_t gsmIndex, const AppExecFwk::InnerEvent::Poin
data.WriteInt32(slotId_);
data.WriteInt32(request->serialId_);
data.WriteInt32(gsmIndex);
OHOS::MessageOption option = {OHOS::MessageOption::TF_ASYNC};
OHOS::MessageOption option = { OHOS::MessageOption::TF_ASYNC };
cellularRadio_->SendRequest(HREQ_CALL_HANGUP, data, reply, option);
} else {
TELEPHONY_LOGE("Hangup cellularRadio_ == nullptr");
@ -330,7 +329,7 @@ void RilManagerTest::RilCmJoin(int32_t callType, const AppExecFwk::InnerEvent::P
data.WriteInt32(slotId_);
data.WriteInt32(request->serialId_);
data.WriteInt32(callType);
OHOS::MessageOption option = {OHOS::MessageOption::TF_ASYNC};
OHOS::MessageOption option = { OHOS::MessageOption::TF_ASYNC };
cellularRadio_->SendRequest(HREQ_CALL_COMBINE_CONFERENCE, data, reply, option);
} else {
TELEPHONY_LOGE("RilCmJoin cellularRadio_ == nullptr");
@ -351,7 +350,7 @@ void RilManagerTest::RilCmSplit(int32_t callIndex, int32_t callType, const AppEx
data.WriteInt32(request->serialId_);
data.WriteInt32(callIndex);
data.WriteInt32(callType);
OHOS::MessageOption option = {OHOS::MessageOption::TF_ASYNC};
OHOS::MessageOption option = { OHOS::MessageOption::TF_ASYNC };
cellularRadio_->SendRequest(HREQ_CALL_SEPARATE_CONFERENCE, data, reply, option);
} else {
TELEPHONY_LOGE("RilCmSplit cellularRadio_ == nullptr");
@ -371,7 +370,7 @@ void RilManagerTest::CallSupplement(int32_t hangupType, const AppExecFwk::InnerE
data.WriteInt32(slotId_);
data.WriteInt32(request->serialId_);
data.WriteInt32(hangupType);
OHOS::MessageOption option = {OHOS::MessageOption::TF_ASYNC};
OHOS::MessageOption option = { OHOS::MessageOption::TF_ASYNC };
cellularRadio_->SendRequest(HREQ_CALL_CALL_SUPPLEMENT, data, reply, option);
} else {
TELEPHONY_LOGE("CallSupplement cellularRadio_ == nullptr");
@ -401,7 +400,7 @@ void RilManagerTest::SendDtmf(char dtmfKey, int32_t index, const AppExecFwk::Inn
data.WriteInt32(1); // stringLength
data.WriteCString(temp);
OHOS::MessageOption option = {OHOS::MessageOption::TF_ASYNC};
OHOS::MessageOption option = { OHOS::MessageOption::TF_ASYNC };
cellularRadio_->SendRequest(HREQ_CALL_SEND_DTMF, data, reply, option);
} else {
TELEPHONY_LOGE("SendDtmf cellularRadio_ == nullptr");
@ -425,7 +424,7 @@ void RilManagerTest::StartDtmf(char dtmfKey, int32_t index, const AppExecFwk::In
temp[0] = dtmfKey;
data.WriteInt32(index);
data.WriteCString(temp);
OHOS::MessageOption option = {OHOS::MessageOption::TF_ASYNC};
OHOS::MessageOption option = { OHOS::MessageOption::TF_ASYNC };
cellularRadio_->SendRequest(HREQ_CALL_START_DTMF, data, reply, option);
} else {
TELEPHONY_LOGE("StartDtmf cellularRadio_ == nullptr");
@ -449,7 +448,7 @@ void RilManagerTest::StopDtmf(int32_t index, const AppExecFwk::InnerEvent::Point
temp[0] = 'A';
data.WriteInt32(index);
data.WriteCString(temp);
OHOS::MessageOption option = {OHOS::MessageOption::TF_ASYNC};
OHOS::MessageOption option = { OHOS::MessageOption::TF_ASYNC };
cellularRadio_->SendRequest(HREQ_CALL_STOP_DTMF, data, reply, option);
} else {
TELEPHONY_LOGE("StopDtmf cellularRadio_ == nullptr");
@ -469,7 +468,7 @@ void RilManagerTest::SetUssd(std::string str, const AppExecFwk::InnerEvent::Poin
data.WriteInt32(slotId_);
data.WriteInt32(request->serialId_);
data.WriteCString(str.c_str());
OHOS::MessageOption option = {OHOS::MessageOption::TF_ASYNC};
OHOS::MessageOption option = { OHOS::MessageOption::TF_ASYNC };
cellularRadio_->SendRequest(HREQ_CALL_SET_USSD, data, reply, option);
} else {
TELEPHONY_LOGE("SetUssdCusd cellularRadio_ == nullptr");
@ -503,7 +502,7 @@ void RilManagerTest::SetMute(int32_t mute, const AppExecFwk::InnerEvent::Pointer
data.WriteInt32(slotId_);
data.WriteInt32(request->serialId_);
data.WriteInt32(mute);
OHOS::MessageOption option = {OHOS::MessageOption::TF_ASYNC};
OHOS::MessageOption option = { OHOS::MessageOption::TF_ASYNC };
cellularRadio_->SendRequest(HREQ_CALL_SET_MUTE, data, reply, option);
} else {
TELEPHONY_LOGE("SetMute cellularRadio_ == nullptr");
@ -786,8 +785,8 @@ void RilManagerTest::SetPsAttachStatus(int32_t attachFlg, const AppExecFwk::Inne
}
}
void RilManagerTest::SetNetworkSelectionMode(int32_t mode, std::string plmn,
const AppExecFwk::InnerEvent::Pointer &result)
void RilManagerTest::SetNetworkSelectionMode(
int32_t mode, std::string plmn, const AppExecFwk::InnerEvent::Pointer &result)
{
if (cellularRadio_ != nullptr) {
std::shared_ptr<HRilRequestTest> request = CreateRequest(HREQ_NETWORK_SET_NETWORK_SELECTION_MODE, result);
@ -815,8 +814,7 @@ void RilManagerTest::SetNetworkSelectionMode(int32_t mode, std::string plmn,
void RilManagerTest::GetCellInfoList(const AppExecFwk::InnerEvent::Pointer &response)
{
if (cellularRadio_ != nullptr) {
std::shared_ptr<HRilRequestTest> request =
CreateRequest(HREQ_NETWORK_GET_NEIGHBORING_CELLINFO_LIST, response);
std::shared_ptr<HRilRequestTest> request = CreateRequest(HREQ_NETWORK_GET_NEIGHBORING_CELLINFO_LIST, response);
if (request == nullptr) {
return;
}
@ -963,7 +961,7 @@ void RilManagerTest::SetRadioState(int32_t fan, int32_t rst, const AppExecFwk::I
data.WriteInt32(request->serialId_);
data.WriteInt32(fan);
data.WriteInt32(rst);
OHOS::MessageOption option = {OHOS::MessageOption::TF_ASYNC};
OHOS::MessageOption option = { OHOS::MessageOption::TF_ASYNC };
cellularRadio_->SendRequest(HREQ_MODEM_SET_RADIO_STATUS, data, reply, option);
} else {
TELEPHONY_LOGE("SetRadioState cellularRadio_ == nullptr");
@ -981,7 +979,7 @@ void RilManagerTest::GetRadioState(const AppExecFwk::InnerEvent::Pointer &result
OHOS::MessageParcel reply;
data.WriteInt32(slotId_);
data.WriteInt32(request->serialId_);
OHOS::MessageOption option = {OHOS::MessageOption::TF_ASYNC};
OHOS::MessageOption option = { OHOS::MessageOption::TF_ASYNC };
cellularRadio_->SendRequest(HREQ_MODEM_GET_RADIO_STATUS, data, reply, option);
} else {
TELEPHONY_LOGE("GetRadioState cellularRadio_ == nullptr");
@ -1292,7 +1290,7 @@ void RilManagerTest::UnlockSimLock(
data.WriteInt32(lockType);
data.WriteCString(password.c_str());
MessageParcel reply;
OHOS::MessageOption option = {OHOS::MessageOption::TF_ASYNC};
OHOS::MessageOption option = { OHOS::MessageOption::TF_ASYNC };
if (cellularRadio_->SendRequest(HREQ_SIM_UNLOCK_SIM_LOCK, data, reply, option) < 0) {
TELEPHONY_LOGE("cellularRadio_->SendRequest fail");
}
@ -1314,7 +1312,7 @@ void RilManagerTest::GetLinkBandwidthInfo(const int32_t cid, const AppExecFwk::I
data.WriteInt32(slotId_);
data.WriteInt32(request->serialId_);
data.WriteInt32(cid);
MessageOption option = {MessageOption::TF_ASYNC};
MessageOption option = { MessageOption::TF_ASYNC };
cellularRadio_->SendRequest(HREQ_DATA_GET_LINK_BANDWIDTH_INFO, data, reply, option);
} else {
TELEPHONY_LOGE("ERROR : GetLinkBandwidthInfo --> cellularRadio_ == nullptr !!!");
@ -1363,8 +1361,8 @@ void RilManagerTest::UnLockPin2(const std::string &pin2, const AppExecFwk::Inner
}
}
void RilManagerTest::UnLockPuk(const std::string &puk, const std::string &pin,
const AppExecFwk::InnerEvent::Pointer &result)
void RilManagerTest::UnLockPuk(
const std::string &puk, const std::string &pin, const AppExecFwk::InnerEvent::Pointer &result)
{
TELEPHONY_LOGI("RilManagerTest::UnLockPuk -->");
if (cellularRadio_ != nullptr) {
@ -1386,8 +1384,8 @@ void RilManagerTest::UnLockPuk(const std::string &puk, const std::string &pin,
}
}
void RilManagerTest::UnLockPuk2(const std::string &puk2, const std::string &pin2,
const AppExecFwk::InnerEvent::Pointer &result)
void RilManagerTest::UnLockPuk2(
const std::string &puk2, const std::string &pin2, const AppExecFwk::InnerEvent::Pointer &result)
{
TELEPHONY_LOGI("RilManagerTest::UnLockPuk2 -->");
if (cellularRadio_ != nullptr) {
@ -1410,8 +1408,7 @@ void RilManagerTest::UnLockPuk2(const std::string &puk2, const std::string &pin2
}
void RilManagerTest::ChangeSimPassword(const std::string &fac, const std::string &oldPassword,
const std::string &newPassword, int32_t passwordLength,
const AppExecFwk::InnerEvent::Pointer &result)
const std::string &newPassword, int32_t passwordLength, const AppExecFwk::InnerEvent::Pointer &result)
{
TELEPHONY_LOGI("RilManagerTest::ChangeSimPassword -->");
if (cellularRadio_ != nullptr) {
@ -1440,8 +1437,8 @@ void RilManagerTest::ChangeSimPassword(const std::string &fac, const std::string
}
}
void RilManagerTest::SetSimLock(const std::string &fac, int32_t mode, const std::string &password,
const AppExecFwk::InnerEvent::Pointer &result)
void RilManagerTest::SetSimLock(
const std::string &fac, int32_t mode, const std::string &password, const AppExecFwk::InnerEvent::Pointer &result)
{
TELEPHONY_LOGI("RilManagerTest::SetSimLock -->");
if (cellularRadio_ != nullptr) {
@ -1469,8 +1466,8 @@ void RilManagerTest::SetSimLock(const std::string &fac, int32_t mode, const std:
}
}
void RilManagerTest::GetSimLockStatus(const std::string &fac, int32_t mode,
const AppExecFwk::InnerEvent::Pointer &result)
void RilManagerTest::GetSimLockStatus(
const std::string &fac, int32_t mode, const AppExecFwk::InnerEvent::Pointer &result)
{
TELEPHONY_LOGI("RilManagerTest::GetSimLockStatus -->");
if (cellularRadio_ != nullptr) {

View File

@ -15,12 +15,11 @@
#include "ril_radio_indication_test.h"
#include "ril_manager_test.h"
#include "telephony_log_wrapper.h"
#include <iostream>
#include "hril_notification.h"
#include <iostream>
#include "ril_manager_test.h"
#include "telephony_log_wrapper.h"
using namespace std;
using namespace OHOS::Telephony;
@ -35,11 +34,22 @@ RilRadioIndicationTest::~RilRadioIndicationTest() {}
int32_t RilRadioIndicationTest::OnRemoteRequest(
uint32_t code, OHOS::MessageParcel &data, OHOS::MessageParcel &reply, OHOS::MessageOption &option)
{
int32_t slotId = data.ReadInt32();
TELEPHONY_LOGI("RilAdapterTest ntf OnRemoteRequest code:%{public}d, slotId:%{public}d", code, slotId);
if (slotId != HRIL_SIM_SLOT_0) {
TELEPHONY_LOGE("RilAdapterTest ntf slotid abnormal");
auto reqToken = data.ReadInterfaceToken();
HRilResponseTypes responseType = HRIL_RESPONSE_NOTICE;
int32_t slotId = 0;
const uint8_t *spBuffer = data.ReadUnpadBuffer(sizeof(HRilResponseHeadInfo));
const HRilResponseHeadInfo *headInfo = reinterpret_cast<const HRilResponseHeadInfo *>(spBuffer);
if (headInfo != nullptr) {
slotId = headInfo->slotId;
responseType = headInfo->type;
} else {
TELEPHONY_LOGW("code:%{public}d, headInfo parsed is failed.", code);
}
TELEPHONY_LOGI("TOnRemoteRequest code:%{public}d, slotId:%{public}d, type:%{public}d", code, slotId, responseType);
if (slotId != HRIL_SIM_SLOT_0) {
TELEPHONY_LOGE("RilAdapterTest rsp slotid abnormal");
}
const int32_t DEFAULT_VALUE = HRIL_ERR_SUCCESS;
switch (code) {
case HNOTI_MODEM_RADIO_STATE_UPDATED:
@ -99,8 +109,7 @@ void RilRadioIndicationTest::RadioStateChange(OHOS::MessageParcel &data)
{
int32_t radioState = data.ReadInt32();
int32_t indicationType = data.ReadInt32();
std::cout << "---->[NTF] RadioStateChange:" << endl
<< "====> [radioState]: " << radioState << endl;
std::cout << "---->[NTF] RadioStateChange:" << endl << "====> [radioState]: " << radioState << endl;
TELEPHONY_LOGI(
"func :%{public}s indicationType: %{public}d state:%{public}d", __func__, indicationType, radioState);
}
@ -152,10 +161,8 @@ void RilRadioIndicationTest::CallEmergencyNumberReport(OHOS::MessageParcel &data
return;
}
emcInfo->ReadFromParcel(data);
cout << "====> [index]: " << emcInfo->index << "/" << emcInfo->total
<< "\tcategory: " << emcInfo->category
<< "\tmcc: " << emcInfo->mcc
<< "\teccNum: " << emcInfo->eccNum << endl;
cout << "====> [index]: " << emcInfo->index << "/" << emcInfo->total << "\tcategory: " << emcInfo->category
<< "\tmcc: " << emcInfo->mcc << "\teccNum: " << emcInfo->eccNum << endl;
}
void RilRadioIndicationTest::NetworkStateNotify(OHOS::MessageParcel &data)
@ -175,9 +182,9 @@ void RilRadioIndicationTest::NewSmsNotify(OHOS::MessageParcel &data)
smsMessageInfo.get()->ReadFromParcel(data);
int32_t indicationType = smsMessageInfo->indicationType;
cout << "---->[NTF] NewSms:" << endl
<< "====> [indicationType]: " << smsMessageInfo->indicationType << endl
<< "====> [size]: " << smsMessageInfo->size << endl
<< "====> [pdu]: ";
<< "====> [indicationType]: " << smsMessageInfo->indicationType << endl
<< "====> [size]: " << smsMessageInfo->size << endl
<< "====> [pdu]: ";
for (int i = 0; i < smsMessageInfo->pdu.size(); i++) {
printf("%02x", smsMessageInfo->pdu[i]);
}
@ -207,9 +214,9 @@ void RilRadioIndicationTest::SmsStatusReportNotify(OHOS::MessageParcel &data)
smsMessageInfo.get()->ReadFromParcel(data);
int32_t indicationType = smsMessageInfo.get()->indicationType;
cout << "---->[NTF] SmsStatusReport:" << endl
<< "====> [indicationType]: " << smsMessageInfo->indicationType << endl
<< "====> [size]: " << smsMessageInfo->size << endl
<< "====> [pdu]: ";
<< "====> [indicationType]: " << smsMessageInfo->indicationType << endl
<< "====> [size]: " << smsMessageInfo->size << endl
<< "====> [pdu]: ";
for (int i = 0; i < smsMessageInfo->pdu.size(); i++) {
printf("%02x", smsMessageInfo->pdu[i]);
}
@ -244,9 +251,7 @@ void RilRadioIndicationTest::GetSignalStrength(OHOS::MessageParcel &data)
TELEPHONY_LOGE("GetSignalStrength memcpy_s failed");
return;
}
cout << "---->[NTF] Network Signal Strength updated:" << endl;
cout << "====> [lte.rsrp]: " << mSignalStrength->lte.rsrp << endl;
TELEPHONY_LOGI("Network Signal Strength updated [lte.rsrp]: %{public}d", mSignalStrength->lte.rsrp);
}
void RilRadioIndicationTest::PdpContextListChangedNotify(OHOS::MessageParcel &data)
@ -257,8 +262,7 @@ void RilRadioIndicationTest::PdpContextListChangedNotify(OHOS::MessageParcel &da
return;
}
if (!dataCallList.get()->ReadFromParcel(data)) {
TELEPHONY_LOGE(
"ERROR : PdpContextListChangedNotify --> dataCallList.ReadFromParcel(data) failed !!!");
TELEPHONY_LOGE("ERROR : PdpContextListChangedNotify --> dataCallList.ReadFromParcel(data) failed !!!");
return;
}
TELEPHONY_LOGI("PdpContextListChangedNotify --> dataCallList.ReadFromParcel(data) success");
@ -343,8 +347,6 @@ void RilRadioIndicationTest::CallSsReport(OHOS::MessageParcel &data)
return;
}
ssInfo->ReadFromParcel(data);
cout << "====> serviceType: " << ssInfo->serviceType
<< "\trequestType: " << ssInfo->requestType
<< "\tserviceClass: " << ssInfo->serviceClass
<< "\tresult: " << ssInfo->result << endl;
cout << "====> serviceType: " << ssInfo->serviceType << "\trequestType: " << ssInfo->requestType
<< "\tserviceClass: " << ssInfo->serviceClass << "\tresult: " << ssInfo->result << endl;
}

View File

@ -17,8 +17,8 @@
#include <iostream>
#include "telephony_log_wrapper.h"
#include "hril_request.h"
#include "telephony_log_wrapper.h"
using namespace std;
using namespace OHOS::Telephony;
@ -32,12 +32,21 @@ RilRadioResponseTest::~RilRadioResponseTest() {}
int32_t RilRadioResponseTest::OnRemoteRequest(
uint32_t code, OHOS::MessageParcel &data, OHOS::MessageParcel &reply, OHOS::MessageOption &option)
{
int32_t slotId = data.ReadInt32();
TELEPHONY_LOGI("RilAdapterTest rsp OnRemoteRequest code:%{public}d, slotId:%{public}d", code, slotId);
auto reqToken = data.ReadInterfaceToken();
HRilResponseTypes responseType = HRIL_RESPONSE_NOTICE;
int32_t slotId = 0;
const uint8_t *spBuffer = data.ReadUnpadBuffer(sizeof(HRilResponseHeadInfo));
const HRilResponseHeadInfo *headInfo = reinterpret_cast<const HRilResponseHeadInfo *>(spBuffer);
if (headInfo != nullptr) {
slotId = headInfo->slotId;
responseType = headInfo->type;
} else {
TELEPHONY_LOGW("code:%{public}d, headInfo parsed is failed.", code);
}
TELEPHONY_LOGI("TOnRemoteRequest code:%{public}d, slotId:%{public}d, type:%{public}d", code, slotId, responseType);
if (slotId != HRIL_SIM_SLOT_0) {
TELEPHONY_LOGE("RilAdapterTest rsp slotid abnormal");
}
switch (code) {
case HREQ_CALL_GET_CALL_LIST:
OnResponseGetCallList(data);
@ -81,6 +90,21 @@ int32_t RilRadioResponseTest::OnRemoteRequest(
case HREQ_CALL_GET_MUTE:
OnResponseGetMute(data);
break;
case HREQ_SIM_CLOSE_LOGICAL_CHANNEL:
OnResponseNullPara("Set Sim Close Logical Channel Result", data);
break;
case HREQ_SIM_OPEN_LOGICAL_CHANNEL:
OnResponseNullPara("Set Sim Open Logical Channel Result", data);
break;
case HREQ_SIM_TRANSMIT_APDU_BASIC_CHANNEL:
OnResponseNullPara("Set Sim Transmit apdu basic channel Result", data);
break;
case HREQ_SIM_TRANSMIT_APDU_LOGICAL_CHANNEL:
OnResponseNullPara("Set sim transmit apdu logical channel Result", data);
break;
case HREQ_SIM_AUTHENTICATION:
OnResponseNullPara("Set Sim Authentication Result", data);
break;
case HREQ_CALL_GET_EMERGENCY_LIST:
OnResponseGetEmergencyList(data);
break;
@ -142,7 +166,7 @@ int32_t RilRadioResponseTest::OnRemoteRequest(
OnRequestSetNetworkPreferredNetworkModeTest(data);
break;
case HREQ_NETWORK_GET_PREFERRED_NETWORK:
OnRequestGetNetworkPreferredNetworkModeTest(data);
OnRequestGetNetworkPreferredNetworkModeTest(data);
break;
case HREQ_NETWORK_SET_PS_ATTACH_STATUS:
OnRequestSetNetworkPsAttachStatusTest(data);
@ -177,6 +201,33 @@ int32_t RilRadioResponseTest::OnRemoteRequest(
case HREQ_SMS_SET_SMSC_ADDR:
OnResponseSetSmscAddr(data);
break;
case HREQ_SIM_CHANGE_SIM_PASSWORD:
OnResponseLockStatus(data);
break;
case HREQ_SIM_SET_SIM_LOCK:
OnResponseLockStatus(data);
break;
case HREQ_SIM_UNLOCK_SIM_LOCK:
OnResponseLockStatus(data);
break;
case HREQ_SIM_SET_ACTIVE_SIM:
OnResponseNullPara("Set active sim Result", data);
break;
case HREQ_SIM_GET_SIM_LOCK_STATUS:
OnResponseGetSimLockStatus(data);
break;
case HREQ_SIM_UNLOCK_PIN:
OnResponseLockStatus(data);
break;
case HREQ_SIM_UNLOCK_PUK:
OnResponseLockStatus(data);
break;
case HREQ_SIM_UNLOCK_PIN2:
OnResponseLockStatus(data);
break;
case HREQ_SIM_UNLOCK_PUK2:
OnResponseLockStatus(data);
break;
default:
break;
}
@ -189,10 +240,10 @@ void PrintResponseInfo(const struct HRilRadioResponseInfo *rspInfo)
return;
}
cout << endl
// << "----> [flag]: " << rspInfo->flag << endl
<< "----> [serial]: " << rspInfo->serial << endl
<< "----> [error]: " << static_cast<int>(rspInfo->error) << endl
<< endl;
// << "----> [flag]: " << rspInfo->flag << endl
<< "----> [serial]: " << rspInfo->serial << endl
<< "----> [error]: " << static_cast<int>(rspInfo->error) << endl
<< endl;
}
void RilRadioResponseTest::OnResponseNullPara(std::string command, OHOS::MessageParcel &data)
@ -212,6 +263,30 @@ void RilRadioResponseTest::OnResponseNullPara(std::string command, OHOS::Message
TELEPHONY_LOGI("RilRadioResponseTest::OnResponseNullPara --> finished");
}
void RilRadioResponseTest::OnResponseLockStatus(MessageParcel &data)
{
TELEPHONY_LOGI("RilRadioResponseTest::OnResponseLockStatus -->");
const size_t readSpSize = sizeof(struct HRilRadioResponseInfo);
const uint8_t *spBuffer = data.ReadBuffer(readSpSize);
if (spBuffer == nullptr) {
TELEPHONY_LOGE("OnResponseLockStatus -->data.ReadBuffer(readSpSize) failed");
return;
}
const struct HRilRadioResponseInfo *responseInfo = reinterpret_cast<const struct HRilRadioResponseInfo *>(spBuffer);
const size_t readLockStatusSize = sizeof(HRilLockStatus);
const uint8_t *lockStatusBuffer = data.ReadBuffer(readLockStatusSize);
if (lockStatusBuffer == nullptr) {
TELEPHONY_LOGE("OnResponseLockStatus -->data.ReadBuffer(readLockStatusSize) failed");
return;
}
const HRilLockStatus *resp = reinterpret_cast<const HRilLockStatus *>(lockStatusBuffer);
cout << endl << "====>result: " << resp->result << endl;
cout << endl << "====>remain: " << resp->remain << endl;
cout << endl << "---->OnResponseLockStatus";
PrintResponseInfo(responseInfo);
}
void RilRadioResponseTest::OnResponseGetCallList(OHOS::MessageParcel &data)
{
TELEPHONY_LOGI("RilRadioResponseTest::OnResponseGetCallList -->");
@ -222,8 +297,7 @@ void RilRadioResponseTest::OnResponseGetCallList(OHOS::MessageParcel &data)
return;
}
const struct HRilRadioResponseInfo *responseInfo =
reinterpret_cast<const struct HRilRadioResponseInfo *>(spBuffer);
const struct HRilRadioResponseInfo *responseInfo = reinterpret_cast<const struct HRilRadioResponseInfo *>(spBuffer);
if (responseInfo->error == HRilErrType::NONE) {
std::shared_ptr<CallInfoList> callInfos = std::make_shared<CallInfoList>();
if (callInfos == nullptr) {
@ -233,10 +307,8 @@ void RilRadioResponseTest::OnResponseGetCallList(OHOS::MessageParcel &data)
callInfos.get()->ReadFromParcel(data);
cout << endl << "====>Call List Num: " << callInfos->callSize << endl;
for (int32_t i = 0; i < callInfos->callSize; i++) {
cout << "====> [index]: " << callInfos->calls[i].index
<< "\tdir: " << callInfos->calls[i].dir
<< "\tstate: " << callInfos->calls[i].state
<< "\tnumber: " << callInfos->calls[i].number << endl;
cout << "====> [index]: " << callInfos->calls[i].index << "\tdir: " << callInfos->calls[i].dir
<< "\tstate: " << callInfos->calls[i].state << "\tnumber: " << callInfos->calls[i].number << endl;
}
}
@ -254,8 +326,7 @@ void RilRadioResponseTest::OnResponseGetMute(OHOS::MessageParcel &data)
return;
}
const struct HRilRadioResponseInfo *responseInfo =
reinterpret_cast<const struct HRilRadioResponseInfo *>(spBuffer);
const struct HRilRadioResponseInfo *responseInfo = reinterpret_cast<const struct HRilRadioResponseInfo *>(spBuffer);
if (responseInfo->error == HRilErrType::NONE) {
int32_t mute = data.ReadInt32();
cout << endl << "====>Mute State: " << mute << endl;
@ -265,6 +336,25 @@ void RilRadioResponseTest::OnResponseGetMute(OHOS::MessageParcel &data)
PrintResponseInfo(responseInfo);
}
void RilRadioResponseTest::OnResponseGetSimLockStatus(OHOS::MessageParcel &data)
{
TELEPHONY_LOGI("RilRadioResponseTest::OnResponseGetSimLockStatus -->");
const size_t readSpSize = sizeof(struct HRilRadioResponseInfo);
const uint8_t *spBuffer = data.ReadBuffer(readSpSize);
if (spBuffer == nullptr) {
TELEPHONY_LOGE("OnResponseGetSimLockStatus -->data.ReadBuffer(readSpSize) failed");
return;
}
const struct HRilRadioResponseInfo *responseInfo = reinterpret_cast<const struct HRilRadioResponseInfo *>(spBuffer);
if (responseInfo->error == HRilErrType::NONE) {
int32_t simLockStatus = data.ReadInt32();
cout << endl << "====>Sim Lock Status: " << simLockStatus << endl;
}
cout << endl << "---->Get Sim Lock Status :";
PrintResponseInfo(responseInfo);
}
void RilRadioResponseTest::OnResponseGetEmergencyList(OHOS::MessageParcel &data)
{
TELEPHONY_LOGI("RilRadioResponseTest::OnResponseGetEmergencyList -->");
@ -275,8 +365,7 @@ void RilRadioResponseTest::OnResponseGetEmergencyList(OHOS::MessageParcel &data)
return;
}
const struct HRilRadioResponseInfo *responseInfo =
reinterpret_cast<const struct HRilRadioResponseInfo *>(spBuffer);
const struct HRilRadioResponseInfo *responseInfo = reinterpret_cast<const struct HRilRadioResponseInfo *>(spBuffer);
if (responseInfo->error == HRilErrType::NONE) {
std::shared_ptr<EmergencyInfoList> emergencyCallList = std::make_shared<EmergencyInfoList>();
if (emergencyCallList == nullptr) {
@ -288,9 +377,9 @@ void RilRadioResponseTest::OnResponseGetEmergencyList(OHOS::MessageParcel &data)
cout << endl << "====>Emergency List Num: " << emergencyCallList->callSize << endl;
for (int32_t i = 0; i < emergencyCallList->callSize; i++) {
cout << "====> [index]: " << emergencyCallList->calls[i].index
<< "\tcategory: " << emergencyCallList->calls[i].category
<< "\tmcc: " << emergencyCallList->calls[i].mcc
<< "\teccNum: " << emergencyCallList->calls[i].eccNum << endl;
<< "\tcategory: " << emergencyCallList->calls[i].category
<< "\tmcc: " << emergencyCallList->calls[i].mcc << "\teccNum: " << emergencyCallList->calls[i].eccNum
<< endl;
}
}
@ -308,8 +397,7 @@ void RilRadioResponseTest::OnResponseGetFailReason(OHOS::MessageParcel &data)
return;
}
const struct HRilRadioResponseInfo *responseInfo =
reinterpret_cast<const struct HRilRadioResponseInfo *>(spBuffer);
const struct HRilRadioResponseInfo *responseInfo = reinterpret_cast<const struct HRilRadioResponseInfo *>(spBuffer);
if (responseInfo->error == HRilErrType::NONE) {
int32_t reason = data.ReadInt32();
cout << endl << "====>Fail Reason: " << reason << endl;
@ -418,8 +506,7 @@ void RilRadioResponseTest::OnResponseGetRilCurrentCellInfo(OHOS::MessageParcel &
return;
}
if (!curCellInfo.get()->ReadFromParcel(data)) {
TELEPHONY_LOGE(
"ERROR : OnResponseGetRilCurrentCellInfo --> CurrentCellInfo.ReadFromParcel(data) failed !!!");
TELEPHONY_LOGE("ERROR : OnResponseGetRilCurrentCellInfo --> CurrentCellInfo.ReadFromParcel(data) failed !!!");
return;
}
const size_t readSpSize = sizeof(struct HRilRadioResponseInfo);
@ -438,7 +525,7 @@ void RilRadioResponseTest::OnResponseGetRilCurrentCellInfo(OHOS::MessageParcel &
cout << "OnResponseGetRilCurrentCellInfo: psc = " << curCellInfo->ServiceCellParas.wcdma.psc << endl;
cout << "OnResponseGetRilCurrentCellInfo: cellId = " << curCellInfo->ServiceCellParas.wcdma.cellId << endl;
cout << "OnResponseGetRilCurrentCellInfo: lac = " << curCellInfo->ServiceCellParas.wcdma.lac << endl;
cout << "OnResponseGetRilCurrentCellInfo: rscp = " << curCellInfo->ServiceCellParas.wcdma.rscp<< endl;
cout << "OnResponseGetRilCurrentCellInfo: rscp = " << curCellInfo->ServiceCellParas.wcdma.rscp << endl;
cout << "OnResponseGetRilCurrentCellInfo: rxlev = " << curCellInfo->ServiceCellParas.wcdma.rxlev << endl;
cout << "OnResponseGetRilCurrentCellInfo: ecno = " << curCellInfo->ServiceCellParas.wcdma.ecno << endl;
cout << "OnResponseGetRilCurrentCellInfo: drx = " << curCellInfo->ServiceCellParas.wcdma.drx << endl;
@ -635,8 +722,7 @@ void RilRadioResponseTest::OnResponseGetRadioState(OHOS::MessageParcel &data)
int32_t radioState = data.ReadInt32();
TELEPHONY_LOGI("OnResponseGetRadioStateResponse back");
cout << "---->OnResponseGetRadioStateResponse Result:" << endl
<< "----> [radioState]: " << radioState;
cout << "---->OnResponseGetRadioStateResponse Result:" << endl << "----> [radioState]: " << radioState;
PrintResponseInfo((struct HRilRadioResponseInfo *)spBuffer);
}
@ -653,8 +739,7 @@ void RilRadioResponseTest::OnResponseGetImei(OHOS::MessageParcel &data)
TELEPHONY_LOGI("OnResponseGetImeiResponse back");
cout << "---->OnResponseGetImeiResponse Result:" << endl
<< "----> [imeiId]: " << imeiId;
cout << "---->OnResponseGetImeiResponse Result:" << endl << "----> [imeiId]: " << imeiId;
PrintResponseInfo((struct HRilRadioResponseInfo *)spBuffer);
}
@ -746,8 +831,7 @@ void RilRadioResponseTest::OnResponseGetPdpContextList(OHOS::MessageParcel &data
return;
}
if (!dataCallList.get()->ReadFromParcel(data)) {
TELEPHONY_LOGE(
"ERROR : OnResponseGetPdpContextList --> dataCallList.ReadFromParcel(data) failed !!!");
TELEPHONY_LOGE("ERROR : OnResponseGetPdpContextList --> dataCallList.ReadFromParcel(data) failed !!!");
return;
}
TELEPHONY_LOGI("OnResponseGetPdpContextList --> dataCallList.ReadFromParcel(data) success");
@ -874,8 +958,7 @@ void RilRadioResponseTest::OnRequestGetNetworkSelectionModeTest(OHOS::MessagePar
}
if (!networkMode.get()->ReadFromParcel(data)) {
TELEPHONY_LOGE(
"ERROR : OnRequestGetNetworkSelectionModeTest --> ReadFromParcel(data) failed !!!");
TELEPHONY_LOGE("ERROR : OnRequestGetNetworkSelectionModeTest --> ReadFromParcel(data) failed !!!");
return;
}
@ -952,7 +1035,7 @@ void RilRadioResponseTest::OnRequestGetNetworkPreferredNetworkModeTest(OHOS::Mes
return;
}
cout << "OnRequestGetNetworkPreferredNetworkModeTest: preferredNetworkType = "
<< preferNetworkType->preferredNetworkType << endl;
<< preferNetworkType->preferredNetworkType << endl;
}
void RilRadioResponseTest::OnRequestGetModemVoiceRadioTest(OHOS::MessageParcel &data)
@ -965,8 +1048,7 @@ void RilRadioResponseTest::OnRequestGetModemVoiceRadioTest(OHOS::MessageParcel &
return;
}
const struct HRilRadioResponseInfo *responseInfo =
reinterpret_cast<const struct HRilRadioResponseInfo *>(spBuffer);
const struct HRilRadioResponseInfo *responseInfo = reinterpret_cast<const struct HRilRadioResponseInfo *>(spBuffer);
if (responseInfo->error == HRilErrType::NONE) {
std::shared_ptr<VoiceRadioTechnology> voiceRadioTech = std::make_shared<VoiceRadioTechnology>();
if (voiceRadioTech == nullptr) {
@ -1028,8 +1110,8 @@ void RilRadioResponseTest::OnRequestGetPreferredNetworkTypeInfoTest(OHOS::Messag
return;
}
networkType.get()->ReadFromParcel(data);
cout << "OnRequestGetPreferredNetworkTypeInfoTest: preferredNetworkType = "
<< networkType->preferredNetworkType << endl;
cout << "OnRequestGetPreferredNetworkTypeInfoTest: preferredNetworkType = " << networkType->preferredNetworkType
<< endl;
}
void RilRadioResponseTest::OnRequestGetLinkBandwidthInfoTest(OHOS::MessageParcel &data)
@ -1055,9 +1137,9 @@ void RilRadioResponseTest::OnResponseSendRilCmSms(OHOS::MessageParcel &data)
return;
}
cout << "---->OnResponseSendRilCmSms Result:" << endl
<< "----> [msgRef]: " << sendSmsResultInfo->msgRef << endl
<< "----> [pdu]: " << sendSmsResultInfo->pdu.c_str() << endl
<< "----> [errCode]: " << sendSmsResultInfo->errCode << endl;
<< "----> [msgRef]: " << sendSmsResultInfo->msgRef << endl
<< "----> [pdu]: " << sendSmsResultInfo->pdu.c_str() << endl
<< "----> [errCode]: " << sendSmsResultInfo->errCode << endl;
PrintResponseInfo((struct HRilRadioResponseInfo *)spBuffer);
}
@ -1073,9 +1155,9 @@ void RilRadioResponseTest::OnResponseSendRilCmSmsMoreMode(OHOS::MessageParcel &d
return;
}
cout << "---->OnResponseSendRilCmSmsMoreMode Result:" << endl
<< "----> [msgRef]: " << sendSmsResultInfo->msgRef << endl
<< "----> [pdu]: " << sendSmsResultInfo->pdu.c_str() << endl
<< "----> [errCode]: " << sendSmsResultInfo->errCode << endl;
<< "----> [msgRef]: " << sendSmsResultInfo->msgRef << endl
<< "----> [pdu]: " << sendSmsResultInfo->pdu.c_str() << endl
<< "----> [errCode]: " << sendSmsResultInfo->errCode << endl;
PrintResponseInfo((struct HRilRadioResponseInfo *)spBuffer);
}
@ -1104,8 +1186,8 @@ void RilRadioResponseTest::OnResponseGetSmscAddr(OHOS::MessageParcel &data)
return;
}
cout << "---->OnResponseGetSmscAddr Result:" << endl
<< "----> [tosca]: " << serCenterAddress->tosca << endl
<< "----> [address]: " << serCenterAddress->address.c_str() << endl;
<< "----> [tosca]: " << serCenterAddress->tosca << endl
<< "----> [address]: " << serCenterAddress->address.c_str() << endl;
PrintResponseInfo((struct HRilRadioResponseInfo *)spBuffer);
}

View File

@ -18,8 +18,8 @@
#include <iostream>
#include <unistd.h>
#include "telephony_log_wrapper.h"
#include "hril_request.h"
#include "telephony_log_wrapper.h"
using namespace std;
@ -501,9 +501,9 @@ void RilUnitTest::SendSmsAckTest(const OHOS::AppExecFwk::InnerEvent::Pointer &re
bool success;
int32_t cause;
cout << "send sms ack types are as follows:" << endl <<
"\t[0]: report OK" << endl <<
"\t[1]: report ERROR(Memory Capacity Exceeded)" << endl;
cout << "send sms ack types are as follows:" << endl
<< "\t[0]: report OK" << endl
<< "\t[1]: report ERROR(Memory Capacity Exceeded)" << endl;
int32_t ackType = InputInt32(0, 1, "ack type");
if (ackType == 1) {
success = 0;
@ -1008,31 +1008,31 @@ static int32_t PrintMenu()
static int32_t PrintCallMenu()
{
cout << "---->[MODULE]CALL:" << endl;
cout << "----> [" << HREQ_CALL_BASE << "] ---->Back to the previous menu." << endl;
cout << "----> [" << HREQ_CALL_GET_CALL_LIST << "] ---->[ HREQ_CALL_GET_CALL_LIST ]" << endl;
cout << "----> [" << HREQ_CALL_DIAL << "] ---->[ HREQ_CALL_DIAL ]" << endl;
cout << "----> [" << HREQ_CALL_HANGUP << "] ---->[ HREQ_CALL_HANGUP ]" << endl;
cout << "----> [" << HREQ_CALL_REJECT << "] ---->[ HREQ_CALL_REJECT ]" << endl;
cout << "----> [" << HREQ_CALL_ANSWER << "] ---->[ HREQ_CALL_ANSWER ]" << endl;
cout << "----> [" << HREQ_CALL_HOLD_CALL << "] ---->[ HREQ_CALL_HOLD_CALL ]" << endl;
cout << "----> [" << HREQ_CALL_UNHOLD_CALL << "] ---->[ HREQ_CALL_UNHOLD_CALL ]" << endl;
cout << "----> [" << HREQ_CALL_SWITCH_CALL << "] ---->[ HREQ_CALL_SWITCH_CALL ]" << endl;
cout << "----> [" << HREQ_CALL_BASE << "] ---->Back to the previous menu." << endl;
cout << "----> [" << HREQ_CALL_GET_CALL_LIST << "] ---->[ HREQ_CALL_GET_CALL_LIST ]" << endl;
cout << "----> [" << HREQ_CALL_DIAL << "] ---->[ HREQ_CALL_DIAL ]" << endl;
cout << "----> [" << HREQ_CALL_HANGUP << "] ---->[ HREQ_CALL_HANGUP ]" << endl;
cout << "----> [" << HREQ_CALL_REJECT << "] ---->[ HREQ_CALL_REJECT ]" << endl;
cout << "----> [" << HREQ_CALL_ANSWER << "] ---->[ HREQ_CALL_ANSWER ]" << endl;
cout << "----> [" << HREQ_CALL_HOLD_CALL << "] ---->[ HREQ_CALL_HOLD_CALL ]" << endl;
cout << "----> [" << HREQ_CALL_UNHOLD_CALL << "] ---->[ HREQ_CALL_UNHOLD_CALL ]" << endl;
cout << "----> [" << HREQ_CALL_SWITCH_CALL << "] ---->[ HREQ_CALL_SWITCH_CALL ]" << endl;
cout << "----> [" << HREQ_CALL_COMBINE_CONFERENCE << "] ---->[ HREQ_CALL_COMBINE_CONFERENCE ]" << endl;
cout << "----> [" << HREQ_CALL_SEPARATE_CONFERENCE << "] ---->[ HREQ_CALL_SEPARATE_CONFERENCE ]" << endl;
cout << "----> [" << HREQ_CALL_COMBINE_CONFERENCE << "] ---->[ HREQ_CALL_COMBINE_CONFERENCE ]" << endl;
cout << "----> [" << HREQ_CALL_SEPARATE_CONFERENCE << "] ---->[ HREQ_CALL_SEPARATE_CONFERENCE ]" << endl;
cout << "----> [" << HREQ_CALL_CALL_SUPPLEMENT << "] ---->[ HREQ_CALL_CALL_SUPPLEMENT ]" << endl;
cout << "----> [" << HREQ_CALL_SEND_DTMF << "] ---->[ HREQ_CALL_SEND_DTMF ]" << endl;
cout << "----> [" << HREQ_CALL_START_DTMF << "] ---->[ HREQ_CALL_START_DTMF ]" << endl;
cout << "----> [" << HREQ_CALL_STOP_DTMF << "] ---->[ HREQ_CALL_STOP_DTMF ]" << endl;
cout << "----> [" << HREQ_CALL_CALL_SUPPLEMENT << "] ---->[ HREQ_CALL_CALL_SUPPLEMENT ]" << endl;
cout << "----> [" << HREQ_CALL_SEND_DTMF << "] ---->[ HREQ_CALL_SEND_DTMF ]" << endl;
cout << "----> [" << HREQ_CALL_START_DTMF << "] ---->[ HREQ_CALL_START_DTMF ]" << endl;
cout << "----> [" << HREQ_CALL_STOP_DTMF << "] ---->[ HREQ_CALL_STOP_DTMF ]" << endl;
cout << "----> [" << HREQ_CALL_SET_USSD << "] ---->[ HREQ_CALL_SET_USSD ]" << endl;
cout << "----> [" << HREQ_CALL_GET_USSD << "] ---->[ HREQ_CALL_GET_USSD ]" << endl;
cout << "----> [" << HREQ_CALL_SET_USSD << "] ---->[ HREQ_CALL_SET_USSD ]" << endl;
cout << "----> [" << HREQ_CALL_GET_USSD << "] ---->[ HREQ_CALL_GET_USSD ]" << endl;
cout << "----> [" << HREQ_CALL_SET_MUTE << "] ---->[ HREQ_CALL_SET_MUTE ]" << endl;
cout << "----> [" << HREQ_CALL_GET_MUTE << "] ---->[ HREQ_CALL_GET_MUTE ]" << endl;
cout << "----> [" << HREQ_CALL_GET_EMERGENCY_LIST << "] ---->[ HREQ_CALL_GET_EMERGENCY_LIST ]" << endl;
cout << "----> [" << HREQ_CALL_GET_FAIL_REASON << "] ---->[ HREQ_CALL_GET_FAIL_REASON ]" << endl;
cout << "----> [" << HREQ_CALL_SET_MUTE << "] ---->[ HREQ_CALL_SET_MUTE ]" << endl;
cout << "----> [" << HREQ_CALL_GET_MUTE << "] ---->[ HREQ_CALL_GET_MUTE ]" << endl;
cout << "----> [" << HREQ_CALL_GET_EMERGENCY_LIST << "] ---->[ HREQ_CALL_GET_EMERGENCY_LIST ]" << endl;
cout << "----> [" << HREQ_CALL_GET_FAIL_REASON << "] ---->[ HREQ_CALL_GET_FAIL_REASON ]" << endl;
int32_t choice = InputInt32(HREQ_CALL_BASE, HREQ_SMS_BASE - 1, "Command");
cout << "---->You choose: " << choice << endl;
@ -1059,26 +1059,26 @@ static int32_t PrintSmsMenu()
static int32_t PrintSimMenu()
{
cout << "---->[MODULE]SIM:" << endl;
cout << "----> [" << HREQ_SIM_BASE << "] ---->Back to the previous menu." << endl;
cout << "----> [" << HREQ_SIM_GET_SIM_STATUS << "] ---->[ HREQ_SIM_GET_SIM_STATUS ]" << endl;
cout << "----> [" << HREQ_SIM_GET_IMSI << "] ---->[ HREQ_SIM_GET_IMSI ]" << endl;
cout << "----> [" << HREQ_SIM_GET_SIM_IO << "] ---->[ HREQ_SIM_GET_SIM_IO ]" << endl;
cout << "----> [" << HREQ_SIM_SET_ACTIVE_SIM << "] ---->[ HREQ_SIM_SET_ACTIVE_SIM ]" << endl;
cout << "----> [" << HREQ_SIM_OPEN_LOGICAL_CHANNEL << "] ---->[ HREQ_SIM_OPEN_LOGICAL_CHANNEL ]" << endl;
cout << "----> [" << HREQ_SIM_CLOSE_LOGICAL_CHANNEL << "] ---->[ HREQ_SIM_CLOSE_LOGICAL_CHANNEL ]" << endl;
cout << "----> [" << HREQ_SIM_TRANSMIT_APDU_LOGICAL_CHANNEL
<< "] ---->[ HREQ_SIM_TRANSMIT_APDU_LOGICAL_CHANNEL ]" << endl;
cout << "----> [" << HREQ_SIM_TRANSMIT_APDU_BASIC_CHANNEL
<< "] ---->[ HREQ_SIM_TRANSMIT_APDU_BASIC_CHANNEL ]" << endl;
cout << "----> [" << HREQ_SIM_AUTHENTICATION << "] ---->[ HREQ_SIM_AUTHENTICATION ]" << endl;
cout << "----> [" << HREQ_SIM_UNLOCK_SIM_LOCK << "] ---->[ HREQ_SIM_UNLOCK_SIM_LOCK ]" << endl;
cout << "----> [" << HREQ_SIM_UNLOCK_PIN << "] ---->[ HREQ_SIM_UNLOCK_PIN ]" << endl;
cout << "----> [" << HREQ_SIM_UNLOCK_PIN2 << "] ---->[ HREQ_SIM_UNLOCK_PIN2 ]" << endl;
cout << "----> [" << HREQ_SIM_UNLOCK_PUK << "] ---->[ HREQ_SIM_UNLOCK_PUK ]" << endl;
cout << "----> [" << HREQ_SIM_UNLOCK_PUK2 << "] ---->[ HREQ_SIM_UNLOCK_PUK2 ]" << endl;
cout << "----> [" << HREQ_SIM_CHANGE_SIM_PASSWORD << "] ---->[ HREQ_SIM_CHANGE_SIM_PASSWORD ]" << endl;
cout << "----> [" << HREQ_SIM_SET_SIM_LOCK << "] ---->[ HREQ_SIM_SET_SIM_LOCK ]" << endl;
cout << "----> [" << HREQ_SIM_GET_SIM_LOCK_STATUS << "] ---->[ HREQ_SIM_GET_SIM_LOCK_STATUS ]" << endl;
cout << "----> [" << HREQ_SIM_BASE << "] ---->Back to the previous menu." << endl;
cout << "----> [" << HREQ_SIM_GET_SIM_STATUS << "] ---->[ HREQ_SIM_GET_SIM_STATUS ]" << endl;
cout << "----> [" << HREQ_SIM_GET_IMSI << "] ---->[ HREQ_SIM_GET_IMSI ]" << endl;
cout << "----> [" << HREQ_SIM_GET_SIM_IO << "] ---->[ HREQ_SIM_GET_SIM_IO ]" << endl;
cout << "----> [" << HREQ_SIM_SET_ACTIVE_SIM << "] ---->[ HREQ_SIM_SET_ACTIVE_SIM ]" << endl;
cout << "----> [" << HREQ_SIM_OPEN_LOGICAL_CHANNEL << "] ---->[ HREQ_SIM_OPEN_LOGICAL_CHANNEL ]" << endl;
cout << "----> [" << HREQ_SIM_CLOSE_LOGICAL_CHANNEL << "] ---->[ HREQ_SIM_CLOSE_LOGICAL_CHANNEL ]" << endl;
cout << "----> [" << HREQ_SIM_TRANSMIT_APDU_LOGICAL_CHANNEL << "] ---->[ HREQ_SIM_TRANSMIT_APDU_LOGICAL_CHANNEL ]"
<< endl;
cout << "----> [" << HREQ_SIM_TRANSMIT_APDU_BASIC_CHANNEL << "] ---->[ HREQ_SIM_TRANSMIT_APDU_BASIC_CHANNEL ]"
<< endl;
cout << "----> [" << HREQ_SIM_AUTHENTICATION << "] ---->[ HREQ_SIM_AUTHENTICATION ]" << endl;
cout << "----> [" << HREQ_SIM_UNLOCK_SIM_LOCK << "] ---->[ HREQ_SIM_UNLOCK_SIM_LOCK ]" << endl;
cout << "----> [" << HREQ_SIM_UNLOCK_PIN << "] ---->[ HREQ_SIM_UNLOCK_PIN ]" << endl;
cout << "----> [" << HREQ_SIM_UNLOCK_PIN2 << "] ---->[ HREQ_SIM_UNLOCK_PIN2 ]" << endl;
cout << "----> [" << HREQ_SIM_UNLOCK_PUK << "] ---->[ HREQ_SIM_UNLOCK_PUK ]" << endl;
cout << "----> [" << HREQ_SIM_UNLOCK_PUK2 << "] ---->[ HREQ_SIM_UNLOCK_PUK2 ]" << endl;
cout << "----> [" << HREQ_SIM_CHANGE_SIM_PASSWORD << "] ---->[ HREQ_SIM_CHANGE_SIM_PASSWORD ]" << endl;
cout << "----> [" << HREQ_SIM_SET_SIM_LOCK << "] ---->[ HREQ_SIM_SET_SIM_LOCK ]" << endl;
cout << "----> [" << HREQ_SIM_GET_SIM_LOCK_STATUS << "] ---->[ HREQ_SIM_GET_SIM_LOCK_STATUS ]" << endl;
int32_t choice = InputInt32(HREQ_SIM_BASE, HREQ_DATA_BASE - 1, "Command");
cout << "---->You choose: " << choice << endl;
choice = (choice == HREQ_SIM_BASE) ? -1 : choice;
@ -1088,12 +1088,12 @@ static int32_t PrintSimMenu()
static int32_t PrintDataMenu()
{
cout << "---->[MODULE]DATA:" << endl;
cout << "----> [" << HREQ_DATA_BASE << "] ---->Back to the previous menu." << endl;
cout << "----> [" << HREQ_DATA_ACTIVATE_PDP_CONTEXT << "] ---->[ HREQ_DATA_ACTIVATE_PDP_CONTEXT ]" << endl;
cout << "----> [" << HREQ_DATA_DEACTIVATE_PDP_CONTEXT << "] ---->[ HREQ_DATA_DEACTIVATE_PDP_CONTEXT ]" << endl;
cout << "----> [" << HREQ_DATA_GET_LINK_BANDWIDTH_INFO << "] ---->[ HREQ_DATA_GET_LINK_BANDWIDTH_INFO ]" << endl;
cout << "----> [" << HREQ_DATA_GET_PDP_CONTEXT_LIST << "] ---->[ HREQ_DATA_GET_PDP_CONTEXT_LIST ]" << endl;
cout << "----> [" << HREQ_DATA_SET_INIT_APN_INFO << "] ---->[ HREQ_DATA_SET_INIT_APN_INFO ]" << endl;
cout << "----> [" << HREQ_DATA_BASE << "] ---->Back to the previous menu." << endl;
cout << "----> [" << HREQ_DATA_ACTIVATE_PDP_CONTEXT << "] ---->[ HREQ_DATA_ACTIVATE_PDP_CONTEXT ]" << endl;
cout << "----> [" << HREQ_DATA_DEACTIVATE_PDP_CONTEXT << "] ---->[ HREQ_DATA_DEACTIVATE_PDP_CONTEXT ]" << endl;
cout << "----> [" << HREQ_DATA_GET_LINK_BANDWIDTH_INFO << "] ---->[ HREQ_DATA_GET_LINK_BANDWIDTH_INFO ]" << endl;
cout << "----> [" << HREQ_DATA_GET_PDP_CONTEXT_LIST << "] ---->[ HREQ_DATA_GET_PDP_CONTEXT_LIST ]" << endl;
cout << "----> [" << HREQ_DATA_SET_INIT_APN_INFO << "] ---->[ HREQ_DATA_SET_INIT_APN_INFO ]" << endl;
int32_t choice = InputInt32(HREQ_DATA_BASE, HREQ_NETWORK_BASE - 1, "Command");
cout << "---->You choose: " << choice << endl;
@ -1104,32 +1104,31 @@ static int32_t PrintDataMenu()
static int32_t PrintNetworkMenu()
{
cout << "---->[MODULE]NETWORK:" << endl;
cout << "----> [" << HREQ_NETWORK_BASE << "] ---->Back to the previous menu." << endl;
cout << "----> [" << HREQ_NETWORK_GET_SIGNAL_STRENGTH << "] ---->[ HREQ_NETWORK_GET_SIGNAL_STRENGTH ]" << endl;
cout << "----> [" << HREQ_NETWORK_GET_CS_REG_STATUS << "] ---->[ HREQ_NETWORK_GET_CS_REG_STATUS ]" << endl;
cout << "----> [" << HREQ_NETWORK_GET_PS_REG_STATUS << "] ---->[ HREQ_NETWORK_GET_PS_REG_STATUS ]" << endl;
cout << "----> [" << HREQ_NETWORK_GET_OPERATOR_INFO << "] ---->[ HREQ_NETWORK_GET_OPERATOR_INFO ]" << endl;
cout << "----> [" << HREQ_NETWORK_BASE << "] ---->Back to the previous menu." << endl;
cout << "----> [" << HREQ_NETWORK_GET_SIGNAL_STRENGTH << "] ---->[ HREQ_NETWORK_GET_SIGNAL_STRENGTH ]" << endl;
cout << "----> [" << HREQ_NETWORK_GET_CS_REG_STATUS << "] ---->[ HREQ_NETWORK_GET_CS_REG_STATUS ]" << endl;
cout << "----> [" << HREQ_NETWORK_GET_PS_REG_STATUS << "] ---->[ HREQ_NETWORK_GET_PS_REG_STATUS ]" << endl;
cout << "----> [" << HREQ_NETWORK_GET_OPERATOR_INFO << "] ---->[ HREQ_NETWORK_GET_OPERATOR_INFO ]" << endl;
cout << "----> [" << HREQ_NETWORK_GET_NETWORK_SEARCH_INFORMATION
<< "] ---->[ HREQ_NETWORK_GET_NETWORK_SEARCH_INFORMATION ]" << endl;
<< "] ---->[ HREQ_NETWORK_GET_NETWORK_SEARCH_INFORMATION ]" << endl;
cout << "----> [" << HREQ_NETWORK_GET_NETWORK_SELECTION_MODE
<< "] ---->[ HREQ_NETWORK_GET_NETWORK_SELECTION_MODE ]" << endl;
cout << "----> [" << HREQ_NETWORK_GET_NETWORK_SELECTION_MODE << "] ---->[ HREQ_NETWORK_GET_NETWORK_SELECTION_MODE ]"
<< endl;
cout << "----> [" << HREQ_NETWORK_SET_NETWORK_SELECTION_MODE
<< "] ---->[ HREQ_NETWORK_SET_NETWORK_SELECTION_MODE ]" << endl;
cout << "----> [" << HREQ_NETWORK_SET_NETWORK_SELECTION_MODE << "] ---->[ HREQ_NETWORK_SET_NETWORK_SELECTION_MODE ]"
<< endl;
cout << "----> [" << HREQ_NETWORK_GET_NEIGHBORING_CELLINFO_LIST
<< "] ---->[ HREQ_NETWORK_GET_NEIGHBORING_CELLINFO_LIST ]" << endl;
<< "] ---->[ HREQ_NETWORK_GET_NEIGHBORING_CELLINFO_LIST ]" << endl;
cout << "----> [" << HREQ_NETWORK_GET_CURRENT_CELL_INFO << "] ---->[ HREQ_NETWORK_GET_CURRENT_CELL_INFO ]" << endl;
cout << "----> [" << HREQ_NETWORK_GET_PREFERRED_NETWORK << "] ---->[ HREQ_NETWORK_GET_PREFERRED_NETWORK ]" << endl;
cout << "----> [" << HREQ_NETWORK_SET_PREFERRED_NETWORK << "] ---->[ HREQ_NETWORK_SET_PREFERRED_NETWORK ]" << endl;
cout << "----> [" << HREQ_NETWORK_GET_IMS_REG_STATUS << "] ---->[ HREQ_NETWORK_GET_IMS_REG_STATUS ]" << endl;
cout << "----> [" << HREQ_NETWORK_SET_PS_ATTACH_STATUS << "] ---->[ HREQ_NETWORK_SET_PS_ATTACH_STATUS ]" << endl;
cout << "----> [" << HREQ_NETWORK_GET_PS_ATTACH_STATUS << "] ---->[ HREQ_NETWORK_GET_PS_ATTACH_STATUS ]" << endl;
cout << "----> [" << HREQ_NETWORK_SET_LOCATE_UPDATES << "] ---->[ HREQ_NETWORK_SET_LOCATE_UPDATES ]" << endl;
cout << "----> [" << HREQ_NETWORK_GET_IMS_REG_STATUS << "] ---->[ HREQ_NETWORK_GET_IMS_REG_STATUS ]" << endl;
cout << "----> [" << HREQ_NETWORK_SET_PS_ATTACH_STATUS << "] ---->[ HREQ_NETWORK_SET_PS_ATTACH_STATUS ]" << endl;
cout << "----> [" << HREQ_NETWORK_GET_PS_ATTACH_STATUS << "] ---->[ HREQ_NETWORK_GET_PS_ATTACH_STATUS ]" << endl;
cout << "----> [" << HREQ_NETWORK_SET_LOCATE_UPDATES << "] ---->[ HREQ_NETWORK_SET_LOCATE_UPDATES ]" << endl;
int32_t choice = InputInt32(HREQ_NETWORK_BASE, HREQ_COMMON_BASE - 1, "Command");
cout << "---->You choose: " << choice << endl;
choice = (choice == HREQ_NETWORK_BASE) ? -1 : choice;
@ -1139,7 +1138,7 @@ static int32_t PrintNetworkMenu()
static int32_t PrintModemMenu()
{
cout << "---->[MODULE]MODEM:" << endl;
cout << "----> [" << HREQ_COMMON_BASE << "] ---->Back to the previous menu." << endl;
cout << "----> [" << HREQ_COMMON_BASE << "] ---->Back to the previous menu." << endl;
cout << "----> [" << HREQ_MODEM_SET_RADIO_STATUS << "] ---->[ HREQ_MODEM_SET_RADIO_STATUS ]" << endl;
cout << "----> [" << HREQ_MODEM_GET_RADIO_STATUS << "] ---->[ HREQ_MODEM_GET_RADIO_STATUS ]" << endl;
cout << "----> [" << HREQ_MODEM_GET_IMEI << "] ---->[ HREQ_MODEM_GET_IMEI ]" << endl;