1 /* 2 * Copyright (C) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef CDMA_SMS_TEST_H 17 #define CDMA_SMS_TEST_H 18 19 #include <memory> 20 21 #include "cdma_sms_common.h" 22 #include "cdma_sms_message.h" 23 #include "sms_send_indexer.h" 24 25 namespace OHOS { 26 namespace Telephony { 27 class CdmaSmsTest { 28 public: 29 void ProcessTest() const; 30 31 private: 32 void TestTextBasedSmsDelivery() const; 33 34 void TestEncodeSubmitMsg() const; 35 void TestEncodeDeliverReportMsg() const; 36 void TestEncodeCancelMsg() const; 37 void TestEncodeAckMsg() const; 38 39 void TestDecodeMsg() const; 40 void TestDecodeBearerData() const; 41 42 void SetPduSeqInfo(const std::size_t size, const std::unique_ptr<CdmaTransportMsg> &transMsg, 43 const std::size_t index, const uint8_t msgRef8bit) const; 44 void EncodeMsg(CdmaTransportMsg &msg) const; 45 void EncodeSubmitMsg( 46 std::string desAddr, std::string scAddr, std::string text, bool force7Bit, bool statusReport) const; 47 48 std::string UnicodeToString(uint8_t *s, int len) const; 49 50 void PrintAddr(TransportAddr &addr, std::string s = " ") const; 51 void PrintSubAddr(TransportSubAddr &addr, std::string s = " ") const; 52 void PrintSmsTeleSvcAddr(SmsTeleSvcAddr &addr, std::string s = " ") const; 53 void PrintHeader(const SmsUDH &header, std::string s = " ") const; 54 void PrintTimeAbs(SmsTimeAbs &time, std::string s = " ") const; 55 void PrintEncodeType(SmsEncodingType encodeType, std::string s = " ") const; 56 void PrintUserData(SmsTeleSvcUserData &userData, std::string s = " ") const; 57 void PrintCmasData(SmsTeleSvcCmasData cmasData, std::string s = " ") const; 58 void PrintSmsReplyOption(SmsReplyOption &replyOpt, std::string s = " ") const; 59 void PrintSmsValPeriod(SmsValPeriod &valPeriod, std::string s = " ") const; 60 void PrintSmsEnhancedVmn(SmsEnhancedVmn &vmn, std::string s = " ") const; 61 void PrintTeleserviceDeliver(TeleserviceDeliver &deliver, bool isCMAS, std::string s = " ") const; 62 void PrintTeleserviceSubmit(TeleserviceSubmit submit, std::string s = " ") const; 63 void PrintTeleserviceDeliverAck(TeleserviceDeliverAck deliveryAck, std::string s = " ") const; 64 void PrintTelesvc(CdmaTeleserviceMsg &telesvcMsg, bool isCMAS = false, std::string s = " ") const; 65 void PrintMsg(CdmaTransportMsg &msg) const; 66 }; 67 68 } // namespace Telephony 69 } // namespace OHOS 70 #endif