| /***************************************************************************** |
| * Copyright Statement: |
| * -------------------- |
| * Copyright (c) [2020], MediaTek Inc. All rights reserved. |
| * This software/firmware and related documentation ("MediaTek Software") are |
| * protected under relevant copyright laws. |
| * |
| * The information contained herein is confidential and proprietary to |
| * MediaTek Inc. and/or its licensors. Except as otherwise provided in the |
| * applicable licensing terms with MediaTek Inc. and/or its licensors, any |
| * reproduction, modification, use or disclosure of MediaTek Software, and |
| * information contained herein, in whole or in part, shall be strictly |
| * prohibited. |
| *****************************************************************************/ |
| #ifndef RPUTILS_H_ |
| #define RPUTILS_H_ |
| |
| #include <stdio.h> |
| #include <stdint.h> |
| #include <mtk_power.h> |
| #include <telephony/ril_cdma_sms.h> |
| #include <telephony/mtk_ril.h> |
| #include <telephony/mtk_ril_ivt.h> |
| #include <utils/Parcel.h> |
| #include <stddef.h> |
| #include <utils/Thread.h> |
| #include "utils/RefBase.h" |
| #include "utils/Errors.h" |
| #include <telephony/ril.h> |
| #include <string> |
| |
| #ifdef __cplusplus |
| extern "C" { |
| #endif |
| #include "mipc_msg_tlv_const.h" |
| #include "mipc_api.h" |
| #ifdef __cplusplus |
| } |
| #endif |
| |
| //#undef LOG_TAG |
| //#define LOG_TAG "test" |
| |
| #if 0 |
| #include "mtk_log.h" |
| #define MTK_RLOGE(fmt, args...) RLOGE("%s: " fmt, __FUNCTION__, ##args) |
| #define MTK_RLOGD(fmt, args...) RLOGD("%s: " fmt, __FUNCTION__, ##args) |
| #define MTK_RLOGW(fmt, args...) RLOGW("%s: " fmt, __FUNCTION__, ##args) |
| #define MTK_RLOGI(fmt, args...) RLOGI("%s: " fmt, __FUNCTION__, ##args) |
| #else |
| #define MTK_RLOGE(fmt, args...) printf("%s(%d): %s() "#fmt"\n",__FILE__,__LINE__,__func__,##args) |
| #define MTK_RLOGD(fmt, args...) printf("%s(%d): %s() "#fmt"\n",__FILE__,__LINE__,__func__,##args) |
| #define MTK_RLOGW(fmt, args...) printf("%s(%d): %s() "#fmt"\n",__FILE__,__LINE__,__func__,##args) |
| #define MTK_RLOGI(fmt, args...) printf("%s(%d): %s() "#fmt"\n",__FILE__,__LINE__,__func__,##args) |
| #endif |
| |
| #define BOOL_TO_INT(x) (x ? 1 : 0) |
| #define ATOI_NULL_HANDLED(x) (x ? atoi(x) : -1) |
| #define ATOI_NULL_HANDLED_DEF(x, defaultVal) (x ? atoi(x) : defaultVal) |
| |
| mipc_sim_ps_id_enum slot_id_to_mipc_sim_id(int slot_id); |
| RIL_SOCKET_ID mipc_sim_id_to_slot_id(mipc_sim_ps_id_enum id); |
| int hex2int(char c); |
| int str2byte(char *str, int len, char *byte_out); |
| std::string requestToString(int request); |
| |
| #endif /* RPUTILS_H_ */ |