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 I_SATELLITE_SMS_SERVICE_H 17 #define I_SATELLITE_SMS_SERVICE_H 18 19 #include "i_satellite_sms_callback.h" 20 #include "iremote_proxy.h" 21 #include "tel_event_handler.h" 22 #include "telephony_types.h" 23 24 namespace OHOS { 25 namespace Telephony { 26 using SatelliteMessage = GsmSimMessageParam; 27 28 class ISatelliteSmsService : public IRemoteBroker { 29 public: 30 DECLARE_INTERFACE_DESCRIPTOR(u"ohos.telephony.ISatelliteSmsService"); 31 32 public: 33 /** 34 * @brief Register CallBack to listen the response from SatelliteSmsService. 35 * 36 * @param slotId sim slot id 37 * @param what event to listen for 38 * @param sptr<ISatelliteSmsCallback> callback to handle the result 39 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 40 */ 41 virtual int32_t RegisterSmsNotify(int32_t slotId, int32_t what, const sptr<ISatelliteSmsCallback> &callback) = 0; 42 43 /** 44 * @brief Unregister CallBack to listen the response from SatelliteSmsService. 45 * 46 * @param slotId sim slot id 47 * @param what event to listen for 48 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 49 */ 50 virtual int32_t UnRegisterSmsNotify(int32_t slotId, int32_t what) = 0; 51 52 /** 53 * @brief SatelliteSmsService send message interface. 54 * 55 * @param slotId Indicates the card slot index number, 56 * ranging from {@code 0} to the maximum card slot index number supported by the device. 57 * @param eventId Corresponding event id. 58 * @param message Indicates the information of SMS message. 59 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 60 */ 61 virtual int32_t SendSms(int32_t slotId, int32_t eventId, SatelliteMessage &message) = 0; 62 63 /** 64 * @brief SatelliteSmsService send message interface. 65 * 66 * @param slotId Indicates the card slot index number, 67 * ranging from {@code 0} to the maximum card slot index number supported by the device. 68 * @param eventId Corresponding event id. 69 * @param message Indicates the information of SMS message. 70 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 71 */ 72 virtual int32_t SendSmsMoreMode(int32_t slotId, int32_t eventId, SatelliteMessage &message) = 0; 73 74 /** 75 * @brief SatelliteSmsService send ack interface. 76 * 77 * @param slotId Indicates the card slot index number, 78 * ranging from {@code 0} to the maximum card slot index number supported by the device. 79 * @param eventId Corresponding event id. 80 * @param success 81 * @param cause 82 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 83 */ 84 virtual int32_t SendSmsAck(int32_t slotId, int32_t eventId, bool success, int32_t cause) = 0; 85 }; 86 } // namespace Telephony 87 } // namespace OHOS 88 #endif // I_SATELLITE_SMS_SERVICE_H