mirror of
https://gitee.com/beecue/fastbee.git
synced 2025-12-21 18:35:54 +08:00
更新硬件SDK
This commit is contained in:
@@ -0,0 +1,556 @@
|
||||
#ifndef __CMI_COMM_H__
|
||||
#define __CMI_COMM_H__
|
||||
/******************************************************************************
|
||||
Copyright: - 2017, All rights reserved by AirM2M Ltd.
|
||||
File name: - cmicomm.h
|
||||
Description: - CMI (CIoT modem interface) common interface defination
|
||||
History: - 08/09/2020, Originated by Jason
|
||||
******************************************************************************/
|
||||
#ifdef WIN32
|
||||
#include "pssys.h"
|
||||
#else
|
||||
#include "osasys.h"
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Same defination in: cms_def.h
|
||||
*/
|
||||
#define PS_BROADCAST_IND_HANDLER 0x0001
|
||||
|
||||
/*
|
||||
* used in CAM, this reserved for CAM SYNC API
|
||||
* Same defination in: cms_def.h: CAM_CMI_SYNC_REQ_START_HANDLER
|
||||
*/
|
||||
#define CMI_SYNC_REQ_NUM 16
|
||||
#define CMI_SYNC_REQ_START_HANDLER 0x0030
|
||||
#define CMI_SYNC_REQ_END_HANDLER (CMI_SYNC_REQ_START_HANDLER + CMI_SYNC_REQ_NUM - 1)
|
||||
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
******************************************************************************
|
||||
* STRUCT definition
|
||||
******************************************************************************
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
* MT error result code
|
||||
* refer: 27.007 9.2
|
||||
******************************************************************************/
|
||||
typedef enum MtErrorResultCode_TAG
|
||||
{
|
||||
CME_SUCC = 0,
|
||||
/*
|
||||
* 0 - 100 are reserved for general errors
|
||||
*/
|
||||
//CME_PHONE_FAILURE = 0, error 0 should not support for easy process
|
||||
CME_MT_NO_CONNECTION = 1,
|
||||
CME_MT_LINK_RESERVED,
|
||||
CME_OPERATION_NOT_ALLOW,
|
||||
CME_OPERATION_NOT_SUPPORT,
|
||||
CME_PH_SIM_PIN_REQ,
|
||||
CME_PH_FSIM_PIN_REQ,
|
||||
CME_PH_FSIM_PUK_REQ,
|
||||
|
||||
CME_SIM_NOT_INSERT = 10,
|
||||
CME_SIM_PIN_REQ,
|
||||
CME_SIM_PUK_REQ,
|
||||
CME_SIM_FAILURE,
|
||||
CME_SIM_BUSY,
|
||||
CME_SIM_WRONG,
|
||||
CME_INCORRECT_PASSWORD,
|
||||
CME_SIM_PIN2_REQ,
|
||||
CME_SIM_PUK2_REQ,
|
||||
CME_MEMORY_FULL = 20, /*accroding to 27.007 9.2.1*/
|
||||
CME_INVALID_INDEX,
|
||||
CME_NOT_FOUND,
|
||||
CME_MEMORY_FAILURE,
|
||||
CME_TEXT_STR_TOO_LONG,
|
||||
CME_INVALID_CHAR_IN_TXT_STR,
|
||||
CME_DIAL_STR_TOO_LONG,
|
||||
CME_INVALID_CHAR_IN_DIAL_STR = 27,
|
||||
CME_NO_NW_SERVICE = 30,
|
||||
CME_NW_TIMEOUT,
|
||||
CME_NW_NOT_ALLOWED_EC_ONLY, /*network not allowed - emergency calls only*/
|
||||
CME_NW_PERSONAL_PIN_REQ = 40, /*40 network personalization PIN required */
|
||||
CME_NW_PERSONAL_PUK_REQ, /*41 network personalization PUK required*/
|
||||
CME_NW_SUBSET_PERSONAL_PIN_REQ, /*42 network subset personalization PIN required*/
|
||||
CME_NW_SUBSET_PERSONAL_PUK_REQ, /*43 network subset personalization PUK required*/
|
||||
CME_SRV_PROVIDER_PERSONAL_PIN_REQ, /*44 service provider personalization PIN required*/
|
||||
CME_SRV_PROVIDER_PERSONAL_PUK_REQ, /*45 service provider personalization PUK required*/
|
||||
CME_CORPORATE_PERSONAL_PIN_REQ, /*46 corporate personalization PIN required*/
|
||||
CME_CORPORATE_PERSONAL_PUK_REQ, /*47 corporate personalization PUK required*/
|
||||
CME_HIDDEN_KEY_REQ, /*48 hidden key required (See NOTE 2)*/
|
||||
CME_EAP_METHOD_NOT_SUPPORT, /*49 EAP method not supported*/
|
||||
CME_INCORRECT_PARAM = 50, /*50 Incorrect parameters*/
|
||||
CME_CMD_IMPLEMENTED_BUT_CUR_DISABLED, /*51 command implemented but currently disabled*/
|
||||
CME_CMD_ABORT_BY_USER, /*52 command aborted by user*/
|
||||
CME_NOT_ATTACHED_DUE_TO_RESTRICT, /*53 not attached to network due to MT functionality restrictions*/
|
||||
CME_MODEM_NOT_ALLOWED_EC_ONLY, /*54 modem not allowed - MT restricted to emergency calls only*/
|
||||
CME_OPER_NOT_ALLOWED_DUE_TO_RESTRICT, /*55 operation not allowed because of MT functionality restrictions*/
|
||||
CME_FIXED_DIAL_NUM_ONLY, /*56 fixed dial number only allowed - called number is not a fixed dial number (refer 3GPP TS 22.101 [147])*/
|
||||
CME_TEMP_OOS_DUE_TO_OTHER_USAGE, /*57 temporarily out of service due to other MT usage*/
|
||||
CME_LANG_NOT_SUPPORT, /*58 language/alphabet not supported*/
|
||||
CME_UNEXPECTED_DATA_VALUE, /*59 unexpected data value*/
|
||||
CME_SYS_FAIL = 60, /*60 system failure*/
|
||||
CME_DATA_MISSING, /*61 data missing*/
|
||||
CME_CALL_BARRED, /*62 call barred*/
|
||||
CME_MSG_WAIT_IND_SUB_FAIL, /*63 message waiting indication subscription failure*/
|
||||
|
||||
/* ... */
|
||||
CME_UNKNOWN = 100,
|
||||
/*
|
||||
* 101 - 150 are reserved for use by GPRS and EPS
|
||||
*/
|
||||
CME_ILLEGAL_MS = 103,//#3
|
||||
CME_ILLEGAL_ME = 106,//#6
|
||||
CME_GPRS_SERVICES_NOT_ALLOWED = 107,//#7
|
||||
CME_GPRS_SERVICES_AND_NON_GPRS_SERVICES_NOT_ALLOWED = 108,//#8
|
||||
CME_PLMN_NOT_ALLOWED = 111,//#11
|
||||
CME_LOCATION_AREA_NOT_ALLOWED,//#12
|
||||
CME_ROAMING_NOT_ALLOWED_IN_THIS_LOCATION_AREA,//#13
|
||||
CME_GPRS_SERVICES_NOT_ALLOWED_IN_THIS_PLMN,//#14
|
||||
CME_NO_SUITABLE_CELLS_IN_LOCATION_AREA,//#15
|
||||
CME_PTI_MISMATCH = 121, /*121 PTI mismatch (#47)*/
|
||||
CME_CONGESTION = 122,//#22
|
||||
CME_INSUFFICIENT_RESOURCES = 126, /*126 Insufficient resources (#26)*/
|
||||
CME_MISSING_OR_UNKNOWN_APN, /*127 Missing or unknown APN (#27)*/
|
||||
CME_UNKNOWN_PDP_ADDRESS_OR_PDP_TYPE, /*128 Unknown PDN type (#28)*/
|
||||
CME_USER_AUTHENTICATION_FAILED, /*129 User authentication or authorization failed (#29)*/
|
||||
CME_ACTIVATE_REJECT_BY_GGSN_SERVING_GW_OR_PDN_GW, /*130 Activation rejected by Serving GW or PDN GW (#30)*/
|
||||
CME_ACTIVATE_REJECT_UNSPECIFIED, /*131 Request rejected, unspecified (#31)*/
|
||||
CME_SERVICE_OPTION_NOT_SUPPORTED, /*132 Service option not supported (#32)*/
|
||||
CME_REQUESTED_SERVICE_OPTION_NOT_SUBSCRIBED, /*133 Requested service option not subscribed (#33)*/
|
||||
CME_SERVICE_OPTION_TEMPORATILY_OUT_OF_ORDER, /*134 Service option temporarily out of order (#34)*/
|
||||
CME_PTI_ALREADY_IN_USE = 135, /*135 PTI already in use (#35)*/
|
||||
CME_REGULAR_DEACTIVATION, /*136 Regular deactivation (#36) NOTE 2*/
|
||||
CME_EPS_QOS_NOT_ACCEPT, /*137 EPS QoS not accepted (#37) NOTE 2*/
|
||||
CME_FEATURE_NOT_SUPPORTED = 140, /*140 Feature not supported (#40) -for UMTS */
|
||||
CME_SEMANTIC_ERRORS_IN_THE_TFT_OPERATION, /*141 Semantic error in the TFT operation (#41)*/
|
||||
CME_SYNTACTICAL_ERRORS_IN_THE_TFT_OPERATION,/*142 Syntactical error in the TFT operation (#42)*/
|
||||
CME_INVALID_EPS_ID, /*143 Invalid EPS bearer identity (#43)*/
|
||||
CME_SEMANTIC_ERRORS_IN_PACKET_FILTERS, /*144 Semantic errors in packet filter(s) (#44)*/
|
||||
CME_SYNTACTICAL_ERRORS_IN_PACKET_FILTERS, /*145 Syntactical errors in packet filter(s) (#45)*/
|
||||
CME_PDP_CONTEXT_WITHOUT_TFT_ALREADY_ACTIVATED, /*146 PDP context without TFT already activated (#46), -for UMTS*/
|
||||
CME_UNSPECIFIED_GPRS_ERROR = 148, /*148 Unspecified GPRS error, -for UMTS*/
|
||||
CME_PDP_AUTHENTICATION_FAILURE = 149, /*149 PDP authentication failure*/
|
||||
CME_INVALID_MOBILE_CLASS = 150, /*150 Invalid mobile class*/
|
||||
|
||||
|
||||
/*
|
||||
* 151 - 170 are reserved for use by VBS/VGCS and eMLPP
|
||||
*/
|
||||
|
||||
/*
|
||||
* 171 - 256 are reserved for use by GPRS or EPS
|
||||
*/
|
||||
CME_LAST_PDN_DISCONNECTION_NOT_ALLOWED = 171, /*171 Last PDN disconnection not allowed (#49)*/
|
||||
CME_SEMANTICALLY_INCORECT_MESSAGE, /*172 Semantically incorrect message (#95)*/
|
||||
CME_MANDATORY_INFORMATION_ELEMENT_ERROR, /*173 Invalid mandatory information (#96) NOTE 2*/
|
||||
CME_INFORMATION_ELEMENT_NON_EXISTENT_OR_NOT_IMPLEMENTED, /*174 Message type non-existent or not implemented (#97) NOTE 2*/
|
||||
CME_CONDITIONAL_IE_ERROR, /*175 Conditional IE error (#100) NOTE 2*/
|
||||
CME_PROTOCOL_ERROR_UNSPECIFIED, /*176 Protocol error, unspecified (#111) NOTE 2*/
|
||||
CME_OPERATOR_DETERMINED_BARRING, /*177 Operator determined barring (#8)*/
|
||||
CME_MAX_NUMBER_OF_PDP_CONTEXTS_REACHED, /*178 Maximum number of EPS bearers reached (#65)*/
|
||||
CME_REQUESTED_APN_NOT_SUPPORTED_IN_CURRENT_RAT_AND_PLMN_COMBINATION, /*179 Requested APN not supported in current RAT and PLMN combination (#66)*/
|
||||
CME_REQUEST_REJECTED_BEARER_CONTROL_MODE_VIOLATION, /*180 Request rejected, bearer control mode violation (#48) (UMTS)*/
|
||||
CME_UNSUPPORTED_QCI_VALUE = 181, /*181 unsupported QCI value (#59)*/
|
||||
CME_USER_DATA_TRANSMISSION_VIA_CONTROL_PLANE_IS_CONGESTED, /*182 User data transmission via control plane is congested*/
|
||||
|
||||
CME_INVALID_PTI_VALUE = 184, /*184 Invalid PTI value (#81)*/
|
||||
CME_MSG_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 186, /*186 Message not compatible with protocol state (#101) NOTE 2*/
|
||||
CME_NETWORK_FAILURE = 190, /*190 Network failure (#38) NOTE 2*/
|
||||
CME_REACTIVATION_REQUESTED, /*191 Reactivation requested (#39) NOTE 2*/
|
||||
CME_PDN_IPV4_ONLY_ALLOWED, /*192 PDN type IPv4 only allowed (#50) NOTE 2*/
|
||||
CME_PDN_IPV6_ONLY_ALLOWED, /*193 PDN type IPv6 only allowed (#51) NOTE 2*/
|
||||
CME_SINGLE_ADDRESS_BEARERS_ONLY_ALLOWED, /*194 Single address bearers only allowed (#52) NOTE 2*/
|
||||
CME_COLLISION_WITH_NETWORK_INITIATED_REQUEST, /*195 Collision with network initiated request (#56) NOTE 2*/
|
||||
CME_PDN_IPV4V6_ONLY_ALLOWED, /*196 PDN type IPv4v6 only allowed (#57) NOTE 2*/
|
||||
CME_PDN_NON_IP_ONLY_ALLOWED, /*197 PDN type non IP only allowed (#58) NOTE 2*/
|
||||
CME_BEARER_HANDLING_NOT_SUPPORTED, /*198 Bearer handling not supported (#60) NOTE 2*/
|
||||
CME_APN_RESTRICTION_VALUE_INCOMPATIBLE_WITH_ACTIVATE_PDP_CTX, /*199 APN restriction value incompatible with active PDP context (#112) NOTE 2*/
|
||||
CME_MULTIPLE_ACCESS_TO_A_PDN_NOW_ALLOWED = 200, /*200 Multiple accesses to a PDN connection not allowed (#113) NOTE 2*/
|
||||
CME_ESM_INFORMATION_NOT_RECEIVED, /*201 ESM information not received (#53) NOTE 2*/
|
||||
CME_PDN_CONNECTION_NOT_EXIST, /*202 PDN connection does not exist (#54) NOTE 2*/
|
||||
CME_MULTIPLE_PDN_CONNECTION_FOR_A_GIVEN_APN_NOT_ALLOWED, /*203 Multiple PDN connections for a given APN not allowed (#55) NOTE 2*/
|
||||
CME_MSG_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE, /*208 Message type not compatible with protocol state (#98) NOTE 2*/
|
||||
CME_INFO_ELEMENT_NOT_EXIST_OR_NOT_IMPLEMENTED = 209, /*209 Information element non-existent or not implemented (#99) NOTE 2*/
|
||||
|
||||
/*
|
||||
* 257 - 300 are reserved for general errors
|
||||
*/
|
||||
|
||||
/*
|
||||
* 301 - 0xFFFF are reserved for internal
|
||||
*/
|
||||
CME_INTERNAL_ERROR_BASE = 301,
|
||||
CME_UE_BUSY,
|
||||
//CME_OPERATION_NOT_SUPPORT,
|
||||
//CME_INVALID_INPUT_PARM,
|
||||
CME_NOT_POWER_ON,
|
||||
CME_PDN_NOT_ACTIVED,
|
||||
CME_PDN_NOT_VALID,
|
||||
CME_PDN_INVALID_TYPE, /* request default/dedicated bearer, but bearer is dedicated/default */
|
||||
CME_PDN_NO_PARAM,
|
||||
|
||||
CME_UE_FAIL,
|
||||
CME_PDP_APN_AND_PDN_TYPE_DUPLICATE_USED,//#309
|
||||
CME_PDP_PAP_AND_EITF_NOT_MATCHED,
|
||||
|
||||
CME_SIM_PIN_DISABLED,
|
||||
CME_SIM_PIN_ALREADY_ENABLED,
|
||||
//CME_SIM_PIN_BLOCKED,
|
||||
CME_SIM_PIN_WRONG_FORMAT,
|
||||
|
||||
CME_PS_INTERNAL_ERROR_MAX1 = 400,
|
||||
|
||||
/*
|
||||
* 401 - 500 are reserved for socket error.
|
||||
* Defined in: cms_sock_mgr.h
|
||||
*/
|
||||
|
||||
/*
|
||||
* 500 - 600 is reserved for REF error
|
||||
*/
|
||||
CME_REF_START_ERROR = 501,
|
||||
CME_REQ_PARAM_NOT_CFG = 512, //512 Required parameter not configured
|
||||
CME_TUP_NOT_REGISTERED = 513, //513 TUP not registered
|
||||
CME_AT_INTERNAL_ERROR, //514 AT internal error
|
||||
CME_CID_IS_ACT, //515 CID is active
|
||||
CME_INCORRECT_STATE_FOR_CMD, //516 Incorrect state for command
|
||||
CME_CID_INVALID, //517 CID is invalid
|
||||
CME_CID_NOT_ACT, //518 CID is not active
|
||||
CME_DEACT_LAST_ACT_CID = 520, //520 Deactivate the last active CID
|
||||
CME_CID_NOT_DEFINED, //521 CID is not defined
|
||||
CME_UART_PARITY_ERROR, //522 UART parity error
|
||||
CME_UART_FRAME_ERROR, //523 UART frame error
|
||||
CME_IN_CFUN0_STATE, //524 UE is in minimal function mode
|
||||
CME_CMD_ABORT_ONGOING, //525 AT command aborted: in processing
|
||||
CME_CMD_ABORT_ERROR, //526 AT command aborted: error
|
||||
CME_CMD_INTERRUPT, //527 Command interrupted
|
||||
CME_CFG_CONFLICT, //528 Configuration conflicts
|
||||
CME_DURING_FOTA_UPDATING, //529 During FOTA updating
|
||||
CME_NOT_AT_ALLOC_SOCKET = 530, //530 Not the AT allocated socket
|
||||
CME_USIM_PIN_BLOCKED, //531 USIM PIN is blocked
|
||||
CME_SIM_PIN_BLOCKED = CME_USIM_PIN_BLOCKED,
|
||||
CME_USIM_PUK_BLOCKED, //532 USIM PUK is blocked
|
||||
CME_NOT_MIPI_MODE, //533 Not mipi module
|
||||
CME_FILE_NOT_FOUND, //534 File not found
|
||||
CME_CONDITION_NOT_SATISFIED, //535 conditions of use not satisfied
|
||||
CME_AT_UART_BUF_ERROR, //536 AT UART buffer error
|
||||
CME_BACK_OFF_TIME_RUNNING, //537 Back off timer is running
|
||||
//...
|
||||
CME_REF_END_ERROR = 600,
|
||||
|
||||
|
||||
|
||||
|
||||
CME_MAX_ERROR = 0xFFFF
|
||||
}MtErrorResultCode;
|
||||
|
||||
typedef UINT16 CmiRcCode; //MtErrorResultCode/SmsErrorResultCode
|
||||
|
||||
/******************************************************************************
|
||||
* SMS error result code
|
||||
* refer: 27.005 3.2.5
|
||||
******************************************************************************/
|
||||
typedef enum SmsErrorResultCode_TAG
|
||||
{
|
||||
CMS_SMS_SUCC = 0,
|
||||
|
||||
/*
|
||||
* 300 - 500 are reserved for SMS errors
|
||||
*/
|
||||
CMS_SMS_ME_FAILURE = 300,
|
||||
CMS_SMS_SERVICE_OF_ME_RESV,
|
||||
CMS_SMS_OPERATION_NOT_ALLOWED,
|
||||
CMS_SMS_OPERATION_NOT_SUPPORTED,
|
||||
CMS_SMS_INVALID_PDU_MODE_PARAMETER,
|
||||
CMS_SMS_INVALID_TEXT_MODE_PARAMETER,
|
||||
CMS_SMS_USIM_NOT_INSERTED = 310,
|
||||
CMS_SMS_USIM_PIN_REQUIRED,
|
||||
CMS_SMS_PHSIM_PIN_REQUIRED,
|
||||
CMS_SMS_USIM_FAILURE,
|
||||
CMS_SMS_USIM_BUSY,
|
||||
CMS_SMS_USIM_WRONG,
|
||||
CMS_SMS_USIM_PUK_REQUIRED,
|
||||
CMS_SMS_USIM_PIN2_REQUIRED,
|
||||
CMS_SMS_USIM_PUK2_REQUIRED,
|
||||
CMS_SMS_MEMORY_FAILURE = 320,
|
||||
CMS_SMS_INVALID_MEM_INDEX,
|
||||
CMS_SMS_MEM_FULL,
|
||||
CMS_SMS_SMSC_ADDR_UNKNOWN = 330,
|
||||
CMS_SMS_NO_NETWORK_SERVICE,
|
||||
CMS_SMS_NETWORK_TIMEOUT,
|
||||
CMS_SMS_NO_CNMA_ACK_EXPECTED = 340,
|
||||
|
||||
CMS_SMS_UNKNOWN_ERROR = 500,
|
||||
CMS_SMS_INVALID_DATA = 550,
|
||||
|
||||
CMS_MAX_ERROR = 0xFFFF
|
||||
}SmsErrorResultCode;
|
||||
|
||||
typedef UINT16 CmiSmsErrorCode;
|
||||
|
||||
/******************************************************************************
|
||||
* CAM service group enum definition
|
||||
******************************************************************************/
|
||||
typedef enum CamSgIdEnum_Tag
|
||||
{
|
||||
CAM_BASE = 1,//basic/common
|
||||
CAM_DEV = 2,
|
||||
CAM_MM = 3,
|
||||
CAM_PS = 4,
|
||||
CAM_SIM = 5,
|
||||
CAM_SMS = 6,
|
||||
|
||||
CAM_MAX = 15
|
||||
}CamSgIdEnum;
|
||||
|
||||
/*
|
||||
* CMI SIGNAL ID, between AtCmdSrv Task & CAM/CCM Task
|
||||
*/
|
||||
typedef enum _SIG_EPAT_CAMCMISIGID_enum
|
||||
{
|
||||
SIG_CAM_CMI_BASE = 0x11F0,
|
||||
SIG_CAM_CMI_REQ,
|
||||
SIG_CAM_CMI_CNF,
|
||||
SIG_CAM_CMI_IND,
|
||||
SIG_CAM_CMI_RSP,
|
||||
SIG_CAM_CMI_SYNC_REQ, /* CamCmiSyncReq */
|
||||
SIG_CAM_CMI_END = 0x11FF,
|
||||
}CAMCMISIGID;
|
||||
|
||||
/*
|
||||
* Numberic PLMN format, 4 bytes,
|
||||
* example: CMCC: 46000; mcc = 0x0460, mnc = 0xf000
|
||||
*/
|
||||
typedef struct CmiNumericPlmn_Tag
|
||||
{
|
||||
UINT16 mcc;
|
||||
UINT16 mncWithAddInfo; // if 2-digit MNC type, the 4 MSB bits should set to 'F',
|
||||
}CmiNumericPlmn;
|
||||
|
||||
#define CAM_GET_PURE_MNC(mncWithAddInfo) ((mncWithAddInfo)&0xFFF)
|
||||
#define CAM_IS_2_DIGIT_MNC(mncWithAddInfo) (((mncWithAddInfo)>>12) == 0x0F)
|
||||
|
||||
#define CAM_SET_MNC_WITH_ADD_INFO(twoDigitType, pureMnc) ((twoDigitType)?((pureMnc)|0xF000):((pureMnc)&0xFFF))
|
||||
|
||||
|
||||
/*
|
||||
* IP address info
|
||||
*/
|
||||
#define CMI_IPV4_ADDR_LEN 4
|
||||
|
||||
#if 0
|
||||
typedef struct CmiIpv4Addr_Tag
|
||||
{
|
||||
UINT8 addr[CMI_IPV4_ADDR_LEN];
|
||||
}CmiIpv4Addr;
|
||||
#endif
|
||||
#define CMI_IPV6_ADDR_LEN 16
|
||||
|
||||
#if 0
|
||||
typedef struct CmiIpv6Addr_Tag
|
||||
{
|
||||
UINT8 addr[CMI_IPV6_ADDR_LEN];
|
||||
}CmiIpv6Addr;
|
||||
#endif
|
||||
|
||||
#define CMI_IPV6_INTERFACE_LEN 8
|
||||
|
||||
/*
|
||||
* IP address info
|
||||
*/
|
||||
#define CMI_MAX_IP_ADDR_LEN 16
|
||||
|
||||
/*
|
||||
* Address IP type
|
||||
*/
|
||||
typedef enum CmiIpAddrTypeTag
|
||||
{
|
||||
CMI_INVALID_IP_ADDR = 0,
|
||||
CMI_IPV4_ADDR, //4 bytes length
|
||||
CMI_IPV6_INTERFACE_ADDR,//8 bytes length
|
||||
CMI_FULL_IPV6_ADDR //16 bytes length
|
||||
}CmiIpAddrType;
|
||||
|
||||
typedef struct CmiIpAddrTag
|
||||
{
|
||||
UINT8 addrType; //CmiIpAddrType
|
||||
UINT8 subnetMaskLen; //if not set, set to 0
|
||||
UINT16 reserved0;
|
||||
|
||||
union {
|
||||
UINT8 ipv4[CMI_IPV4_ADDR_LEN];
|
||||
UINT8 ipv6If[CMI_IPV6_INTERFACE_LEN];
|
||||
UINT8 ipv6[CMI_IPV6_ADDR_LEN];
|
||||
UINT8 addr[CMI_MAX_IP_ADDR_LEN];
|
||||
}ip;
|
||||
}CmiIpAddr; //20 bytes
|
||||
|
||||
|
||||
#define CMI_SIM_MAX_IMSI_STRING_LENGTH 16
|
||||
/*
|
||||
* IMSI string structure, 20 bytes
|
||||
*/
|
||||
typedef struct CmiSimImsiStrTag
|
||||
{
|
||||
UINT8 length;
|
||||
BOOL bThreeDigitalMnc;
|
||||
UINT16 reserved0;
|
||||
/*example: IMSI: "460002343454245" */
|
||||
CHAR contents[CMI_SIM_MAX_IMSI_STRING_LENGTH];
|
||||
}CmiSimImsiStr;
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* CamCmiReq - SIG_CAM_CMI_REQ
|
||||
* CMI interface request, all other module (AT CMD server) use this signal to
|
||||
* access the CIOT modem
|
||||
* Int16 reqId; 4 MSB bits SG ID | 12 bits PRIM ID;
|
||||
* Int16 srcHandler; ID use to identify which module send this request
|
||||
* Int8 body[0]; request PRIM entity
|
||||
******************************************************************************/
|
||||
typedef struct CamCmiReqTag
|
||||
{
|
||||
struct {
|
||||
UINT16 reqId;
|
||||
UINT16 srcHandler;
|
||||
}header;
|
||||
|
||||
UINT8 body[];
|
||||
}CamCmiReq;
|
||||
|
||||
#define CAM_GET_SG_ID(reqId) (((reqId)>>12)&0x000f)
|
||||
#define CAM_GET_PRIM_ID(reqId) ((reqId)&0x0fff)
|
||||
#define CAM_SET_REQ_CNF_ID(sgId, primId) ((UINT16)(((sgId)<<12)|((primId)&0x0fff)))
|
||||
|
||||
/******************************************************************************
|
||||
* CamCmiCnf - SIG_CAM_CMI_CNF
|
||||
******************************************************************************/
|
||||
typedef struct CamCmiCnfTag
|
||||
{
|
||||
struct {
|
||||
UINT16 cnfId; //4 MSB bits SG ID | 12 bits PRIM ID
|
||||
UINT16 srcHandler; //Handler from CamCmiReq
|
||||
UINT16 rc;
|
||||
UINT16 reserved;
|
||||
}header;
|
||||
|
||||
UINT8 body[];
|
||||
}CamCmiCnf;
|
||||
|
||||
#define CAM_GET_CMICNF_FROM_BODY(pCmiBody) (CamCmiCnf *)(((UINT8 *)(pCmiBody)) - (UINT32)(OFFSETOF(CamCmiCnf, body)))
|
||||
|
||||
/******************************************************************************
|
||||
* CamCmiInd - SIG_CAM_CMI_IND
|
||||
******************************************************************************/
|
||||
typedef struct CamCmiIndTag
|
||||
{
|
||||
struct {
|
||||
UINT16 indId; //4 MSB bits SG ID | 12 bits PRIM ID
|
||||
/*
|
||||
* As some indication is triggered by some AT request, in such as need to fill this "reqHandler",
|
||||
* otherwise set to "PS_BROADCAST_IND_HANDLER".
|
||||
*/
|
||||
UINT16 reqHandler;
|
||||
}header;
|
||||
|
||||
UINT8 body[];
|
||||
}CamCmiInd;
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* CamCmiRsp - SIG_CAM_CMI_RSP
|
||||
******************************************************************************/
|
||||
typedef struct CamCmiRspTag
|
||||
{
|
||||
struct {
|
||||
UINT16 rspId; //4 MSB bits SG ID | 12 bits PRIM ID
|
||||
UINT16 rspHandler;
|
||||
}header;
|
||||
|
||||
UINT8 body[];
|
||||
}CamCmiRsp;
|
||||
|
||||
|
||||
#define CAM_GET_CMIIND_FROM_BODY(pCmiBody) (CamCmiInd *)(((UINT8 *)(pCmiBody)) - (UINT32)(OFFSETOF(CamCmiInd, body)))
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* CamCmiReq - SIG_CAM_CMI_SYNC_REQ
|
||||
* CMI interface request, all other module (AT CMD server) use this signal to
|
||||
* access the CIOT modem, and syn confirm
|
||||
******************************************************************************/
|
||||
typedef struct CamCmiSyncReqTag
|
||||
{
|
||||
osSemaphoreId_t sem;
|
||||
|
||||
/* output info */
|
||||
UINT32 *pCmiRc; /* MtErrorResultCode/SmsErrorResultCode */
|
||||
UINT16 cnfBufSize;
|
||||
UINT16 rsvd0;
|
||||
void *pOutCmiCnf; /* CMI confirm struct, CMI CNF, copy to here */
|
||||
|
||||
/* input info */
|
||||
CamCmiReq cmiReq;
|
||||
}CamCmiSyncReq;
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* If no parameters carried in signal, just pass a reserved Int32
|
||||
******************************************************************************/
|
||||
typedef UINT32 CamCmiEmptySig;
|
||||
//typedef UINT8 CamCmiEmptySig[]; // sizeof it == 0
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
******************************************************************************
|
||||
* API definition
|
||||
******************************************************************************
|
||||
******************************************************************************/
|
||||
/*
|
||||
* SIG_CAM_CMI_REQ to CAM task
|
||||
*/
|
||||
//void CamCmiRequest(UINT16 srcHdr, UINT8 sgId, UINT16 primId, UINT16 primSize, void *primBody);
|
||||
|
||||
/******************************************************************************
|
||||
* CamCmiSynReq
|
||||
* Description: Send "SIG_CAM_CMI_SYNC_REQ" to CAM task
|
||||
* input: UINT16 srcHdr;
|
||||
* UINT8 sgId; // CamSgIdEnum
|
||||
* UINT16 primId;// prim ID
|
||||
* UINT16 primSize; //prim body size
|
||||
* void *primBody; //prim body
|
||||
* output: UINT32 //MtErrorResultCode/SmsErrorResultCode
|
||||
* Comment:
|
||||
******************************************************************************/
|
||||
UINT32 CamCmiSynReq(UINT8 sgId, UINT16 primId, UINT16 primSize, const void *primBody, UINT16 outCnfSize, void *pOutCnfBody);
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* CamMmGetCurCELevel
|
||||
* Description: return current UE (NB/EMTC) Coverage Enhancement level
|
||||
* input: UINT8 *pAct; //output, current ACT: NB/EMTC
|
||||
* UINT8 *pCeLevel; //output, current CE level
|
||||
* output: void
|
||||
* Comment:
|
||||
* Return:
|
||||
* *pAct:
|
||||
* 0 CMI_MM_CES_NO_CE_ACT //UE not attached;
|
||||
* 1 CMI_MM_CES_EUTRAN_EMTC
|
||||
* 2 CMI_MM_CES_EC_GSM //not support
|
||||
* 3 CMI_MM_CES_EUTRAN_NB
|
||||
* *pCeLevel:
|
||||
* 0 No Coverage Enhancement in the serving cell
|
||||
* 1 Coverage Enhancement level 0
|
||||
* 2 Coverage Enhancement level 1
|
||||
* 3 Coverage Enhancement level 2
|
||||
* 4 Coverage Enhancement level 3 // for EMTC
|
||||
******************************************************************************/
|
||||
void CamMmGetCurCELevel(UINT8 *pAct, UINT8 *pCeLevel);
|
||||
|
||||
#endif
|
||||
|
||||
2593
sdk/合宙/air780e/csdk/luatos-soc-2022/PLAT/prebuild/PS/inc/cmidev.h
Normal file
2593
sdk/合宙/air780e/csdk/luatos-soc-2022/PLAT/prebuild/PS/inc/cmidev.h
Normal file
File diff suppressed because it is too large
Load Diff
1363
sdk/合宙/air780e/csdk/luatos-soc-2022/PLAT/prebuild/PS/inc/cmimm.h
Normal file
1363
sdk/合宙/air780e/csdk/luatos-soc-2022/PLAT/prebuild/PS/inc/cmimm.h
Normal file
File diff suppressed because it is too large
Load Diff
2344
sdk/合宙/air780e/csdk/luatos-soc-2022/PLAT/prebuild/PS/inc/cmips.h
Normal file
2344
sdk/合宙/air780e/csdk/luatos-soc-2022/PLAT/prebuild/PS/inc/cmips.h
Normal file
File diff suppressed because it is too large
Load Diff
1236
sdk/合宙/air780e/csdk/luatos-soc-2022/PLAT/prebuild/PS/inc/cmisim.h
Normal file
1236
sdk/合宙/air780e/csdk/luatos-soc-2022/PLAT/prebuild/PS/inc/cmisim.h
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,748 @@
|
||||
#ifndef __CMI_SMS_H__
|
||||
#define __CMI_SMS_H__
|
||||
/******************************************************************************
|
||||
Copyright: - 2017- Copyrights of AirM2M Ltd.
|
||||
File name: - cmisms.h
|
||||
Description: - CMI (CIoT modem interface) SMS handling interface defination
|
||||
History: - 10/12/2017, Originated by xpliu
|
||||
******************************************************************************/
|
||||
#include "cmicomm.h"
|
||||
|
||||
|
||||
typedef enum CMI_SMS_PRIM_ID_TAG
|
||||
{
|
||||
CMI_SMS_PRIM_BASE = 0,
|
||||
|
||||
CMI_SMS_SEND_MSG_REQ,//AT+CMGS=...<ctrl+z>
|
||||
CMI_SMS_SEND_MSG_CNF,
|
||||
|
||||
CMI_SMS_SEND_STORED_MSG_REQ,//AT+CMSS=<index>
|
||||
CMI_SMS_SEND_STORED_MSG_CNF,
|
||||
|
||||
CMI_SMS_SEND_COMMAND_REQ,//AT+CMGC=...<ctrl+z>
|
||||
CMI_SMS_SEND_COMMAND_CNF,
|
||||
|
||||
CMI_SMS_NEW_MSG_MEM_LOCATION_IND,//+CMTI
|
||||
CMI_SMS_NEW_MSG_IND,//+CMT
|
||||
CMI_SMS_NEW_MSG_RSP,//+CNMA
|
||||
|
||||
CMI_SMS_GET_SMSC_ADDR_REQ = 10,//AT+CSCA? //10
|
||||
CMI_SMS_GET_SMSC_ADDR_CNF,
|
||||
CMI_SMS_SET_SMSP_REQ,//AT+CSCA/CSMP
|
||||
CMI_SMS_SET_SMSP_CNF,
|
||||
|
||||
CMI_SMS_SELECT_MESSAGE_SERVICE_REQ, //AT+CSMS=
|
||||
CMI_SMS_SELECT_MESSAGE_SERVICE_CNF,
|
||||
CMI_SMS_GET_CURRENT_SMS_SERVICE_REQ, //AT+CSMS?
|
||||
CMI_SMS_GET_CURRENT_SMS_SERVICE_CNF,
|
||||
CMI_SMS_GET_SUPPORTED_SMS_SERVICE_REQ, //AT+CSMS=?
|
||||
CMI_SMS_GET_SUPPORTED_SMS_SERVICE_CNF,
|
||||
|
||||
CMI_SMS_SET_MORE_MESSAGE_MODE_REQ = 20, //AT+CMMS= //20
|
||||
CMI_SMS_SET_MORE_MESSAGE_MODE_CNF,
|
||||
CMI_SMS_GET_MORE_MESSAGE_MODE_REQ, //AT+CMMS?
|
||||
CMI_SMS_GET_MORE_MESSAGE_MODE_CNF,
|
||||
|
||||
CMI_SMS_GET_CSCB_SETTING_REQ,//AT+CSCB?
|
||||
CMI_SMS_GET_CSCB_SETTING_CNF,
|
||||
CMI_SMS_SET_CSCB_SETTING_REQ,//AT+CSCB=
|
||||
CMI_SMS_SET_CSCB_SETTING_CNF,
|
||||
|
||||
CMI_SMS_GET_SMS_MSG_RECORD_REQ, //+CMSS/+CMGR get SMS storaged message from SIM.
|
||||
CMI_SMS_GET_SMS_MSG_RECORD_CNF,
|
||||
|
||||
CMI_SMS_SET_SMS_MSG_RECORD_REQ = 30, //+CMGW save the SMS message to SIM //30
|
||||
CMI_SMS_SET_SMS_MSG_RECORD_CNF,
|
||||
|
||||
CMI_SMS_DEL_SMS_MSG_RECORD_REQ, //+CMGD, delet SMS message record in SIM
|
||||
CMI_SMS_DEL_SMS_MSG_RECORD_CNF,
|
||||
|
||||
CMI_SMS_LIST_SMS_MSG_RECORD_REQ, //+CMGL, List all SMS message record in SIM, +CPMS get statistics info of the SMS storage in SIM
|
||||
CMI_SMS_LIST_SMS_MSG_RECORD_CNF,
|
||||
|
||||
CMI_SMS_GET_SMS_STORAGE_STATUS_REQ, // +CPMS get statistics info of the SMS storage in SIM
|
||||
CMI_SMS_GET_SMS_STORAGE_STATUS_CNF,
|
||||
|
||||
CMI_SMS_SEND_SMMA_REQ, //send RP-SMMA
|
||||
CMI_SMS_SEND_SMMA_CNF,
|
||||
|
||||
CMI_SMS_MEM_CAP_IND = 40, //Report SMS Memory Capacity Exceeded flag
|
||||
|
||||
CMI_SMS_SET_MEM_CAP_REQ, //Setting SMS "Memory Capacity Exceeded" Notification Flag
|
||||
CMI_SMS_SET_MEM_CAP_CNF,
|
||||
|
||||
CMI_SMS_IDLE_STATUS_IND,
|
||||
|
||||
CMI_SMS_PRIM_END = 0x0fff
|
||||
}CMI_SMS_PRIM_ID;
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*****************************************************************************
|
||||
* STRUCT
|
||||
*****************************************************************************
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
* CMI_SMS_SEND_MSG_REQ
|
||||
******************************************************************************/
|
||||
#define CMI_SMS_MAX_PDU_SIZE 180
|
||||
#define CMI_SMS_MAX_LENGTH_OF_ADDRESS_VALUE 40
|
||||
|
||||
/* Refer to TS-27.005 3.1 Parameter definitions Parameter <Stat> for PDU mode */
|
||||
typedef enum CmiSmsRecStorStatus_Enum
|
||||
{
|
||||
CMI_SMS_STOR_STATUS_REC_UNREAD = 0, /* Received unread message, i.e new message */
|
||||
CMI_SMS_STOR_STATUS_REC_READ = 1, /* Received read message */
|
||||
CMI_SMS_STOR_STATUS_STO_UNSENT = 2, /* Stored unsent message only applicable to SMs */
|
||||
CMI_SMS_STOR_STATUS_STO_SENT = 3, /* Stored sent message only applicable to SMs */
|
||||
CMI_SMS_STOR_STATUS_ALL = 4, /* All message, only applicable to +CGML command */
|
||||
CMI_SMS_STOR_STATUS_END
|
||||
}CmiSmsRecStorStatus;
|
||||
|
||||
/*
|
||||
* enum to record current MSG/SMS operation
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
CMI_SMS_OPER_NULL,
|
||||
CMI_SMS_OPER_LIST_MSG_WITH_STATUS = 1, /* List all storaged SMS msg, +CMGL */
|
||||
CMI_SMS_OPER_STORE_INFO_GETTING, /* Get the SMS storaged memory information. for +CPMS? */
|
||||
CMI_SMS_OPER_STORE_INFO_SETTING, /* Set the SMS storaged memory information. for +CPMS= */
|
||||
CMI_SMS_OPER_READ_MSG, /* Read a SMS message, for +CMGR */
|
||||
CMI_SMS_OPER_READ_SEND_MSG, /* Read a SMS message and send it, for +CMSS */
|
||||
CMI_SMS_OPER_STORE_MT_MSG, /* Store the received SMS msg for MT SMS (+CMT/+CMTI) */
|
||||
CMI_SMS_OPER_STORE_MT_MSG_NO_RSP, /* Store the received SMS msg for MT SMS and no need send indication for Mem index. */
|
||||
CMI_SMS_OPER_STORE_CBM, /* Store the received Cell Broadcast msg for CBM (+CBM/+CBMI) */
|
||||
CMI_SMS_OPER_STORE_UNSENT_MSG, /* Store the Unsend message, for +CMGW */
|
||||
CMI_SMS_OPER_STORE_STATUS_RPT, /* Store the SMS status report, for (+CDS/+CDSI) */
|
||||
CMI_SMS_OPER_STORE_STATUS_RPT_NO_RSP, /* Store the SMS status report and no need send indication for Mem index */
|
||||
CMI_SMS_OPER_DEL_MSG_WITH_INDEX, /* Deleted a SMS messag with index, for +CMGD and delflag is NULL. */
|
||||
CMI_SMS_OPER_DEL_MSG_WITH_STATE, /* Deleted somes message with the status of SMS message, for +CMGD and delflag is not NULL */
|
||||
CMI_SMS_OPER_DEL_ALL_MSG, /* Deleted all SMS message. for +GMGD, and the delflag is 4. */
|
||||
CMI_SMS_OPER_DEL_INFO_GETTING, /* Get the SMS storaged memory information. for +CMGD=? */
|
||||
CMI_SMS_OPER_IS_SMSFULL, /* Get the SMS storaged memory information. for +ECSMSFULL */
|
||||
CMI_SMS_OPER_END
|
||||
}CmiSmsOperationMode;
|
||||
|
||||
/*
|
||||
* the result of read/write SMS message from/to Preferred storage memory. for API read/write SMS message
|
||||
*/
|
||||
typedef enum CmiSmsAccessMemRet_enum
|
||||
{
|
||||
CMS_ACC_MEM_RET_SUCC = 0,
|
||||
CMS_ACC_MEM_RET_CONTINUE = 1,
|
||||
|
||||
CMS_ACC_MEM_RET_FAIL = 100,
|
||||
CMS_ACC_MEM_RET_INVALID_PARAM = 101,
|
||||
CMS_ACC_MEM_RET_LIST_FULL = 102,
|
||||
CMS_ACC_MEM_RET_LIST_NOT_FOUND = 103,
|
||||
CMS_ACC_MEM_RET_OPER_NOT_SUPPROT = 104, /* operation not supported */
|
||||
CMS_ACC_MEM_RET_NO_MEM = 105,
|
||||
|
||||
CMS_ACC_MEM_RET_END
|
||||
}CmiSmsAccMemRet;
|
||||
|
||||
typedef struct _EPAT_CmiSmsPdu_Tag
|
||||
{
|
||||
UINT16 pduLength;
|
||||
UINT16 reserved0;
|
||||
UINT8 pduData[CMI_SMS_MAX_PDU_SIZE];
|
||||
}CmiSmsPdu;
|
||||
|
||||
/* Refer to TS 23.040-9.1.2.5 Address fields */
|
||||
typedef enum CmiSmsTypeOfNumberEnum_Tag
|
||||
{
|
||||
CMI_SMS_TYPE_OF_NUM_UNKNOWN = 0, /* Unknown */
|
||||
CMI_SMS_TYPE_OF_NUM_INTERNATIONAL = 1, /* Internation Number */
|
||||
CMI_SMS_TYPE_OF_NUM_NATIONAL = 2, /* National Number */
|
||||
CMI_SMS_TYPE_OF_NUM_NETWORK_SPECIFIC = 3, /* Network Specific */
|
||||
CMI_SMS_TYPE_OF_NUM_SUBSCRIBER = 4, /* Subscriber number */
|
||||
CMI_SMS_TYPE_OF_NUM_ALPHANUMERIC = 5, /* Alphanumeric, GSM 7-bit */
|
||||
CMI_SMS_TYPE_OF_NUM_EXTENSION = 7 /* Reserved for Extension */
|
||||
|
||||
}CmiSmsTypeOfNumberEnum;
|
||||
|
||||
typedef enum CmiSmsNumberPlanIdEnum_Tag
|
||||
{
|
||||
CMI_SMS_NUM_PLAN_ID_UNKNOWN = 0, /* Unknown */
|
||||
CMI_SMS_NUM_PLAN_ID_ISDN_TELEPHONY = 1, /* ISDN/telephony numbering plan */
|
||||
CMI_SMS_NUM_PLAN_ID_DATA = 3, /* Data Numbering Plan(X.121) */
|
||||
CMI_SMS_NUM_PLAN_ID_TELEX = 4, /* Telex Numbering Plan */
|
||||
CMI_SMS_NUM_PLAN_SERVICE_CENTRE_SPECIFIC = 5, /* Service Centre Specific plan */
|
||||
CMI_SMS_NUM_PLAN_ID_NATIONAL = 8, /* National Number Plan */
|
||||
CMI_SMS_NUM_PLAN_ID_PRIVATE = 9, /* Private Numbering Plan */
|
||||
CMI_SMS_NUM_PLAN_ID_ERMES = 10, /* ERMES numbering plan */
|
||||
CMI_SMS_NUM_PLAN_ID_RESERVED_FOR_EXTENSION = 15 /* Reserved for Extension */
|
||||
|
||||
}CmiSmsNumberPlanIdEnum;
|
||||
|
||||
typedef struct _EPAT_CmiSmsAddressType_Tag
|
||||
{
|
||||
UINT8 typeOfNumber; /* Type of Number CmiSmsTypeOfNumberEnum */
|
||||
UINT8 numberPlanId; /* Number Plan Identification CmiSmsNumberPlanIdEnum */
|
||||
UINT16 reserved0;
|
||||
}CmiSmsAddressType;
|
||||
|
||||
typedef struct _EPAT_CmiSmsAddressInfo_Tag
|
||||
{
|
||||
CmiSmsAddressType addressType; /* Address Type Information */
|
||||
UINT8 addressLength; /* Address Length in digits */
|
||||
UINT8 reserved0;
|
||||
UINT16 reserved1;
|
||||
UINT8 addressDigits[CMI_SMS_MAX_LENGTH_OF_ADDRESS_VALUE]; /* Address digits */
|
||||
}CmiSmsAddressInfo;
|
||||
|
||||
typedef struct CmiSmsOptAddressInfo_Tag
|
||||
{
|
||||
BOOL present; /* Address info present or not */
|
||||
UINT8 reserved0;
|
||||
UINT16 reserved1;
|
||||
CmiSmsAddressInfo addressInfo;
|
||||
}CmiSmsOptAddressInfo;
|
||||
|
||||
typedef enum CmiSmsRPCause_Tag
|
||||
{
|
||||
CMI_SMS_RP_CAUSE_UNASSIGNED_NUMBER = 1,
|
||||
CMI_SMS_RP_CAUSE_OPERATOR_DETERMIN_BARRING = 8,
|
||||
CMI_SMS_RP_CAUSE_BARRED = 10,
|
||||
CMI_SMS_RP_CAUSE_RESERVD = 11,
|
||||
CMI_SMS_RP_CAUSE_TRANSFER_REJECTED = 21,
|
||||
CMI_SMS_RP_CAUSE_NEMORY_EXCEED = 22,
|
||||
CMI_SMS_RP_CAUSE_DESTION_OUT_OF_ORDER = 27,
|
||||
CMI_SMS_RP_CAUSE_UNIDENTIFIED_FORMAT = 28,
|
||||
CMI_SMS_RP_CAUSE_FACILITY_REJECTED = 29,
|
||||
CMI_SMS_RP_CAUSE_UNKNOWN_SUBSCRIBER = 30,
|
||||
CMI_SMS_RP_CAUSE_NETWORK_OUT_OF_ORDER = 38,
|
||||
CMI_SMS_RP_CAUSE_TEMP_FAILURE = 41,
|
||||
CMI_SMS_RP_CAUSE_CONGETION = 42,
|
||||
CMI_SMS_RP_CAUSE_RESOURCE_UNAVAILABLE = 47,
|
||||
CMI_SMS_RP_CAUSE_REQ_FAC_NOT_SUBSCR = 50,
|
||||
CMI_SMS_RP_CAUSE_REQ_FACILITY_NOT_IMPLEMENT = 69,
|
||||
CMI_SMS_RP_CAUSE_INVALID_TI_VALUE = 81,
|
||||
CMI_SMS_RP_CAUSE_INVALID_MSG_SEMANTICALLY = 95,
|
||||
CMI_SMS_RP_CAUSE_MANDATORY_IE_ERROR = 96,
|
||||
CMI_SMS_RP_CAUSE_MSG_TYPE_NO_EXISTENT = 97,
|
||||
CMI_SMS_RP_CAUSE_MSG_NOT_COMPATIABLE = 98,
|
||||
CMI_SMS_RP_CAUSE_IE_NON_EXISTENT = 99,
|
||||
CMI_SMS_RP_CAUSE_PROTOCOL_ERROR = 111,
|
||||
CMI_SMS_RP_CAUSE_INTERWORKING = 127
|
||||
|
||||
}CmiSmsRPCause;
|
||||
|
||||
typedef struct CmiSmsSendMsgReq_Tag
|
||||
{
|
||||
CmiSmsOptAddressInfo optSca;
|
||||
CmiSmsPdu pdu;
|
||||
}CmiSmsSendMsgReq,CmiSmsSendStoredMsgReq;
|
||||
|
||||
typedef struct CmiSmsSendMsgCnf_Tag
|
||||
{
|
||||
UINT8 msgReference; /* Message Reference */
|
||||
UINT8 rpCause; /* RP cause */
|
||||
UINT8 tpCause; /* TP cause */
|
||||
BOOL ackPduPresent;
|
||||
UINT16 errorCode;
|
||||
UINT16 reserved1;
|
||||
CmiSmsPdu pdu;
|
||||
}CmiSmsSendMsgCnf, CmiSmsSendStoredMsgCnf, CmiSmsSendSMMACnf;
|
||||
|
||||
typedef struct CmiSmsRspInfo_Tag
|
||||
{
|
||||
CmiSmsErrorCode errorCode; /* Error code */
|
||||
UINT8 msgReference; /* Message Reference */
|
||||
UINT8 rpCause; /* RP cause */
|
||||
UINT8 tpCause; /* TP cause */
|
||||
CmiSmsPdu pdu;
|
||||
}CmiSmsRspInfo;
|
||||
|
||||
/******************************************************************************
|
||||
* CMI_SMS_SEND_COMMAND_REQ
|
||||
******************************************************************************/
|
||||
|
||||
typedef struct CmiSmsCmdRspInfo_Tag
|
||||
{
|
||||
CmiSmsErrorCode errorCode;
|
||||
UINT8 msgReference; /* Message Reference */
|
||||
}CmiSmsCmdRspInfo;
|
||||
|
||||
typedef struct CmiSmsSendCommandReq_Tag
|
||||
{
|
||||
CmiSmsPdu pdu;
|
||||
}CmiSmsSendCommandReq;
|
||||
|
||||
typedef struct CmiSmsSendCommandCnf_Tag
|
||||
{
|
||||
UINT8 msgReference; /* Message Reference */
|
||||
BOOL ackPduPresent;
|
||||
CmiSmsPdu pdu;
|
||||
}CmiSmsSendCommandCnf;
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*****************************************************************************
|
||||
* STRUCT
|
||||
*****************************************************************************
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
* CMI_SMS_NEWMSG_IND
|
||||
******************************************************************************/
|
||||
typedef enum CmiSmsMsgCoding_Tag
|
||||
{
|
||||
CMI_SMS_CODING_DEFAULT_ALPHABET = 0, /* Default 7 bit coding */
|
||||
CMI_SMS_CODING_8_BIT_DATA = 1, /* 8bit coding */
|
||||
CMI_SMS_CODING_UCS2_ALPHABET = 3, /* UCS2 coding */
|
||||
|
||||
}CmiSmsMsgCoding;
|
||||
|
||||
typedef enum CmiSmsMessageType_Tag
|
||||
{
|
||||
CMI_SMS_TYPE_DELIVER = 0, /* SMS-Deliver PDU */
|
||||
CMI_SMS_TYPE_DELIVER_REPORT, /* SMS-Deliver Report PDU */
|
||||
CMI_SMS_TYPE_STATUS_REPORT, /* SMS-Status Report PDU */
|
||||
CMI_SMS_TYPE_CB_ETWS_CMAS, /* CB SMS */
|
||||
CMI_SMS_TYPE_SUBMIT, /* SMS-SUBMIT */
|
||||
CMI_SMS_TYPE_COMMAND, /* SMS-COMMAND */
|
||||
|
||||
CMI_SMS_TYPE_RESERVE
|
||||
}CmiSmsMessageType;
|
||||
|
||||
typedef enum CmiSmsMessageClass_Tag
|
||||
{
|
||||
CMI_SMS_MESSAGE_CLASS0 = 0x00,
|
||||
CMI_SMS_MESSAGE_CLASS1 = 0x01,
|
||||
CMI_SMS_MESSAGE_CLASS2 = 0x02,
|
||||
CMI_SMS_MESSAGE_CLASS3 = 0x03,
|
||||
CMI_SMS_NO_MESSAGE_CLASS,
|
||||
}CmiSmsMessageClass;
|
||||
|
||||
/* Refer to TS-27.005 3.4.1 <mt> SMS-DELIVER report mode configured by +CNMI
|
||||
* spec 27.005 Table 3.4.1-2 <mt> parameter
|
||||
*/
|
||||
typedef enum CmiSmsDeliverRptMode_Tag
|
||||
{
|
||||
CMI_SMS_DELIVER_RPT_MODE_0 = 0,
|
||||
CMI_SMS_DELIVER_RPT_MODE_1 = 1,
|
||||
CMI_SMS_DELIVER_RPT_MODE_2 = 2,
|
||||
CMI_SMS_DELIVER_RPT_MODE_3 = 3,
|
||||
CMI_SMS_DELIVER_RPT_RESERVE
|
||||
}CmiSmsDeliverRptMode;
|
||||
|
||||
/* Refer to TS-27.005 3.4.1 <bm> CBM(Cell Broadcast Message) report mode configured by +CNMI
|
||||
* spec 27.005 Table 3.4.1-4 <bm> parameter
|
||||
*/
|
||||
typedef enum CmiSmsCbmRptMode_Tag
|
||||
{
|
||||
CMI_SMS_CBM_RPT_MODE_0 = 0,
|
||||
CMI_SMS_CBM_RPT_MODE_1 = 1,
|
||||
CMI_SMS_CBM_RPT_MODE_2 = 2,
|
||||
CMI_SMS_CBM_RPT_MODE_3 = 3,
|
||||
CMI_SMS_CBM_RPT_RESERVE
|
||||
}CmiSmsCbmRptMode;
|
||||
|
||||
/* Refer to TS-27.005 3.4.1 <ds> SMS-STATUS-REPORTs report mode configured by +CNMI
|
||||
* spec 27.005 Table 3.4.1-5 <ds> parameter
|
||||
*/
|
||||
typedef enum CmiSmsStatusRptMode_Tag
|
||||
{
|
||||
CMI_SMS_STATUS_RPT_MODE_0 = 0,
|
||||
CMI_SMS_STATUS_RPT_MODE_1 = 1,
|
||||
CMI_SMS_STATUS_RPT_MODE_2 = 2,
|
||||
CMI_SMS_STATUS_RPT_RESERVE
|
||||
}CmiSmsStatusRptMode;
|
||||
|
||||
/* Refer to TS-27.005 3.1 Parameter definitions Parameter <mem1>/<mem2>/<mem3> */
|
||||
typedef enum CmiSmsStorage_Tag
|
||||
{
|
||||
CMI_SMS_STORAGE_BM = 0, /* BM(Broadcast Message) Storage */
|
||||
CMI_SMS_STORAGE_ME = 1, /* ME Storage */
|
||||
CMI_SMS_STORAGE_MT = 2, /* MT Storage */
|
||||
CMI_SMS_STORAGE_SM = 3, /* SIM Storage */
|
||||
CMI_SMS_STORAGE_TA = 4, /* TA message storage */
|
||||
CMI_SMS_STORAGE_SR = 5 /* SMS-Status Report Storage */
|
||||
|
||||
}CmiSmsStorage;
|
||||
|
||||
/* Display SMS content AT command */
|
||||
typedef enum CmiSmsDisplayCmd_Tag
|
||||
{
|
||||
CMI_SMS_SHOW_CMGR = 0, //+CMGR
|
||||
CMI_SMS_SHOW_CMGL = 1, //+CMGL
|
||||
CMI_SMS_SHOW_CMT = 2, //+CMT
|
||||
CMI_SMS_SHOW_CMTI = 3, //+CMTI
|
||||
CMI_SMS_SHOW_CBM = 4, //+CBM
|
||||
CMI_SMS_SHOW_CBMI = 5, //+CBMI
|
||||
CMI_SMS_SHOW_CDS = 6, //+CDS
|
||||
CMI_SMS_SHOW_CDSI = 7, //+CDSI
|
||||
CMI_SMS_SHOW_ECCMGR = 8, //+ECMGR
|
||||
CMI_SMS_DISPLAY_END
|
||||
|
||||
} CmiSmsDisplayCmd;
|
||||
|
||||
typedef struct CmiNewSmsInfo_Tag
|
||||
{
|
||||
UINT8 smsType; /* CmiSmsMessageType */
|
||||
UINT8 smsId;
|
||||
UINT8 smsCoding; /* CmiSmsMsgCoding */
|
||||
UINT8 smsClass; /* SmsMessageClass */
|
||||
}CmiNewSmsInfo;
|
||||
|
||||
typedef struct CmiSmsNewMsgInd_Tag
|
||||
{
|
||||
UINT8 smsType; /* CmiSmsMessageType */
|
||||
UINT8 smsId;
|
||||
UINT8 smsCoding; /* CmiSmsMsgCoding */
|
||||
UINT8 smsClass; /* SmsMessageClass */
|
||||
BOOL smscPresent;
|
||||
UINT8 reserved0;
|
||||
UINT16 reserved1;
|
||||
CmiSmsAddressInfo smscAddress;
|
||||
CmiSmsPdu pdu;
|
||||
}CmiSmsNewMsgInd;
|
||||
|
||||
/******************************************************************************
|
||||
* CMI_SMS_NEW_MSG_MEM_LOCATION_IND
|
||||
******************************************************************************/
|
||||
typedef struct CmiSmsNewMsgMemLocationInd_Tag
|
||||
{
|
||||
UINT16 rc;
|
||||
UINT8 index;
|
||||
UINT8 operatmode; /* CmiSmsOperationMode */
|
||||
}CmiSmsNewMsgMemLocationInd;
|
||||
|
||||
/******************************************************************************
|
||||
* CMI_SMS_NEW_MSG_RSP
|
||||
******************************************************************************/
|
||||
typedef struct CmiSmsNewMsgRsp_Tag
|
||||
{
|
||||
BOOL bRPAck;
|
||||
UINT8 smsId;
|
||||
UINT8 tpCause;
|
||||
BOOL pduPresent;
|
||||
CmiSmsPdu pdu;
|
||||
}CmiSmsNewMsgRsp;
|
||||
|
||||
typedef CamCmiEmptySig CmiSmsGetScAddressRequest;
|
||||
|
||||
typedef struct CmiSmsGetScAddressConfirm_Tag
|
||||
{
|
||||
BOOL smscPresent;
|
||||
UINT8 reserved0;
|
||||
UINT16 reserved1;
|
||||
CmiSmsAddressInfo smscAddress; /* Service center address */
|
||||
}CmiSmsGetScAddressConfirm;
|
||||
|
||||
typedef struct CmiSmsSetSmspRequest_Tag
|
||||
{
|
||||
BOOL destAddrPresent;
|
||||
BOOL protocolIdPresent;
|
||||
BOOL codingSchemePresent;
|
||||
BOOL validityPeriodPresent;
|
||||
CmiSmsAddressInfo destAddr;
|
||||
CmiSmsAddressInfo smscAddress; /* Service center address */
|
||||
UINT8 smsProtocolId;
|
||||
UINT8 smsDataCodingScheme;
|
||||
UINT8 validityPeriod;
|
||||
BOOL scAddrPresent;
|
||||
}CmiSmsSetSmspRequest;
|
||||
|
||||
typedef CamCmiEmptySig CmiSmsSetSmspCnfonfirm;
|
||||
|
||||
#define SMS_SERVICE_NUM 3
|
||||
|
||||
typedef enum CmiSmsMessageService_Tag
|
||||
{
|
||||
CMI_SMS_MESSAGE_SERVICE_NO_ACKNOWLEDGEMENT = 0, /* no acknowledgement */
|
||||
CMI_SMS_MESSAGE_SERVICE_ACKNOWLEDGEMENT = 1, /* acknowledgement */
|
||||
/* 2...127 reserved */
|
||||
CMI_SMS_MESSAGE_SERVICE_MANUFACTURER_SPECIFIC = 128 /* manufacturer specific */
|
||||
|
||||
}CmiSmsMessageService;
|
||||
|
||||
typedef struct CmiSmsTypesOfMessages_Tag
|
||||
{
|
||||
BOOL mtTypeSupported;
|
||||
BOOL moTypeSupported;
|
||||
BOOL bmTypeSupported;
|
||||
}CmiSmsTypesOfMessages;
|
||||
|
||||
typedef CamCmiEmptySig CmiSmsGetSupportedSmsServiceReq;
|
||||
|
||||
typedef struct CmiSmsGetSupportedSmsServiceCnf_Tag
|
||||
{
|
||||
CmiSmsErrorCode errorCode;
|
||||
UINT8 length;
|
||||
CmiSmsMessageService serviceList[SMS_SERVICE_NUM];
|
||||
}CmiSmsGetSupportedSmsServiceCnf;
|
||||
|
||||
typedef struct CmiSmsSelectMessageServiceReq_Tag
|
||||
{
|
||||
CmiSmsMessageService smsMsgService;
|
||||
}CmiSmsSelectMessageServiceReq;
|
||||
|
||||
typedef struct CmiSmsSelectMessageServiceCnf_Tag
|
||||
{
|
||||
CmiSmsErrorCode errorCode;
|
||||
CmiSmsTypesOfMessages typeOfMessage;
|
||||
}CmiSmsSelectMessageServiceCnf;
|
||||
|
||||
typedef CamCmiEmptySig CmiSmsGetCurrentSmsServiceReq;
|
||||
|
||||
typedef struct CmiSmsGetCurrentSmsServiceCnf_Tag
|
||||
{
|
||||
CmiSmsErrorCode errorCode;
|
||||
CmiSmsMessageService smsMsgService;
|
||||
CmiSmsTypesOfMessages typeOfMessage;
|
||||
}CmiSmsGetCurrentSmsServiceCnf;
|
||||
|
||||
typedef enum _SIG_EPAT_CCM_CFG_SMS_MORE_MSG_MODE
|
||||
{
|
||||
CMI_SMS_DISABLE_MORE_MESSAGE_SEND = 0, /* disable more message send */
|
||||
CMI_SMS_TEMP_MORE_MESSAGE_SEND = 1, /* keep enabled until UE close the link */
|
||||
CMI_SMS_ALWAYS_MORE_MESSAGE_SEND = 2, /* keep enabled until UE set AT+CMMS=0 or 1 */
|
||||
CMI_SMS_ERROR_MORE_MESSAGE_SEND = 255
|
||||
|
||||
}CmiSmsMoreMessage;
|
||||
|
||||
typedef struct CmiSmsSetMoreMessageReq_Tag
|
||||
{
|
||||
CmiSmsMoreMessage smsMoreMsgMode;
|
||||
}CmiSmsSetMoreMessageReq;
|
||||
|
||||
typedef CamCmiEmptySig CmiSmsSetMoreMessageModeCnf;
|
||||
|
||||
typedef CamCmiEmptySig CmiSmsGetMoreMessageModeReq;
|
||||
|
||||
typedef struct CmiSmsGetMoreMessageModeCnf_Tag
|
||||
{
|
||||
UINT8 smsMoreMsgMode;
|
||||
}CmiSmsGetMoreMessageModeCnf;
|
||||
|
||||
#define CI_SMS_SIGNAL_NUM_MAX 5
|
||||
#define CI_SMS_RANGE_LIST_MAX 5
|
||||
|
||||
|
||||
typedef struct CmiSmsNumberRange_Tag
|
||||
{
|
||||
UINT32 min;
|
||||
UINT32 max;
|
||||
}CmiSmsNumberRange;
|
||||
|
||||
typedef struct CmiSmsNumberList_Tag
|
||||
{
|
||||
BOOL bSignalNum;
|
||||
BOOL bRangeNum;
|
||||
UINT8 rangeLen;
|
||||
UINT8 signalNum;
|
||||
UINT32 signalNumList[CI_SMS_SIGNAL_NUM_MAX];
|
||||
CmiSmsNumberRange rangeList[CI_SMS_RANGE_LIST_MAX];
|
||||
}CmiSmsNumberList;
|
||||
|
||||
typedef struct CmiSmsSetCscbSettingReq_Tag
|
||||
{
|
||||
BOOL mode;
|
||||
UINT8 rsv0;
|
||||
UINT16 rsv1;
|
||||
CmiSmsNumberList mids;
|
||||
CmiSmsNumberList dcss;
|
||||
}CmiSmsSetCscbSettingReq;
|
||||
|
||||
typedef CamCmiEmptySig CmiSmsGetCscbSettingReq;
|
||||
|
||||
typedef struct CmiSmsSetCscbSettingCnf_Tag
|
||||
{
|
||||
CmiSmsErrorCode errorCode;
|
||||
UINT16 reserved;
|
||||
}CmiSmsSetCscbSettingCnf;
|
||||
|
||||
typedef struct CmiSmsGetCscbSettingCnf_Tag
|
||||
{
|
||||
CmiSmsErrorCode errorCode;
|
||||
BOOL mode;
|
||||
CmiSmsNumberList mids;
|
||||
CmiSmsNumberList dcss;
|
||||
}CmiSmsGetCscbSettingCnf;
|
||||
|
||||
/******************************************************************************
|
||||
* CMI_SMS_GET_SMS_MSG_RECORD_REQ
|
||||
******************************************************************************/
|
||||
typedef struct CmiSmsGetSmsMsgRecReq_Tag
|
||||
{
|
||||
UINT8 index; /* the specified index to read SIM */
|
||||
UINT8 operatmode; /* CmiSmsOperationMode */
|
||||
UINT16 reserved;
|
||||
}CmiSmsGetSmsMsgRecReq;
|
||||
|
||||
/******************************************************************************
|
||||
* CMI_SMS_GET_SMS_MSG_RECORD_CNF
|
||||
******************************************************************************/
|
||||
|
||||
typedef struct CmiSmsReadSmsRecRspInfo_Tag
|
||||
{
|
||||
INT8 index; /* The index which was provided by SIM */
|
||||
UINT8 smsStatus; /* SMS record status. CmiSmsRecStorStatus */
|
||||
BOOL scAddrPresent; /* SC Address info present or not */
|
||||
UINT8 operatmode; /* CmiSmsOperationMode */
|
||||
CmiSmsAddressInfo scAddrInfo; /* SC address info */
|
||||
CmiSmsPdu smsPduData; /* SMS PDU contents */
|
||||
}CmiSmsReadSmsRecRspInfo;
|
||||
|
||||
typedef struct CmiSmsGetSmsMsgRecCnf_Tag
|
||||
{
|
||||
CmiSmsErrorCode errorCode; /* Response result */
|
||||
UINT8 operatmode; /* CmiSmsOperationMode */
|
||||
UINT8 smsStatus; /* SMS record status. CmiSmsRecStorStatus */
|
||||
UINT8 smsMsgType; /* SMS message type, defined type CmiSmsMessageType */
|
||||
BOOL scAddrPresent; /* SC Address info present or not */
|
||||
UINT16 reserved;
|
||||
CmiSmsAddressInfo scAddrInfo; /* SC address info */
|
||||
CmiSmsPdu smsPduData; /* SMS PDU contents */
|
||||
}CmiSmsGetSmsMsgRecCnf;
|
||||
|
||||
/******************************************************************************
|
||||
* CMI_SMS_SET_SMS_MSG_RECORD_REQ
|
||||
******************************************************************************/
|
||||
typedef struct CmiSmsSetSmsMsgRecReq_Tag
|
||||
{
|
||||
UINT8 operatmode; /* CmiSmsOperationMode */
|
||||
UINT8 smsStatus; /* SMS record status. CmiSmsRecStorStatus */
|
||||
UINT16 reserved;
|
||||
CmiSmsAddressInfo scAddrInfo; /* SC address info */
|
||||
CmiSmsPdu smsPduData; /* SMS PDU contents */
|
||||
|
||||
}CmiSmsSetSmsMsgRecReq;
|
||||
|
||||
/******************************************************************************
|
||||
* CMI_SMS_SET_SMS_MSG_RECORD_CNF
|
||||
******************************************************************************/
|
||||
typedef struct CmiSmsSetSmsMsgRecCnf_Tag
|
||||
{
|
||||
CmiSmsErrorCode errorCode; /* response result */
|
||||
UINT8 index; /* the index which was provided by SIM */
|
||||
UINT8 operatmode; /* CmiSmsOperationMode */
|
||||
|
||||
}CmiSmsSetSmsMsgRecCnf;
|
||||
|
||||
/******************************************************************************
|
||||
* CMI_SMS_DEL_SMS_MSG_RECORD_REQ
|
||||
******************************************************************************/
|
||||
|
||||
/*for AT+CMGD, <delflag> see TS-27.005 3.5.4 */
|
||||
typedef enum CmiSmsDelFlag_Tag
|
||||
{
|
||||
CMI_SMS_DEL_FLAG_INDEX = 0, /* delete the message specified in index*/
|
||||
CMI_SMS_DEL_FLAG_STATUS_1 = 1, /* delete all Read message from the message storage */
|
||||
CMI_SMS_DEL_FLAG_STATUS_2 = 2, /* delete all Read message and sent mobile originated message */
|
||||
CMI_SMS_DEL_FLAG_STATUS_3 = 3, /* delete all read message, sent MO message and unsent mobile originated message */
|
||||
CMI_SMS_DEL_FLAG_ALL = 4, /* delete all message */
|
||||
|
||||
CMI_SMS_DEL_FLAG_UNKNOWN
|
||||
}CmiSmsDelFlag;
|
||||
|
||||
/******************************************************************************
|
||||
* CMI_SMS_DEL_SMS_MSG_RECORD_REQ
|
||||
******************************************************************************/
|
||||
|
||||
typedef struct CmiSmsDelSmsMsgRecReq_Tag
|
||||
{
|
||||
UINT8 index; /* the specified index to delete SIM */
|
||||
UINT8 delFlag; /* CmiSmsDelFlag */
|
||||
UINT16 reserved;
|
||||
}CmiSmsDelSmsMsgRecReq;
|
||||
|
||||
/******************************************************************************
|
||||
* CMI_SMS_DEL_SMS_MSG_RECORD_CNF
|
||||
******************************************************************************/
|
||||
|
||||
typedef struct CmiSmsDelSmsMsgRecCnf_Tag
|
||||
{
|
||||
CmiSmsErrorCode errorCode;
|
||||
UINT16 reserved;
|
||||
}CmiSmsDelSmsMsgRecCnf;
|
||||
|
||||
/******************************************************************************
|
||||
* CMI_SMS_LIST_SMS_MSG_RECORD_REQ
|
||||
******************************************************************************/
|
||||
typedef struct CmiSmsListSmsMsgRecReq_Tag
|
||||
{
|
||||
UINT8 listStuts; /* CmiSmsRecStorStatus the specified status which need to list */
|
||||
UINT8 reserved0;
|
||||
UINT16 reserved1;
|
||||
}CmiSmsListSmsMsgRecReq;
|
||||
|
||||
/******************************************************************************
|
||||
* CMI_SMS_LIST_SMS_MSG_RECORD_CNF
|
||||
******************************************************************************/
|
||||
typedef struct CmiSmsListSmsMsgRecCnf_Tag
|
||||
{
|
||||
CmiSmsErrorCode errorCode;
|
||||
UINT8 endStatus; /* where or not is the last item */
|
||||
BOOL scAddrPresent; /* SC Address info present or not */
|
||||
|
||||
UINT8 index; /* the index of the SMS reocord in SIM */
|
||||
UINT8 smsStatus; /* SMS record status. CmiSmsRecStorStatus */
|
||||
UINT8 smsMsgType; /* SMS message type, defined type CmiSmsMessageType */
|
||||
UINT8 reserved0;
|
||||
|
||||
CmiSmsAddressInfo scAddrInfo; /* SC address info */
|
||||
CmiSmsPdu smsPduData; /* SMS PDU contents */
|
||||
|
||||
}CmiSmsListSmsMsgRecCnf;
|
||||
|
||||
/******************************************************************************
|
||||
* CMI_SMS_GET_SMS_STORAGE_STATUS_REQ
|
||||
******************************************************************************/
|
||||
typedef struct CmiSmsGetStorageStatusReq_Tag
|
||||
{
|
||||
UINT8 operatmode; /* CmiSmsOperationMode */
|
||||
UINT8 reserved0;
|
||||
UINT16 reserved1;
|
||||
}CmiSmsGetStorageStatusReq;
|
||||
|
||||
#define CI_SMS_RECORD_MAX_NUMBER 254 /* The total number of the saved SMS message in SIM */
|
||||
|
||||
/******************************************************************************
|
||||
* CMI_SMS_GET_SMS_STORAGE_STATUS_CNF
|
||||
******************************************************************************/
|
||||
typedef struct CmiSmsGetStorageStatusCnf_Tag
|
||||
{
|
||||
UINT8 operatmode; /* CmiSmsOperationMode */
|
||||
UINT8 usedNumOfSim;
|
||||
UINT8 totalNumOfSim;
|
||||
UINT8 reserved;
|
||||
UINT8 usedIndexOfSim[CI_SMS_RECORD_MAX_NUMBER];
|
||||
}CmiSmsGetStorageStatusCnf;
|
||||
|
||||
|
||||
typedef CamCmiEmptySig CmiSmsSendSMMARequest;
|
||||
|
||||
/******************************************************************************
|
||||
* CMI_SMS_MEM_CAP_IND
|
||||
******************************************************************************/
|
||||
typedef struct CmiSmsMemCapInd_Tag
|
||||
{
|
||||
BOOL smsMemCapExceed;
|
||||
UINT8 reserved0;
|
||||
UINT16 reserved1;
|
||||
}CmiSmsMemCapInd;
|
||||
|
||||
/******************************************************************************
|
||||
* CMI_SMS_SET_MEM_CAP_REQ, CMI_SMS_SET_MEM_CAP_CNF
|
||||
******************************************************************************/
|
||||
typedef struct CmiSmsSetMemCapReq_Tag
|
||||
{
|
||||
BOOL isMemCapExceed;
|
||||
UINT8 reserved0;
|
||||
UINT16 reserved1;
|
||||
}CmiSmsSetMemCapReq, CmiSmsSetMemCapCnf;
|
||||
|
||||
/******************************************************************************
|
||||
* CMI_SMS_IDLE_STATUS_IND
|
||||
******************************************************************************/
|
||||
typedef CamCmiEmptySig CmiSmsIdleStatusInd;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,285 @@
|
||||
#ifndef NETIF_ADPT_HDR_API_H
|
||||
#define NETIF_ADPT_HDR_API_H
|
||||
|
||||
/******************************************************************************
|
||||
******************************************************************************
|
||||
Copyright: - 2021- Copyrights of AirM2M Ltd.
|
||||
File name: - netifadptapi.h
|
||||
Description: - netif adpt common api header
|
||||
History: - 03/04/2021, Originated by xwang
|
||||
******************************************************************************
|
||||
******************************************************************************/
|
||||
#include "pspdu.h"
|
||||
#include "lwip/netif.h"
|
||||
|
||||
#define NETIF_DLPDUBLOCK_SIZE sizeof(DlPduBlock)
|
||||
|
||||
#define NETIF_UL_BUFF_RSVD_RNDIS_HDR_LEN 44
|
||||
#define NETIF_UL_BUFF_RSVD_RNDIS_TAILER_LEN 8
|
||||
#define NETIF_UL_BUFF_RSVD_PPP_HDR_LEN 8
|
||||
#define NETIF_UL_BUFF_RSVD_PPP_TAILER_LEN 4;
|
||||
|
||||
#define NETIF_UL_DL_TCP_MSS_CHECK 1
|
||||
|
||||
#define NETIF_DL_TCP_WINDOWS_ADPT 1
|
||||
|
||||
#define NETIF_DL_TCP_MAX_WINDOWS 0xFFFF
|
||||
|
||||
#define NETIF_TCP_MAX_SCALE_VALUE 14
|
||||
|
||||
typedef enum NetIfRetEnum_Tag
|
||||
{
|
||||
NETIF_SUCC = 0,
|
||||
NETIF_ERROR
|
||||
}NetIfRetEnum;
|
||||
|
||||
// lan netif type
|
||||
typedef enum NetifType_Tag
|
||||
{
|
||||
NETIF_TYPE_INVALID = 0,
|
||||
NETIF_TYPE_PS_WAN = 1,
|
||||
NETIF_TYPE_RNDIS_LAN = 2,
|
||||
NETIF_TYPE_PPP_LAN = 3,
|
||||
}NetifType;
|
||||
|
||||
|
||||
typedef UINT8 NetIfRet;
|
||||
|
||||
//ip4 pkg input process result
|
||||
typedef enum NetifIp4InputResult_Tag
|
||||
{
|
||||
NETIF_IP4_INPUT_RESULT_DISCARD = 0,
|
||||
NETIF_IP4_INPUT_RESULT_LOCAL_INPUT = 1,
|
||||
NETIF_IP4_INPUT_RESULT_FORWARD_WAN = 2,
|
||||
NETIF_IP4_INPUT_RESULT_FORWARD_LAN = 3,
|
||||
NETIF_IP4_INPUT_RESULT_FORWARD_LAN_ETH = 4,
|
||||
NETIF_IP4_INPUT_RESULT_FORWARD_LAN_PPP = 5,
|
||||
NETIF_IP4_INPUT_RESULT_FORWARD_LAN_AND_INPUT = 6,
|
||||
NETIF_IP4_INPUT_RESULT_FORWARD_LAN_ETH_AND_INPUT = 7,
|
||||
NETIF_IP4_INPUT_RESULT_FORWARD_LAN_PPP_AND_INPUT = 8,
|
||||
NETIF_IP4_INPUT_RESULT_FORWARD_WAN_AND_INPUT = 9,
|
||||
NETIF_IP4_INPUT_RESULT_FORWAD_WAN_AND_DNS_RELAY_CHECK = 10,
|
||||
NETIF_IP4_INPUT_RESULT_FORWAD_LAN_AND_DNS_RELAY_CHECK = 11,
|
||||
NETIF_IP4_INPUT_RESULT_FORWAD_LAN_ETH_AND_DNS_RELAY_CHECK = 12,
|
||||
NETIF_IP4_INPUT_RESULT_FORWAD_LAN_PPP_AND_DNS_RELAY_CHECK = 13,
|
||||
NETIF_IP4_INPUT_RESULT_FAIL = 14,
|
||||
}NetifIp4InputResult;
|
||||
|
||||
|
||||
/*
|
||||
* DL PDU block list
|
||||
*/
|
||||
typedef struct NetifDlPduList_Tag
|
||||
{
|
||||
UINT16 pkgNum;
|
||||
UINT16 rsvd;
|
||||
|
||||
DlPduBlock *pHead;
|
||||
DlPduBlock *pTail;
|
||||
}NetifDlPduList; //12 bytes
|
||||
|
||||
/*
|
||||
* UL PDU block list
|
||||
*/
|
||||
typedef struct NetifUlPduList_Tag
|
||||
{
|
||||
UINT16 pkgNum;
|
||||
UINT16 pkgLen;
|
||||
|
||||
UlPduBlock *pHead;
|
||||
UlPduBlock *pTail;
|
||||
}NetifUlPduList; //12 bytes
|
||||
|
||||
/*
|
||||
* NETIF_UL_PDU_LIST_ADD_ONE(NetifUlPduList *pUlList, UlPduBlock *pPkgHead, UlPduBlock *pPkgTail, UINT16 pkgLen)
|
||||
*/
|
||||
#define NETIF_UL_PDU_LIST_ADD_ONE(PULLIST, PPKGHEAD, PPKGTAIL, PKGLEN) \
|
||||
do { \
|
||||
OsaSingleLinkAddList((PULLIST)->pHead, (PULLIST)->pTail, (PPKGHEAD), (PPKGTAIL)); \
|
||||
(PULLIST)->pkgNum += 1; \
|
||||
(PULLIST)->pkgLen += (PKGLEN); \
|
||||
}while(FALSE)
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* NetifUpdateFastPathChkInfo
|
||||
* Description: update fast path chk info
|
||||
* input:
|
||||
* output:
|
||||
* Comment: it will be called for these cases as below:
|
||||
* 1. wan link up /link down(ipv6 maybe link up delay)
|
||||
* 2. lan link up/link down
|
||||
* 3. lan link layer status change
|
||||
* 4. lan netif related arp cache update
|
||||
* 5. lan netif related ndp cache update(ToDo: ndp cache timeout)
|
||||
******************************************************************************/
|
||||
void NetifUpdateFastPathChkInfo(void);
|
||||
|
||||
/******************************************************************************
|
||||
* NetGetLanNetif
|
||||
* Description: netmgr adpt get system bind LAN netif by ip4 wan netif
|
||||
* input:
|
||||
* output:struct netif *
|
||||
* Comment:
|
||||
******************************************************************************/
|
||||
struct netif *NetGetBindLanNetifByIp4WanNetif(struct netif *wanNetif);
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* NetGetLanNetif
|
||||
* Description: netmgr adpt get system bind LAN netif by ip6 wan netif
|
||||
* input:
|
||||
* output:struct netif *
|
||||
* Comment:
|
||||
******************************************************************************/
|
||||
struct netif *NetGetBindLanNetifByIp6WanNetif(struct netif *wanNetif);
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* NetGetLanNetif
|
||||
* Description: netmgr adpt get system bind WAN ip4 netif by lan netif
|
||||
* input:
|
||||
* output:struct netif *
|
||||
* Comment:
|
||||
******************************************************************************/
|
||||
struct netif *NetGetBindIp4WanNetifByLanNetif(struct netif *lanNetif);
|
||||
|
||||
/******************************************************************************
|
||||
* NetGetLanNetif
|
||||
* Description: netmgr adpt get system bind WAN ip6 netif by lan netif
|
||||
* input:
|
||||
* output:struct netif *
|
||||
* Comment:
|
||||
******************************************************************************/
|
||||
struct netif *NetGetBindIp6WanNetifByLanNetif(struct netif *lanNetif);
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* NetifUlGetOnePkg
|
||||
* Description: get one whole pkg from "UlPduBlock" list, and return to next pkg head
|
||||
* input: UlPduBlock *pUlHdr //in
|
||||
* UlPduBlock **ppOnePkgHead //out
|
||||
* UlPduBlock **ppOnePkgTail //out
|
||||
* UINT16 *pPkgLen //out
|
||||
* output: UlPduBlock*
|
||||
******************************************************************************/
|
||||
UlPduBlock* NetifUlGetOnePkg(UlPduBlock *pUlHdr,
|
||||
UlPduBlock **ppOnePkgHead,
|
||||
UlPduBlock **ppOnePkgTail,
|
||||
UINT16 *pPkgLen);
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* NetifLanDlOnePkgDataReq
|
||||
* Description: provide by ppp service, lwip send IP pkg to ppp/rndis service by this API
|
||||
* input: DlPduBlock *pDlPdu
|
||||
* output:
|
||||
* Comment:
|
||||
* Called by tcpip statck (ppp netif adpt layer)
|
||||
******************************************************************************/
|
||||
void NetifLanDlOnePkgDataReq(UINT8 lanNetifType, DlPduBlock *pDlPdu);
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* NetifDumpUlPacket
|
||||
* Description: netif dump UL data(ulpdu buffer)
|
||||
* input: UlPduBlock *ulData, UINT8 type(lwip_netif_type_t)
|
||||
* output:
|
||||
* Comment:
|
||||
******************************************************************************/
|
||||
void NetifDumpUlPduPacket(UlPduBlock *ulData, UINT8 type);
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* NetifDumpDlPduPacket
|
||||
* Description: netif dump DL data(dlpdu buffer)
|
||||
* input: DlPduBlock *dlData, UINT8 type(lwip_netif_type_t)
|
||||
* output:
|
||||
* Comment:
|
||||
******************************************************************************/
|
||||
void NetifDumpDlPduPacket(DlPduBlock *dlData, UINT8 type);
|
||||
|
||||
/******************************************************************************
|
||||
* NetifDumpDlPbufPacket
|
||||
* Description: netif dump DL data(pbuf buffer)
|
||||
* input: struct pbuf *pbufdata, UINT8 type(lwip_netif_type_t)
|
||||
* output:
|
||||
* Comment:
|
||||
******************************************************************************/
|
||||
void NetifDumpDlPbufPacket(struct pbuf *pbufData, UINT8 type);
|
||||
|
||||
/******************************************************************************
|
||||
* NetifDumpUlPbufPacket
|
||||
* Description: netif dump UL data(pbuf buffer)
|
||||
* input: struct pbuf *pbufdata, UINT8 type(lwip_netif_type_t)
|
||||
* output:
|
||||
* Comment:
|
||||
******************************************************************************/
|
||||
void NetifDumpUlPbufPacket(struct pbuf *pbufData, UINT8 type);
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* NetifCopyDataFromUlPdu
|
||||
* Description:
|
||||
* input: UlPduBlock *pUlPdu
|
||||
* output:UINT16
|
||||
* Comment:
|
||||
******************************************************************************/
|
||||
UINT16 NetifCopyDataFromUlPdu(UINT8 *payload, UlPduBlock *pUlPdu);
|
||||
|
||||
/******************************************************************************
|
||||
* NetifProcessIp4InputPkg
|
||||
* Description:
|
||||
* input: struct netif *inp, struct pbuf *p
|
||||
* output:UINT8
|
||||
* Comment:
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
* NetGetLanNetif
|
||||
* Description: netmgr adpt get system bind LAN channel id by LAN netif
|
||||
* input:
|
||||
* output:struct netif *
|
||||
* Comment:
|
||||
******************************************************************************/
|
||||
UINT8 NetGetBindLanChannelIdByLanNetif(struct netif *pLanNetif);
|
||||
|
||||
UINT8 NetifProcessIp4InputPkg(struct netif *inp, struct pbuf *p);
|
||||
|
||||
|
||||
err_t NetifLanTcpipInput(u8_t lanType, UlPduBlock *pPduHdr);
|
||||
|
||||
/*
|
||||
*/
|
||||
void NetifLanDlPkgListOutput(UINT8 lanNetifType, UINT16 pkgNum, DlPduBlock *pHead, DlPduBlock *pTail);
|
||||
|
||||
/*
|
||||
*/
|
||||
void NetifLanDlPkgListGet(UINT8 lanType, DlPduBlock **ppHead, DlPduBlock **ppTail);
|
||||
|
||||
void NetifIp4PkgFwdWanFromLanSrcAddrProcess(struct pbuf *p, struct netif *wanIf, struct netif *lanIf, ip4_addr_t *srcAddr);
|
||||
|
||||
void NetifIp4PkgFwdLanFromWanDestAddrProcess(struct pbuf *p, struct netif *wanIf, struct netif *lanIf, ip4_addr_t *destAddr);
|
||||
|
||||
UINT8 *NetifParseTcpOption(UINT8 *pOption, UINT16 len, UINT8 type, UINT8 **pPreOption);
|
||||
|
||||
UINT16 NetifUpdateTcpIpCheckSumUint16(UINT16 oldChkSum, UINT16 oldValue, UINT16 newValue);
|
||||
|
||||
UINT16 NetifUpdateTcpIpCheckSumUint32(UINT16 oldChkSum, UINT32 oldValue, UINT32 newValue);
|
||||
|
||||
BOOL NetifCopyDataToUlPdu(UlPduBlock *pUlPdu, UINT16 offset, UINT8 *pIn, UINT16 length);
|
||||
|
||||
BOOL NetifDnsRelayWanProcess(struct netif *wanIf, struct netif *lanIf, struct pbuf *p, ip4_addr_t *srcAddr);
|
||||
|
||||
BOOL NetifDnsRelayLanProcess(struct netif *lanIf, struct netif *wanIf, struct pbuf *p, ip4_addr_t *destAddr);
|
||||
|
||||
void NetifDlTcpDisableWSOption(UINT8 *pTransport);
|
||||
|
||||
err_t NetifProcessIp6TcpSyncInputPkg(struct pbuf *pbuf, UINT8 lanType);
|
||||
|
||||
void NetifClearPortMappingTable(UINT8 connSource, UINT8 cid);
|
||||
|
||||
struct netif *NetGetBindLanNetifByIp4WanNetifAndLanType(struct netif *wanNetif, UINT8 lanNetifType);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,936 @@
|
||||
|
||||
/******************************************************************************
|
||||
******************************************************************************
|
||||
Copyright: - 2018- Copyrights of AirM2M Ltd.
|
||||
File name: - networkmgr.h
|
||||
Description: - network data path mange related function header
|
||||
History: - 01/02/2018, Originated by xwang
|
||||
******************************************************************************
|
||||
******************************************************************************/
|
||||
#ifndef TCPIP_NETWORK_MGR_H
|
||||
#define TCPIP_NETWORK_MGR_H
|
||||
|
||||
/*
|
||||
* !!! note, this is the header file which provide to app/cms/at/ccio, and should be opened in SDK !!!
|
||||
* !!! not suggect to include more other header filer !!!
|
||||
*/
|
||||
#include "commontypedef.h"
|
||||
#include "lwip/opt.h"
|
||||
#include "lwip/ip_addr.h"
|
||||
#include "netif/ethernet.h"
|
||||
#include "cmips.h"
|
||||
|
||||
/******************************************************************************
|
||||
*****************************************************************************
|
||||
* MARCO
|
||||
*****************************************************************************
|
||||
******************************************************************************/
|
||||
|
||||
#define NM_ADDR_MAX_LENGTH 16
|
||||
|
||||
/*
|
||||
* set bit B to 1 in D
|
||||
* example:
|
||||
* NmBit1Set(0x00, 0) = 0x01
|
||||
* NmBit1Set(0x01, 4) = 0x11
|
||||
*/
|
||||
#define NmBit1Set(D, B) ((D) |= (1<<(B)))
|
||||
|
||||
/*
|
||||
* set bit B to 0 in D
|
||||
* example:
|
||||
* NmBit0Set(0xFF, 0) = 0xFE
|
||||
* NmBit0Set(0xFE, 4) = 0xEE
|
||||
*/
|
||||
#define NmBit0Set(D, B) ((D) &= (~(1<<(B))))
|
||||
|
||||
|
||||
#define NM_MAGIC_WORD 0xA5B7
|
||||
|
||||
/******************************************************************************
|
||||
*****************************************************************************
|
||||
* STRUCT/ENUM
|
||||
*****************************************************************************
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
/*
|
||||
* the action result
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
NM_SUCCESS = 0,
|
||||
NM_FAIL = 1,
|
||||
}NmResult;
|
||||
|
||||
/*
|
||||
* NM NET type
|
||||
*/
|
||||
typedef enum _EPAT_NmNetIpType_tag
|
||||
{
|
||||
NM_NET_TYPE_INVALID = 0, //net not available
|
||||
NM_NET_TYPE_IPV4 = 1, //ipv4 available
|
||||
NM_NET_TYPE_IPV6 = 2, //ipv6 available
|
||||
NM_NET_TYPE_IPV4V6 = 3, //ipv4&ipv6 available
|
||||
NM_NET_TYPE_IPV6preparing = 4, //ipv6 preparing
|
||||
NM_NET_TYPE_IPV4_IPV6preparing = 5, //ipv4 available &ipv6 preparing
|
||||
}NmNetIpType;
|
||||
|
||||
/*
|
||||
* the ip address type
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
NM_ADDR_INVALID_ADDR = 0,
|
||||
NM_ADDR_IPV4_ADDR, // 4 bytes length
|
||||
NM_ADDR_IPV6_ID, //8 bytes length
|
||||
NM_ADDR_FULL_IPV6_ADDR //16 bytes length
|
||||
}NmAddrType;
|
||||
|
||||
/*
|
||||
*NM LAN type
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
NM_LAN_TYPE_INVALID = 0,
|
||||
NM_LAN_TYPE_RNDIS,
|
||||
NM_LAN_TYPE_ECM,
|
||||
NM_LAN_TYPE_PPP,
|
||||
}NmLanType;
|
||||
|
||||
/*
|
||||
*NM LAN NET type
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
NM_LAN_NET_TYPE_INVALID = 0,
|
||||
NM_LAN_NET_TYPE_ETH,
|
||||
NM_LAN_NET_TYPE_PPP,
|
||||
}NmLanNetType;
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* NM LAN link layer status type:
|
||||
* RNDIS/ECM, HOST and UE Link/connection state
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
NM_LAN_LINK_STATUS_DISCONNECTED,
|
||||
NM_LAN_LINK_STATUS_CONNECTED,
|
||||
}NmLanLinkStatus;
|
||||
|
||||
/*
|
||||
* NM LAN data path status
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
NM_LAN_NET_DEACTIVED, //lan data path is deactive, init state, or LAN is linkdown by CCIO
|
||||
NM_LAN_NET_ACTIVED, //lan data path is active, LAN is linkup by CCIO
|
||||
NM_LAN_NET_ACTIVED_AND_CHANGED, //lan data path is active and changed, such as ipv4 ready change to ipv4ipv6 ready
|
||||
}NmLanNetStatus;
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* NM ethernet LAN (RNDIS/ECM) data path ip4 mode (ip6 is always pass through mode)
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
NM_ETH_LAN_IP4_PATH_MODE_PASSTHROUGH = 0, //pass through mode
|
||||
NM_ETH_LAN_IP4_PATH_MODE_NAT, //nat mode
|
||||
}NmEthLanIp4PathMode;
|
||||
|
||||
|
||||
/*
|
||||
*NM LAN ctrl api
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
NM_LAN_CTRL_ACTION_BIND = 0, //pass through mode
|
||||
NM_LAN_CTRL_ACTION_UNBIND, //nat mode
|
||||
}NmLanCtrlAction;
|
||||
|
||||
typedef struct NetMgrWanIpv6Info_Tag
|
||||
{
|
||||
ip6_addr_t ipv6GlobalAddr;
|
||||
ip6_addr_t ipv6LinklocalAddr;
|
||||
|
||||
UINT8 dnsNum;
|
||||
UINT8 rsvd0;
|
||||
UINT16 rsvd1;
|
||||
ip6_addr_t dns[NM_PDN_TYPE_MAX_DNS_NUM];
|
||||
}NetMgrWanIpv6Info; //52 bytes
|
||||
|
||||
|
||||
typedef struct NetMgrWanIpv4Info_Tag
|
||||
{
|
||||
ip4_addr_t ipv4Addr;
|
||||
|
||||
UINT8 dnsNum;
|
||||
UINT8 rsvd0;
|
||||
UINT16 rsvd1;
|
||||
ip4_addr_t dns[NM_PDN_TYPE_MAX_DNS_NUM];
|
||||
}NetMgrWanIpv4Info; //16 bytes
|
||||
|
||||
|
||||
typedef struct NetMgrWanInfo_Tag
|
||||
{
|
||||
UINT8 ipType;
|
||||
UINT8 ipv4Cid;
|
||||
UINT8 ipv6Cid;
|
||||
BOOL bEnableRohc;
|
||||
|
||||
NetMgrWanIpv4Info wanIpv4Info;
|
||||
NetMgrWanIpv6Info wanIpv6Info;
|
||||
}NetMgrWanInfo;
|
||||
|
||||
typedef struct NetMgrLanIPv6Info_Tag
|
||||
{
|
||||
ip6_addr_t ipv6GlobalAddr;
|
||||
ip6_addr_t ipv6LinklocalAddr;
|
||||
}NetMgrLanIPv6Info;
|
||||
|
||||
typedef struct NetMgrLanIPv4Info_Tag
|
||||
{
|
||||
ip4_addr_t ipv4Addr;
|
||||
}NetMgrLanIPv4Info;
|
||||
|
||||
typedef struct NetMgrRndisLanInfo_Tag
|
||||
{
|
||||
UINT8 ipType;
|
||||
UINT8 rsvd0;
|
||||
UINT16 rsvd1;
|
||||
|
||||
NetMgrLanIPv4Info lanIpv4Info;
|
||||
NetMgrLanIPv6Info lanIpv6Info;
|
||||
|
||||
UINT8 etherAddr[ETH_HWADDR_LEN];
|
||||
}NetMgrRndisLanInfo;
|
||||
|
||||
typedef struct NetMgrPppLanInfo_Tag
|
||||
{
|
||||
UINT8 ipType;
|
||||
UINT8 rsvd0;
|
||||
UINT16 rsvd1;
|
||||
|
||||
NetMgrLanIPv4Info lanIpv4Info;
|
||||
NetMgrLanIPv6Info lanIpv6Info;
|
||||
}NetMgrPppLanInfo;
|
||||
|
||||
typedef struct NetMgrLanInfo_Tag
|
||||
{
|
||||
UINT8 type;
|
||||
union
|
||||
{
|
||||
NetMgrRndisLanInfo rndisLanInfo;
|
||||
NetMgrPppLanInfo pppLanInfo;
|
||||
}lanInfo;
|
||||
}NetMgrLanInfo;
|
||||
|
||||
|
||||
|
||||
typedef struct NetMgrEthLanCfg_Tag
|
||||
{
|
||||
UINT8 ethLanIp4PathMode; //NmEthLanIp4PathMode, nat/passthrough mode
|
||||
UINT8 rsvd0;
|
||||
UINT16 rsvd1;
|
||||
|
||||
ip4_addr_t ethLocalAddr; //Ethernet LAN netif (ECM/RNDIS) address, example: 192.168.10.1
|
||||
ip4_addr_t ethHostAddr; //host lan netif(ECM/RNDIS) address, if NAT mode, example: 192.168.10.5
|
||||
ip4_addr_t ethHostNetMask; //host lan netif(ECM/RNDIS) netmask.if NAT mode, example:255.255.255.0; if the setting is 0.0.0.0, ue will use the deault value
|
||||
}NetMgrEthLanCfg; // 12 bytes
|
||||
|
||||
#if 0
|
||||
typedef struct NetMgrPppLanCfg_Tag
|
||||
{
|
||||
ip4_addr_t pppLocalAddr; //PPP LAN netif address, should not same as: "ethLocalAddr", example: 192.168.20.1
|
||||
}NetMgrPppLanCfg;
|
||||
#endif
|
||||
|
||||
typedef struct NetMgrLanCfg_Tag
|
||||
{
|
||||
NetMgrEthLanCfg ethLanCfg;
|
||||
//NetMgrPppLanCfg pppLanCfg;
|
||||
}NetMgrLanCfg; // 12 bytes
|
||||
|
||||
|
||||
/*
|
||||
*/
|
||||
typedef struct NetMgrLanDataPathCap_Tag
|
||||
{
|
||||
UINT8 lanType; /* NmNetLanType */
|
||||
BOOL bConnected; /* Whether LAN is connected/disconnected
|
||||
* 1> if connected, CCIO need to try linkup LAN, if ethernet(RNDID/ECM)/PPP enabled
|
||||
* 2> if disconnected, CCIO need to linkdown LAN
|
||||
*/
|
||||
UINT16 rsvd0;
|
||||
|
||||
/*
|
||||
* Some basic lan info
|
||||
*/
|
||||
UINT8 lanIpType; /* NmNetIpType */
|
||||
UINT8 lanBindIp4Cid; /* If not bind, set to : 0xFF */
|
||||
UINT8 lanBindIp6Cid; /* If not bind, set to : 0xFF */
|
||||
UINT8 rsvd1;
|
||||
}NetMgrLanDataPathCap;
|
||||
|
||||
/*
|
||||
* When LAN (PPP/RNDIS/ECM) state changes (connect/disconnect) need to notify CCIO
|
||||
*/
|
||||
//void radioDevNotifyTcpipDataPathCapability(NetMgrLanDataPathCap *pLanDataPathCap);
|
||||
|
||||
/*
|
||||
* query the lan tcpip data path capability, called by CCIO, to descide whether can do lan link up
|
||||
*/
|
||||
//NmResult NetMgrQueryLanTcpipDataPathCapability(NmLanType lanType, NetMgrLanDataPathCap *pLanDataPathCap);
|
||||
|
||||
|
||||
/*
|
||||
*NM LAN channel TCPIP data path status
|
||||
*/
|
||||
typedef struct NetMgrLanChannelTcpipDataPathStatus_Tag
|
||||
{
|
||||
UINT8 status; /* NmLanNetStatus, event status with (NM_LAN_NET_DEACTIVED/NM_LAN_NET_ACTIVED/NM_LAN_NET_ACTIVED_AND_CHANGED);
|
||||
* query return (NM_LAN_NET_DEACTIVED/NM_LAN_NET_ACTIVED)
|
||||
*/
|
||||
UINT8 lanIpType; /* NmNetIpType */
|
||||
UINT8 lanBindIp4Cid; /* If not bind, set to : 0xFF */
|
||||
UINT8 lanBindIp6Cid; /* If not bind, set to : 0xFF */
|
||||
}NetMgrLanChannelTcpipDataPathStatus;
|
||||
|
||||
/*
|
||||
/NM LAN channel TCPIP data path info(assign to host)
|
||||
*/
|
||||
typedef struct NetMgrLanTcpipDataPathHostInfo_Tag
|
||||
{
|
||||
/*
|
||||
* Some basic lan info
|
||||
*/
|
||||
UINT8 lanIpType; /* NmNetIpType */
|
||||
UINT8 lanBindIp4Cid; /* If not bind, set to : 0xFF */
|
||||
UINT8 lanBindIp6Cid; /* If not bind, set to : 0xFF */
|
||||
UINT8 rsvd1;
|
||||
|
||||
ip4_addr_t hostIp4Addr; /*the ip4 address which will assigned to host*/
|
||||
UINT32 hostIp6Prefix[2]; /*the ip6 prefix which will assigned to host*/
|
||||
UINT32 hostIp6Id[2]; /*the ip6 ID which will assigned to host*/
|
||||
|
||||
ip4_addr_t hostIp4Dns[NM_PDN_TYPE_MAX_DNS_NUM]; /*the ip4 dns which will assigned to host*/
|
||||
ip6_addr_t hostIp6Dns[NM_PDN_TYPE_MAX_DNS_NUM]; /*the ip6 dns which will assigned to host*/
|
||||
|
||||
}NetMgrLanTcpipDataPathHostInfo;
|
||||
|
||||
/*
|
||||
*/
|
||||
typedef struct NmAtiLanInfo_Tag
|
||||
{
|
||||
UINT8 lanType; /*NmLanNetType, ETH/PPP LAN*/
|
||||
BOOL bound; /*whether current LAN , bind a WAN/netif */
|
||||
|
||||
UINT8 lanBindIp4Cid; /* If not bind, set to : 0xFF */
|
||||
UINT8 lanBindIp6Cid; /* If not bind, set to : 0xFF */
|
||||
}NmAtiLanInfo;
|
||||
|
||||
/*
|
||||
* notify the CMS/psdial the LAN info
|
||||
*/
|
||||
//void NetMgrNotifyAtiLanInfoInd(NmAtiLanInfo *pAtiLanInfo);
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* Net manager entity
|
||||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* PS NET status, status from CEREG
|
||||
*/
|
||||
typedef enum NmPsNetStatus_Tag
|
||||
{
|
||||
/*
|
||||
* PS is not registered, and UE is not under dialing
|
||||
*/
|
||||
NM_PS_NET_NOT_DIAL,
|
||||
|
||||
/*
|
||||
* 1> PS is not registered, but under registration
|
||||
* 2> and no ACT NETIF (bearer)
|
||||
*/
|
||||
NM_PS_NET_NOT_REG,
|
||||
|
||||
/*
|
||||
* 1> PS is OOS (out of service)
|
||||
* 2> and must have ACT NETIF (bearer);
|
||||
* 3> If no ACT NETIF (bearer), status need to change to "NM_PS_NET_NOT_REG"
|
||||
*/
|
||||
NM_PS_NET_OOS,
|
||||
|
||||
/*
|
||||
* PS is registered, and NETIF maybe comes later
|
||||
*/
|
||||
NM_PS_NET_REG
|
||||
}NmPsNetStatus;
|
||||
|
||||
typedef struct NmEntity_Tag
|
||||
{
|
||||
UINT8 psNetStatus; //NmPsNetStatus
|
||||
UINT8 rsvd0;
|
||||
|
||||
/*
|
||||
* CID valid value: 1 - 15;
|
||||
* If one CID (bearer) activated, related bit set to 1
|
||||
*/
|
||||
UINT16 actCidsBitmap;
|
||||
}NmEntity;
|
||||
|
||||
#if 0
|
||||
/******************************************************************************
|
||||
* A blocked callback designation, which called in LWIP task
|
||||
******************************************************************************/
|
||||
typedef enum NmBlockCallbackMsgId_Tag
|
||||
{
|
||||
NM_BLOCK_CB_INVALID_ID,
|
||||
NM_NET_LINK_UP,
|
||||
NM_NET_LINK_DOWN,
|
||||
NM_NET_LAN_LINK_UP,
|
||||
NM_NET_LAN_LINK_DOWN,
|
||||
NM_NET_LAN_LINK_LAYER_STATUS_CHANGE,
|
||||
NM_GET_NET_INFO,
|
||||
NM_CLEAR_DNS_CACHE,
|
||||
NM_GET_DNS_SERVER,
|
||||
NM_SET_DNS_SERVER,
|
||||
}NmBlockCallbackMsgId;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The ip address structure
|
||||
* NM_ADDR_IPV4_ADDR: 12~15:0 0~3:address
|
||||
* NM_ADDR_FULL_IPV6_ADDR: 0~15 prefix:id
|
||||
* NM_ADDR_IPV6_ID: 8~15:0 0~7:id
|
||||
*/
|
||||
typedef struct NmIpAddr_Tag
|
||||
{
|
||||
UINT8 addrType; //NmAddrType
|
||||
UINT8 reserved0;
|
||||
UINT16 reserved1;
|
||||
UINT8 addr[NM_ADDR_MAX_LENGTH];
|
||||
}NmIpAddr; //20 bytes
|
||||
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* PS netif configuration info
|
||||
* Use to link up one netif
|
||||
******************************************************************************/
|
||||
typedef struct NmIfConfiguration_Tag
|
||||
{
|
||||
UINT16 dnsNum : 3;
|
||||
UINT16 mtuPresent : 1; //if mtu is invalid ,this value will be zero
|
||||
UINT16 cgevReason: 4; //CmiPsPdnTypeReason
|
||||
UINT16 rsvd0 : 8;
|
||||
|
||||
UINT16 mtu;
|
||||
NmIpAddr ipv4Addr;
|
||||
NmIpAddr ipv6Addr;
|
||||
NmIpAddr dns[NM_MAX_DNS_NUM];
|
||||
}NmIfConfiguration; //124 bytes
|
||||
|
||||
|
||||
typedef struct NmNetIfDnsCfg_Tag{
|
||||
UINT8 dnsNum;
|
||||
UINT8 rsvd0;
|
||||
UINT16 rsvd1;
|
||||
ip_addr_t dns[NM_MAX_DNS_NUM];
|
||||
}NmNetIfDnsCfg; //84 bytes
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* NM_ATI_SYNC_GET_NET_INFO_REQ
|
||||
******************************************************************************/
|
||||
typedef struct NmAtiGetNetInfoReq_Tag
|
||||
{
|
||||
/*
|
||||
* 1> If user want to get the default netif info, CID could set to "LWIP_PS_DEFAULT_CID", CID 0 is used for attached bearer (initial PDP context)
|
||||
* 2> Valid value: [LWIP_PS_MIN_VALID_CID - LWIP_PS_MAX_VALID_CID]/[0-15]
|
||||
*/
|
||||
UINT8 cid;
|
||||
UINT8 rsvd0;
|
||||
UINT16 rsvd1;
|
||||
}NmAtiGetNetInfoReq;
|
||||
|
||||
typedef struct NmAtiGetDnsServerReq_Tag
|
||||
{
|
||||
UINT8 cid;
|
||||
UINT8 rsvd0;
|
||||
UINT16 rsvd1;
|
||||
}NmAtiGetDnsServerReq;
|
||||
|
||||
typedef struct NmAtiSetDnsServerReq_Tag
|
||||
{
|
||||
UINT8 cid;
|
||||
NmNetIfDnsCfg dnsCfg;
|
||||
}NmAtiSetDnsServerReq;
|
||||
|
||||
typedef struct NmAtiClearDnsCacheReq_Tag
|
||||
{
|
||||
|
||||
BOOL bAll;
|
||||
UINT8 rsvd0;
|
||||
UINT16 rsvd1;
|
||||
CHAR name[DNS_MAX_NAME_LENGTH];
|
||||
}NmAtiClearDnsCacheReq;
|
||||
|
||||
typedef struct NmAtiSetDnsCacheReq_Tag
|
||||
{
|
||||
|
||||
BOOL bEanble;
|
||||
UINT8 rsvd0;
|
||||
UINT16 rsvd1;
|
||||
}NmAtiSetDnsCacheReq;
|
||||
|
||||
typedef struct NmAtiGetLanDataPathCapReq_Tag
|
||||
{
|
||||
UINT8 lanType; //NmLanNetType
|
||||
UINT8 rsvd0;
|
||||
UINT16 rsvd1;
|
||||
}NmAtiGetLanDataPathCapReq;
|
||||
|
||||
typedef struct NmAtiGetLanDataPathStatusReq_Tag
|
||||
{
|
||||
UINT8 lanType; //NmLanNetType
|
||||
UINT8 rsvd0;
|
||||
UINT16 rsvd1;
|
||||
}NmAtiGetLanDataPathStatusReq;
|
||||
|
||||
typedef struct NmAtiGetLanDataPathHostInfoReq_Tag
|
||||
{
|
||||
UINT8 lanType; //NmLanNetType
|
||||
UINT8 rsvd0;
|
||||
UINT16 rsvd1;
|
||||
}NmAtiGetLanDataPathHostInfoReq;
|
||||
|
||||
|
||||
#if 0
|
||||
/*
|
||||
* the netif related ip info
|
||||
*/
|
||||
typedef struct NmNetIpv6Info_Tag{
|
||||
ip6_addr_t ipv6Addr;
|
||||
ip6_addr_t ipv6LinkLocalAddr;
|
||||
|
||||
UINT8 dnsNum;
|
||||
UINT8 rsvd0;
|
||||
UINT16 ipv6GetPrefixDelay;
|
||||
ip6_addr_t dns[NM_PDN_TYPE_MAX_DNS_NUM];
|
||||
}NmNetIpv6Info; //52 bytes
|
||||
#endif
|
||||
/*
|
||||
* the netif related ip info
|
||||
*/
|
||||
typedef struct NmNetIpv6Info_Tag{
|
||||
ip6_addr_t ipv6Addr; /* ipv6 global addree */
|
||||
|
||||
UINT8 dnsNum;
|
||||
UINT8 rsvd0;
|
||||
UINT16 rsvd1;
|
||||
|
||||
ip6_addr_t dns[NM_PDN_TYPE_MAX_DNS_NUM];
|
||||
}NmNetIpv6Info; //52 bytes
|
||||
|
||||
|
||||
typedef struct NmNetIpv4Info_Tag{
|
||||
ip4_addr_t ipv4Addr;
|
||||
|
||||
UINT8 dnsNum;
|
||||
UINT8 rsvd0;
|
||||
UINT16 rsvd1;
|
||||
ip4_addr_t dns[NM_PDN_TYPE_MAX_DNS_NUM];
|
||||
}NmNetIpv4Info; //16 bytes
|
||||
|
||||
/*
|
||||
* netif type
|
||||
*/
|
||||
typedef enum NmNetifType_Tag
|
||||
{
|
||||
NM_INVALID_NETIF,
|
||||
NM_DEFAULT_NETIF, //default netif, all socket data default to send via this netif
|
||||
NM_IMS_NETIF, //FFS
|
||||
NM_OTHER_NETIF
|
||||
}NmNetifType;
|
||||
|
||||
|
||||
/*
|
||||
* netif status
|
||||
*/
|
||||
typedef enum _EPAT_NmNetifStatus_Tag
|
||||
{
|
||||
/*
|
||||
* no netif created, and UE is not under dialing
|
||||
*/
|
||||
NM_NO_NETIF_NOT_DIAL,
|
||||
|
||||
/*
|
||||
* No netif created
|
||||
* 1> maybe UE is not registered, but already under dialing, and NETIF maybe be OK later
|
||||
* 2> or APP request one specific NETIF (by CID), which not created,
|
||||
* 3> when a NETIF deactivated
|
||||
*/
|
||||
NM_NO_NETIF_OR_DEACTIVATED,
|
||||
|
||||
/*
|
||||
* netif is created, but NETIF is OOS
|
||||
*/
|
||||
NM_NETIF_OOS,
|
||||
|
||||
/*
|
||||
* NETIF is suspend
|
||||
* When NETIF is OOS, must be also suspend, in such case, state should be set to OOS
|
||||
*/
|
||||
//NM_NETIF_SUSPEND,
|
||||
|
||||
/*
|
||||
* NETIF is activated
|
||||
*/
|
||||
NM_NETIF_ACTIVATED,
|
||||
|
||||
#if 0
|
||||
/*
|
||||
* NETIF ACTED, but some info changed, such as:
|
||||
* 1> ipv4v6 type, ipv6 RS success later, need to report NETIF changed;
|
||||
* 2> ipv4v6 two bearers, if one bearer deactivated, but another one is still exist, also need to report NETIF changed;
|
||||
* 3> This status only used for event indication report;
|
||||
*/
|
||||
NM_NETIF_ACTIVATED_INFO_CHNAGED
|
||||
#endif
|
||||
}NmNetifStatus;
|
||||
|
||||
/*
|
||||
* ps/wan net status change cause
|
||||
*/
|
||||
typedef enum _EPAT_NmNetifStatusChangeCause_Tag
|
||||
{
|
||||
NM_STATUS_CHANGE_INVALID,
|
||||
NM_STATUS_CHANGE_LINK_UP, /* IPV6 and IPV4 bearer/netif set up, maybe one IPV4V6 bearer, or two bearers (one Ipv4, one Ipv6) */
|
||||
NM_STATUS_CHANGE_LINK_UP_IPV4, /* Only IPV4 bearer/netif set up */
|
||||
NM_STATUS_CHANGE_LINK_UP_IPV6, /* Only IPV6 bearer/netif set up */
|
||||
|
||||
NM_STATUS_CHANGE_RA_SUCCESS, /* IPV6 RS succ, IPV6 full address gotten */
|
||||
NM_STATUS_CHANGE_RA_TIMEOUT, /* IPV6 RS timeout */
|
||||
NM_STATUS_CHANGE_ENTER_OOS,
|
||||
NM_STATUS_CHANGE_EXIT_OOS,
|
||||
|
||||
NM_STATUS_CHANGE_LINK_DOWN, /* bearer/netif down, which bearer? CID indicated in: NmAtiNetifInfo->ipv4Cid/ipv6Cid */
|
||||
NM_STATUS_CHANGE_LINK_DOWN_IPV4, /* 1> If two bearers used for this netif, this just means IPV4 bearer deactivated,
|
||||
* and only IPV6 bearer now.
|
||||
* 2> which IPV4 bearer deactivated? indicated in: NmAtiNetifInfo->ipv4Cid.
|
||||
*/
|
||||
NM_STATUS_CHANGE_LINK_DOWN_IPV6, /* 1> If two bearers used for this netif, this just means IPV6 bearer deactivated,
|
||||
* and only IPV4 bearer now.
|
||||
* 2> which IPV4 bearer deactivated? indicated in: NmAtiNetifInfo->ipv6Cid.
|
||||
*/
|
||||
#if 0
|
||||
NM_STATUS_CHANGE_LINK_UP_PDN_IPV4_ONLY, /* Ipv4v6 bearer request, but only ipv4 supported/activated */
|
||||
NM_STATUS_CHANGE_LINK_UP_PDN_IPV6_ONLY, /* Ipv4v6 bearer request, but only ipv6 supported/activated */
|
||||
NM_STATUS_CHANGE_LINK_UP_PDN_SINGLE_ADDRESS_ONLY, /* Ipv4v6 bearer request, but only ipv4 or v6 supported/activated */
|
||||
NM_STATUS_CHANGE_LINK_UP_PDN_SINGLE_ADDR_ONLY_ALLOWED_AND_SECOND_BEARER_FAILED, /* Ipv4v6 bearer request, and the second bearer act failed */
|
||||
#endif
|
||||
NM_STATUS_CHANGE_OTHERS,
|
||||
}NmNetifStatusChangeCause;
|
||||
|
||||
/*
|
||||
* lan net status change cause
|
||||
*/
|
||||
typedef enum NmLanNetifStatusChangeCause_Tag
|
||||
{
|
||||
NM_LAN_STATUS_CHANGE_INVALID,
|
||||
NM_LAN_STATUS_CHANGE_LINK_UP, // the bind wan has active,then the lan link up success, mabybe one IPV4IPV6 wan
|
||||
NM_LAN_STATUS_CHANGE_LINK_DOWN, // the lan link down
|
||||
NM_LAN_STATUS_CHANGE_LAN_BIND, // for nat mode, the lan link up has already,the the lan bind with one active wan
|
||||
NM_LAN_STATUS_CHANGE_LAN_UNBIND,// for nat mode, the lan link up has already,the the lan unbind with one active wan
|
||||
NM_LAN_STATUS_CHANGE_WAN_LINK_UP,// for nat mode, the lan link up has already and bind a deactive wan, than the wan active
|
||||
NM_LAN_STATUS_CHANGE_WAN_LINK_DOWN,// for nat mode, the lan link up has already and bind a active wan, than the wan deactive
|
||||
NM_LAN_STATUS_CHANGE_OTHERS,
|
||||
}NmLanNetifStatusChangeCause;
|
||||
|
||||
|
||||
#if 0
|
||||
/*
|
||||
* One NETIF info
|
||||
*/
|
||||
typedef struct NmAtiNetifInfo_Tag
|
||||
{
|
||||
UINT8 netStatus; //NmNetifStatus
|
||||
UINT8 netifType; //NmNetifType
|
||||
UINT8 ipType; //NmNetIpType
|
||||
UINT8 cause; //NmNetifStatusChangeCause
|
||||
|
||||
/*
|
||||
* 1> if NETIF is ipv4v6 type:
|
||||
* a> if two bearers created, "ipv4Cid" is for IPV4 bearer, and "ipv6Cid" is for IPV6 bearer
|
||||
* b> if one bearer (ipv4v6) created, "ipv4Cid" = "ipv6Cid"
|
||||
* 2> if NETIF is ipv4 type
|
||||
* a> "ipv6Cid" should set to NM_PS_INVALID_CID
|
||||
* 3> if NETIF is ipv6 type
|
||||
* a> "ipv4Cid" should set to NM_PS_INVALID_CID
|
||||
*/
|
||||
UINT8 ipv4Cid;
|
||||
UINT8 ipv6Cid;
|
||||
UINT16 mtu; //mtu size
|
||||
|
||||
NmNetIpv4Info ipv4Info; //first need to check "ipType", if "ipType" indicate ipv4 or ipv4v6, then this info must be valid
|
||||
NmNetIpv6Info ipv6Info; //first need to check "ipType", if "ipType" indicate ipv6 or ipv4v6, then this info must be valid
|
||||
}NmAtiNetifInfo; // 76 bytes
|
||||
#endif
|
||||
|
||||
/*
|
||||
* One WAN NETIF basic info, note, these info will return to user, should be clear
|
||||
*/
|
||||
typedef struct NmAtiNetifInfo_Tag
|
||||
{
|
||||
UINT8 netStatus; //NmNetifStatus
|
||||
UINT8 netifType; //NmNetifType
|
||||
UINT8 ipType; //NmNetIpType
|
||||
UINT8 rsvd0;
|
||||
|
||||
/*
|
||||
* 1> if NETIF is ipv4v6 type:
|
||||
* a> if two bearers created, "ipv4Cid" is for IPV4 bearer, and "ipv6Cid" is for IPV6 bearer
|
||||
* b> if one bearer (ipv4v6) created, "ipv4Cid" = "ipv6Cid"
|
||||
* 2> if NETIF is ipv4 type
|
||||
* a> "ipv6Cid" should set to LWIP_PS_INVALID_CID
|
||||
* 3> if NETIF is ipv6 type
|
||||
* a> "ipv4Cid" should set to LWIP_PS_INVALID_CID
|
||||
* ==================================================
|
||||
* Note, in case of "NmAtiNetInfoInd" indication.
|
||||
* These "ipv4Cid" and "ipv6Cid" maybe set to valid value, to indicate which bearer/netif is deactivated
|
||||
*/
|
||||
UINT8 ipv4Cid;
|
||||
UINT8 ipv6Cid;
|
||||
UINT16 mtu; //mtu size
|
||||
|
||||
NmNetIpv4Info ipv4Info; //first need to check "ipType", if "ipType" indicate ipv4 or ipv4v6, then this info must be valid
|
||||
NmNetIpv6Info ipv6Info; //first need to check "ipType", if "ipType" indicate ipv6 or ipv4v6, then this info must be valid
|
||||
}NmAtiNetifInfo; // 76 bytes
|
||||
|
||||
|
||||
#if 0
|
||||
/*
|
||||
* Result for: NM_ATI_SYNC_GET_NET_INFO_REQ, just return NET info info
|
||||
*/
|
||||
typedef struct NmAtiGetNetInfoRet_Tag
|
||||
{
|
||||
NmAtiNetifInfo netifInfo;
|
||||
}NmAtiGetNetInfoRet; //76 bytes
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
/*
|
||||
* NM ATI SYNC result
|
||||
*/
|
||||
typedef struct NmAtiSyncRet_Tag
|
||||
{
|
||||
union {
|
||||
NmAtiGetNetInfoRet netInfoRet; //76 bytes
|
||||
NmNetIfDnsCfg getDnsServer; //84 bytes
|
||||
}body;
|
||||
}NmAtiSyncRet; // 84 bytes
|
||||
#endif
|
||||
|
||||
/******************************************************************************
|
||||
* NM_ATI_NET_INFO_IND
|
||||
* NmAtiNetInfoInd
|
||||
******************************************************************************/
|
||||
typedef struct NmAtiNetInfoInd_Tag
|
||||
{
|
||||
UINT8 indCause; //NmNetifStatusChangeCause
|
||||
UINT8 rsvd0;
|
||||
UINT16 rsvd1;
|
||||
|
||||
NmAtiNetifInfo netifInfo;
|
||||
}NmAtiNetInfoInd;
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*****************************************************************************
|
||||
* Functions
|
||||
*****************************************************************************
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
* NetMgrLinkUp
|
||||
* Description: net manager pdn linkup function
|
||||
* input: UINT8 cid //which CID (CAC layer ID)
|
||||
* NmIfConfiguration *ifConf //default bearer configuration
|
||||
* UINT8 bindToCid //if NW assign two bearer (one for IPV4, and another for IPV6)
|
||||
* // when second bearer setup, need to bind to orig "netif"
|
||||
* // if set to "255", just means not such case
|
||||
* BOOL bWakeup; //whether this NETIF/bearer is linked up during sleep2/hib wake up procedure
|
||||
* output: NmResult;
|
||||
* Comment:
|
||||
******************************************************************************/
|
||||
NmResult NetMgrLinkUp(UINT8 cid, NmIfConfiguration *pIfCfg, UINT8 bindToCid, BOOL bWakeUp);
|
||||
|
||||
/*
|
||||
* Netmgr dedicated bearer linkup
|
||||
*/
|
||||
NmResult NetMgrDedLinkUp(UINT8 cid, UINT8 pcid, BOOL bWakeUp);
|
||||
|
||||
/******************************************************************************
|
||||
* NetMgrLinkDown
|
||||
* Description: netmngr pdn linkdown function
|
||||
* input: UINT8 cid
|
||||
* output: NmResult
|
||||
* Comment:
|
||||
******************************************************************************/
|
||||
NmResult NetMgrLinkDown(UINT8 cid);
|
||||
|
||||
/*
|
||||
* Netmgr default/dedicated bearer TFT config
|
||||
*/
|
||||
NmResult NetMgrTftConfig(UINT8 cid, UINT8 pfNum, CmiPsPacketFilter *pPFList);
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* NetMgrLanLinkLayerStatusChange
|
||||
* Description: notify the tcpip stack the LAN device link layer status change
|
||||
* input: (NmLanType type, NmLanLinkStatus newStatus)
|
||||
* output:
|
||||
* return: NmResult
|
||||
* Comment: called by rndis/ppp service or psdial
|
||||
* the default link layer status of LAN is disconnected, and if the status has been change, it must be notify to tcpip stack by this API
|
||||
******************************************************************************/
|
||||
NmResult NetMgrLanLinkLayerStatusChange(NmLanType type, NmLanLinkStatus newStatus);
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* NetMgrGetNetInfo
|
||||
* Description: get UE wan net info
|
||||
* input: UINT8 cid, NmAtiGetNetInfoRet *wanInfo
|
||||
* output: NmResult
|
||||
* Comment: called by app
|
||||
* if cid is LWIP_PS_INVALID_CID, will return default netif status
|
||||
******************************************************************************/
|
||||
NmResult NetMgrGetNetInfo(UINT8 cid, NmAtiNetifInfo *pWanInfo);
|
||||
|
||||
/******************************************************************************
|
||||
* NetMgrGetNetInfoWithoutPsStatusCheck
|
||||
* Description: get UE wan net info
|
||||
* input: UINT8 cid, NmAtiNetifInfo *pNetifInfo
|
||||
* output: NmResult
|
||||
* Comment: In this API not check whether PS is started, this API is only called
|
||||
* by ESM, as ESM maybe call it to get IPV6 address during wakeup procedure
|
||||
******************************************************************************/
|
||||
NmResult NetMgrGetNetInfoWithoutPsStatusCheck(UINT8 cid, NmAtiNetifInfo *pNetifInfo);
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* NetMgrGetDnsServerInfo
|
||||
* Description: get UE dns server config
|
||||
* input: UINT8 cid, NmNetIfDnsCfg *pGetDnsServer
|
||||
* output: NmResult
|
||||
* Comment: called by app
|
||||
******************************************************************************/
|
||||
NmResult NetMgrGetDnsServerInfo(UINT8 cid, NmNetIfDnsCfg *pGetDnsServer);
|
||||
|
||||
/******************************************************************************
|
||||
* NetMgrSetDnsServerInfo
|
||||
* Description: set UE dns cache
|
||||
* input: UINT8 cid, UINT8 number, ip_addr_t dns[NM_MAX_DNS_NUM]
|
||||
* output: NmResult
|
||||
* Comment: called by app
|
||||
******************************************************************************/
|
||||
NmResult NetMgrSetDnsServerInfo(UINT8 cid, UINT8 number, ip_addr_t dns[NM_MAX_DNS_NUM]);
|
||||
|
||||
/******************************************************************************
|
||||
* NetMgrClearDnsServerInfo
|
||||
* Description: clear UE dns cache
|
||||
* input: UINT8 cid, NmAtiGetNetInfoRet *wanInfo
|
||||
* output: NmResult
|
||||
* Comment: called by app
|
||||
******************************************************************************/
|
||||
NmResult NetMgrClearDnsCacheInfo(BOOL bClearAll, CHAR name[DNS_MAX_NAME_LENGTH]);
|
||||
|
||||
/******************************************************************************
|
||||
* NetMgrSetDnsCache
|
||||
* Description: enable/sidable dns cache
|
||||
* input: BOOL bEnable
|
||||
* output: NmResult
|
||||
* Comment: called by app
|
||||
******************************************************************************/
|
||||
NmResult NetMgrSetDnsCache(BOOL bEnable);
|
||||
|
||||
|
||||
/*
|
||||
* Send NET (NETIF) info (status)
|
||||
*/
|
||||
void NetMgrSendNetInfoInd(NmAtiNetInfoInd *pNetInfoInd);
|
||||
|
||||
/*
|
||||
* Proc "CMI_PS_GET_CEREG_CNF"
|
||||
*/
|
||||
void NetMgrProcCeregCnf(CmiPsGetCeregCnf *pCregCnf);
|
||||
|
||||
/*
|
||||
* Proc "CMI_PS_CEREG_IND"
|
||||
*/
|
||||
void NetMgrProcCeregInd(CmiPsCeregInd *pCregInd);
|
||||
|
||||
|
||||
/*
|
||||
* net mgr lan configuration for tcpip data path
|
||||
*/
|
||||
NmResult NetMgrLanConfig(NetMgrLanCfg *lanCfg);
|
||||
|
||||
/*
|
||||
* net mgr lan ctrl api(control the lan data path wether bind with pdp context)
|
||||
* if the same lan type has bind, it will be replace with the new pdp context
|
||||
* if the related lan tcpip data path has been actived,then you can not bind with the new pdp context, and it will return error
|
||||
*/
|
||||
NmResult NetMgrLanCtrl(NmLanCtrlAction action, NmLanNetType type, UINT8 ip4Cid, UINT8 ip6Cid);
|
||||
|
||||
|
||||
/*
|
||||
* query the lan tcpip data path capability, called by CCIO, to descide whether can do lan link up
|
||||
*/
|
||||
NmResult NetMgrQueryLanTcpipDataPathCapability(NmLanNetType lanType, NetMgrLanDataPathCap *pLanDataPathCap);
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* NetMgrLanLinkUp
|
||||
* Description: netmngr establish LAN TCPIP data path function
|
||||
* input:
|
||||
* output:
|
||||
* return: NmResult
|
||||
* Comment: called by rndis/ppp service
|
||||
******************************************************************************/
|
||||
NmResult NetMgrLanLinkUp(NmLanType lanType, BOOL bWakeUp, UINT16 mtu);
|
||||
|
||||
/******************************************************************************
|
||||
* NetMgrLanDataPathDown
|
||||
* Description: netmngr LAN data path disconnect function
|
||||
* input: UINT8 lanChannelId(channel[NM_LAN_RNDIS_CHANNEL_ID]->rndis/ecm, channel[NM_LAN_PPP_CHANNEL_ID]->ppp)
|
||||
* output:
|
||||
* return:NmResult
|
||||
* Comment:called by psdial or ps event(NM_ATI_NET_INFO_IND) callback or rndis/ppp service
|
||||
******************************************************************************/
|
||||
NmResult NetMgrLanLinkDown(NmLanType lanType);
|
||||
|
||||
|
||||
/*
|
||||
* net mgr query lan tcpip data path status api
|
||||
*/
|
||||
NmResult NetMgrGetLanTcpipDataPathStatus(NmLanNetType lanType, NetMgrLanChannelTcpipDataPathStatus *status);
|
||||
|
||||
/*
|
||||
* notify the CMS/psdial the LAN info
|
||||
*/
|
||||
void NetMgrNotifyAtiLanInfoInd(NmAtiLanInfo *pAtiLanInfo);
|
||||
|
||||
/*
|
||||
* net mgr query lan tcpip data path host info api
|
||||
*/
|
||||
NmResult NetMgrGetLanTcpipDataPathHostInfo(NmLanNetType lanType, NetMgrLanTcpipDataPathHostInfo *info);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,858 @@
|
||||
#ifndef __PS_COMM_TYPE_H__
|
||||
#define __PS_COMM_TYPE_H__
|
||||
|
||||
/******************************************************************************
|
||||
******************************************************************************
|
||||
Copyright: - 2017, All rights reserved by AirM2M Ltd.
|
||||
File name: - pscommtype.h
|
||||
Description: - PS common typedef structure
|
||||
History: - 10/19/2018, Originated by Jason
|
||||
******************************************************************************
|
||||
******************************************************************************/
|
||||
#include "pssys.h"
|
||||
#include "psl1commtype.h"
|
||||
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*****************************************************************************
|
||||
* MACRO
|
||||
*****************************************************************************
|
||||
******************************************************************************/
|
||||
#define SUPPORT_MAX_FREQ_NUM 8
|
||||
#define MAX_PLMN_LIST_SIZE 6 //this value is max number of plmn Id in SIB1, maxPLMN-r11
|
||||
#define CE_INVALID_MCC 0xFFFF
|
||||
#define SUPPORT_MAX_PLMN_NUM 20 //TBD
|
||||
#define CEMM_PLMN_LIST_MAX_NUM 16
|
||||
#define MAX_BAND_MASK_NUM 3 //the max number of UINT32 bandmask, i.e. the max supported band num is 32*MAX_BAND_MASK_NUM
|
||||
#define MAX_NAS_MSG_BITMAP_NUM 8 // equal to 256/32
|
||||
|
||||
#define PS_INVALID_PHY_CELL_ID 0xFFFF
|
||||
#define PS_MAX_PHY_CELL_ID 503
|
||||
|
||||
//SHA-256 MACROS
|
||||
#define SHA256_HASH_WORDS 8 /* number of words in H(0) */
|
||||
#define SHA256_OUTPUT_SIZE 32 /* Block size (in bytes) of the output of the Approved hash function. */
|
||||
#define SHA256_BLOCK_SIZE 64 /* Block size (in bytes) of the input to the Approved hash function. */
|
||||
|
||||
#ifndef MAX
|
||||
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
#ifndef MIN
|
||||
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
#define NB_DRB_NUM 2
|
||||
#define CAT_DRB_NUM 11
|
||||
|
||||
#define MAX_DRB_NUM CAT_DRB_NUM
|
||||
|
||||
/* PAP/CHAP ID and pwd max length */
|
||||
#define CESM_MAX_AUTH_STR_LEN 64
|
||||
|
||||
/* CID is max to 15, and valid value: [0:15], in PS layer */
|
||||
#define PS_MAX_PDP_CID 15
|
||||
#define PS_PDP_CID_NUM 16 /* [0:15] */
|
||||
#define PS_INVALID_PDP_CID 255
|
||||
#define MAX_EPS_BEARER_CONTEXT_NUM 11
|
||||
#define PS_APN_MAX_LEN 100
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Part of MARCO used to parse IP header
|
||||
*/
|
||||
#define PS_IP_HDR_GET_VER(ptr) ((*(UINT8*)(ptr)) >> 4)
|
||||
|
||||
#define PS_IP_PROTO_UDP 17
|
||||
#define PS_IP_PROTO_TCP 6
|
||||
#define PS_IP_PROTO_ESP 50
|
||||
|
||||
#define LITTLE_ENDIAN_BITFIELD
|
||||
|
||||
#if defined(LITTLE_ENDIAN_BITFIELD)
|
||||
#define PS_HTONS(x) ((((x) & 0x00ffUL) << 8) | (((x) & 0xff00UL) >> 8))
|
||||
#define PS_HTONL(x) ((((x) & 0x000000ffUL) << 24) | \
|
||||
(((x) & 0x0000ff00UL) << 8) | \
|
||||
(((x) & 0x00ff0000UL) >> 8) | \
|
||||
(((x) & 0xff000000UL) >> 24))
|
||||
#else
|
||||
#define PS_HTONS(x) (x)
|
||||
#define PS_HTONL(x) (x)
|
||||
#endif
|
||||
|
||||
#define PS_NTOHS(x) PS_HTONS((x))
|
||||
#define PS_NTOHL(x) PS_HTONL((x))
|
||||
|
||||
/* Get ipv6 header value */
|
||||
#define PS_IP6H_V(hdr) ((PS_NTOHL((hdr)->ver_tc_fl) >> 28) & 0x0f)
|
||||
#define PS_IP6H_TC(hdr) ((PS_NTOHL((hdr)->ver_tc_fl) >> 20) & 0xff)
|
||||
#define PS_IP6H_FL(hdr) (PS_NTOHL((hdr)->ver_tc_fl) & 0x000fffff)
|
||||
|
||||
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*****************************************************************************
|
||||
* STRUCT
|
||||
*****************************************************************************
|
||||
******************************************************************************/
|
||||
|
||||
typedef UINT16 AccessClass;
|
||||
typedef UINT16 AccessTechnologyId;
|
||||
|
||||
#define PLMN_GET_PURE_MNC(mncWithAddInfo) ((mncWithAddInfo)&0xFFF)
|
||||
#define PLMN_IS_2_DIGIT_MNC(mncWithAddInfo) (((mncWithAddInfo)>>12) == 0x0F)
|
||||
|
||||
#define PLMN_SET_MNC_WITH_ADD_INFO(twoDigitType, pureMnc) ((twoDigitType)?((pureMnc)|0xF000):((pureMnc)&0xFFF))
|
||||
|
||||
#define IS_VALID_PLMN(plmn) (((plmn).mcc != 0) ? TRUE : FALSE)
|
||||
|
||||
#define IS_SAME_PLMN(plmn1, plmn2) (((plmn1).mcc == (plmn2).mcc) && ((plmn1).mncWithAddInfo == (plmn2).mncWithAddInfo))
|
||||
|
||||
typedef enum PlmnMncDigitType_enum
|
||||
{
|
||||
PLMN_UNKNOW_DIGIT_MNC = 0,
|
||||
PLMN_2_DIGIT_MNC = 2,
|
||||
PLMN_3_DIGIT_MNC = 3
|
||||
}PlmnMncDigitType;
|
||||
|
||||
/******************************************************************************
|
||||
* NwMode
|
||||
* NB_IOT, EMTC, etc...
|
||||
******************************************************************************/
|
||||
typedef enum _SIG_EPAT_CCM_CFG_NW_MODE
|
||||
{
|
||||
NB_IOT = 0,
|
||||
CAT1,
|
||||
EMTC_IOT
|
||||
}NwMode;
|
||||
|
||||
/******************************************************************************
|
||||
* UeService
|
||||
* EPS/NON_EPS/EPS AND NON_EPS
|
||||
******************************************************************************/
|
||||
typedef enum _SIG_EPAT_CCM_CFG_UE_SERVICE
|
||||
{
|
||||
EPS_ONLY = 0, // NB
|
||||
NON_EPS = 1,
|
||||
EPS_AND_NON_EPS = 2,
|
||||
NON_SERVICE
|
||||
}UeService;
|
||||
|
||||
typedef UINT8 UeServiceT;
|
||||
|
||||
/******************************************************************************
|
||||
* UeUsageSetting
|
||||
* VOICE_CENTRIC/DATA_CENTRIC
|
||||
******************************************************************************/
|
||||
typedef enum UeUsageSetting_Tag
|
||||
{
|
||||
VOICE_CENTRIC = 0,
|
||||
DATA_CENTRIC
|
||||
}UeUsageSetting;
|
||||
|
||||
typedef UINT8 UeUsageSettingT;
|
||||
|
||||
/******************************************************************************
|
||||
* VoiceDomainPreference
|
||||
* CS_VOICE_ONLY/IMS_PS_VOICE_ONLY
|
||||
* CS_VOICE_PREFERRED_IMS_PS_VOICE_SECONDARY
|
||||
* IMS_PS_VOICE_PREFERRED_CS_VOICE_SECONDARY
|
||||
******************************************************************************/
|
||||
typedef enum VoiceDomainPreference_Tag
|
||||
{
|
||||
CS_VOICE_ONLY = 0,
|
||||
IMS_PS_VOICE_ONLY = 1,
|
||||
CS_VOICE_PREFERRED_IMS_PS_VOICE_SECONDARY = 2,
|
||||
IMS_PS_VOICE_PREFERRED_CS_VOICE_SECONDARY
|
||||
}VoiceDomainPreference;
|
||||
|
||||
typedef UINT8 VoiceDomainPreferenceT;
|
||||
|
||||
/******************************************************************************
|
||||
* UE modes of operation for EPS
|
||||
* PS_MODE_2_OF_OPERATION
|
||||
* CSPS_MODE_1_OF_OPERATION
|
||||
* CSPS_MODE_2_OF_OPERATION
|
||||
* PS_MODE_1_OF_OPERATION
|
||||
******************************************************************************/
|
||||
typedef enum _SIG_EPAT_CCM_CFG_UE_OPERATION_MODE
|
||||
{
|
||||
PS_MODE_2_OF_OPERATION = 0,
|
||||
CSPS_MODE_1_OF_OPERATION = 1,
|
||||
CSPS_MODE_2_OF_OPERATION = 2,
|
||||
PS_MODE_1_OF_OPERATION = 3
|
||||
}PsUeOperationModeEnum;
|
||||
|
||||
typedef UINT8 UeOperationModeT;
|
||||
|
||||
/******************************************************************************
|
||||
* PlmnType
|
||||
* HPLMN/EHPLMN/RPLMN/EPLMN.....
|
||||
******************************************************************************/
|
||||
typedef enum _EPAT_PlmnTypeEnum_Tag
|
||||
{
|
||||
HPLMN = 0, //home PLMN, derived from IMSI
|
||||
EHPLMN, //equivalent home PLMN
|
||||
//RPLMN, //registered PLMN, not the same level meaning
|
||||
//EPLMN, //equivalent PLMN, not the same level meaning
|
||||
VPLMN, //visited PLMN
|
||||
UPLMN, //user controlled PLMN
|
||||
OPLMN, //operator controlled PLMN
|
||||
FPLMN, //forbidden PLMN
|
||||
APLMN, //available PLMN
|
||||
}PlmnType;
|
||||
|
||||
/******************************************************************************
|
||||
* CipheringAlgorithm
|
||||
* EEA0/EEA1/EEA2/EEA3
|
||||
******************************************************************************/
|
||||
typedef enum CipheringAlgorithmTag
|
||||
{
|
||||
// see TS 34.401 5.1.3.2
|
||||
EEA0 = 0,
|
||||
EEA1 = 1,
|
||||
EEA2 = 2,
|
||||
EEA3 = 3,
|
||||
}CipheringAlgorithm;
|
||||
|
||||
/******************************************************************************
|
||||
* IntegrityAlgorithm
|
||||
* EIA0/EIA1/EIA2/EIA3
|
||||
******************************************************************************/
|
||||
typedef enum _EPAT_IntegrityAlgorithmTag
|
||||
{
|
||||
// see TS 34.401 5.1.4.2
|
||||
EIA0 = 0,
|
||||
EIA1 = 1,
|
||||
EIA2 = 2,
|
||||
EIA3 = 3
|
||||
}IntegrityAlgorithm;
|
||||
|
||||
/*
|
||||
* 24.301: 9.9.4.25 Release assistance indication
|
||||
* 0 0 No information regarding DDX is conveyed by the information element. If
|
||||
* received it shall be interpreted as 'neither value "01" nor "10" applies'
|
||||
* 0 1 No further uplink or downlink data transmission subsequent to the uplink data
|
||||
* transmission is expected
|
||||
* 1 0 Only a single downlink data transmission and no further uplink data
|
||||
* transmission subsequent to the uplink data transmission is expected
|
||||
* 1 1 reserved
|
||||
*/
|
||||
typedef enum DataRelAssistIndEnum_Tag
|
||||
{
|
||||
DATA_RAI_NO_INFO = 0,
|
||||
DATA_RAI_NO_UL_DL_FOLLOWED = 1,
|
||||
DATA_RAI_ONLY_DL_FOLLOWED = 2,
|
||||
DATA_RAI_RESERVED = 3
|
||||
}DataRelAssistIndEnum;
|
||||
|
||||
/******************************************************************************
|
||||
* Tai
|
||||
* Tai = mcc + mnc + tac
|
||||
******************************************************************************/
|
||||
typedef struct Tai_Tag
|
||||
{
|
||||
Plmn plmn;
|
||||
UINT16 tac;
|
||||
UINT16 reserved;
|
||||
}Tai;
|
||||
|
||||
/******************************************************************************
|
||||
* Lai
|
||||
* Lai = mcc + mnc + lac
|
||||
******************************************************************************/
|
||||
typedef struct LocationAreaIdTag
|
||||
{
|
||||
Plmn plmn;
|
||||
UINT16 lac;
|
||||
UINT16 reserved;
|
||||
}
|
||||
LocationAreaId;
|
||||
|
||||
/******************************************************************************
|
||||
* Kasme
|
||||
******************************************************************************/
|
||||
#define KASME_SIZE 32
|
||||
typedef struct AsmeKey_Tag
|
||||
{
|
||||
UINT8 data[KASME_SIZE];
|
||||
}AsmeKey;
|
||||
|
||||
/******************************************************************************
|
||||
* NAS COUNT
|
||||
******************************************************************************/
|
||||
#define NAS_COUNT_SIZE 4
|
||||
typedef struct NasCount_Tag
|
||||
{
|
||||
UINT8 data[NAS_COUNT_SIZE];
|
||||
}NasCount;
|
||||
|
||||
/******************************************************************************
|
||||
* IMSI
|
||||
******************************************************************************/
|
||||
#define MAX_IMSI_LENGTH 8
|
||||
typedef struct Imsi_Tag
|
||||
{
|
||||
UINT8 length;
|
||||
UINT8 mncType; //PlmnMncDigitType
|
||||
AccessTechnologyId accessTech;
|
||||
UINT8 contents[MAX_IMSI_LENGTH];
|
||||
}Imsi;
|
||||
|
||||
/******************************************************************************
|
||||
* Additional Update Result
|
||||
******************************************************************************/
|
||||
typedef enum AdditionalUpdateResultTag
|
||||
{
|
||||
NO_ADDITIONAL_INFORMATION = 0,
|
||||
CS_FALLBACK_NOT_PREFERRED = 1,
|
||||
SMS_ONLY = 2,
|
||||
RESERVED_VALUE = 3
|
||||
}
|
||||
AdditionalUpdateResult;
|
||||
|
||||
/******************************************************************************
|
||||
* DCN ID
|
||||
******************************************************************************/
|
||||
typedef struct DedicatedCoreNetworkId_Tag
|
||||
{
|
||||
Plmn plmn;
|
||||
UINT16 dcnIdWithinPlmn;
|
||||
}DedicatedCoreNetworkId;
|
||||
|
||||
typedef enum TimerUnitTag
|
||||
{
|
||||
TIMER1_MULTIPLES_OF_TWO_SECONDS = 0,
|
||||
TIMER1_MULTIPLES_OF_ONE_MINUTE = 1,
|
||||
TIMER1_MULTIPLES_OF_DECIHOURS = 2,
|
||||
TIMER1_TIMER_DEACTIVATED = 7
|
||||
}
|
||||
TimerUnit;
|
||||
|
||||
typedef UINT8 TimerUnitT;
|
||||
typedef TimerUnit Timer2Unit;
|
||||
typedef UINT8 Timer2UnitT;
|
||||
|
||||
|
||||
typedef enum Timer3UnitTag
|
||||
{
|
||||
TIMER3_MULTIPLES_OF_TEN_MINUTES = 0,
|
||||
TIMER3_MULTIPLES_OF_ONE_HOUR = 1,
|
||||
TIMER3_MULTIPLES_OF_TEN_HOURS = 2,
|
||||
TIMER3_MULTIPLES_OF_TWO_SECONDS = 3,
|
||||
TIMER3_MULTIPLES_OF_THIRTY_SECONDS = 4,
|
||||
TIMER3_MULTIPLES_OF_ONE_MINUTE = 5,
|
||||
TIMER3_MULTIPLES_OF_320_HOURS = 6,
|
||||
TIMER3_TIMER_DEACTIVATED = 7
|
||||
}
|
||||
Timer3Unit;
|
||||
|
||||
typedef UINT8 Timer3UnitT;
|
||||
|
||||
typedef struct GprsTimerTag
|
||||
{
|
||||
UINT8 timerValue;
|
||||
TimerUnitT unit;
|
||||
}
|
||||
GprsTimer;
|
||||
|
||||
typedef struct _EPAT_GprsTimer2Tag
|
||||
{
|
||||
UINT8 timerValue;
|
||||
Timer2UnitT unit;
|
||||
}
|
||||
GprsTimer2; // 2 bytes
|
||||
|
||||
typedef struct _EPAT_GprsTimer3Tag
|
||||
{
|
||||
UINT8 timerValue;
|
||||
Timer3UnitT unit;
|
||||
}
|
||||
GprsTimer3;
|
||||
|
||||
/* The field contains the PTW value in seconds for WB-S1 mode */
|
||||
typedef enum PagingTimeWindowForWBModeTag
|
||||
{
|
||||
PAGING_TIME_WINDOW_WB_1_SEC_280_MS = 0,
|
||||
PAGING_TIME_WINDOW_WB_2_SEC_560_MS = 1,
|
||||
PAGING_TIME_WINDOW_WB_3_SEC_840_MS = 2,
|
||||
PAGING_TIME_WINDOW_WB_5_SEC_120_MS = 3,
|
||||
PAGING_TIME_WINDOW_WB_6_SEC_400_MS = 4,
|
||||
PAGING_TIME_WINDOW_WB_7_SEC_680_MS = 5,
|
||||
PAGING_TIME_WINDOW_WB_8_SEC_960_MS = 6,
|
||||
PAGING_TIME_WINDOW_WB_10_SEC_240_MS = 7,
|
||||
PAGING_TIME_WINDOW_WB_11_SEC_520_MS = 8,
|
||||
PAGING_TIME_WINDOW_WB_12_SEC_800_MS = 9,
|
||||
PAGING_TIME_WINDOW_WB_14_SEC_80_MS = 10,
|
||||
PAGING_TIME_WINDOW_WB_15_SEC_360_MS = 11,
|
||||
PAGING_TIME_WINDOW_WB_16_SEC_640_MS = 12,
|
||||
PAGING_TIME_WINDOW_WB_17_SEC_920_MS = 13,
|
||||
PAGING_TIME_WINDOW_WB_19_SEC_200_MS = 14,
|
||||
PAGING_TIME_WINDOW_NB_20_SEC_480_MS = 15
|
||||
}PagingTimeWindowForWBMode;
|
||||
|
||||
typedef UINT8 PagingTimeWindowForWBModeT;
|
||||
|
||||
/* The field contains the eDRX value for S1 mode */
|
||||
|
||||
/* -------------------------------------------------------------------------
|
||||
NOTE 4: The value is applicable only in WB-S1 mode. If received in NB-S1
|
||||
mode it is interpreted as if the Extended DRX parameters IE were not
|
||||
included in the message by this version of the protocol.
|
||||
|
||||
NOTE 5: The value is applicable only in WB-S1 mode. If received in NB-S1
|
||||
mode it is interpreted as 0010 by this version of the protocol.
|
||||
|
||||
NOTE 6: The value is applicable only in NB-S1 mode. If received in WB-S1
|
||||
mode it is interpreted as 1101 by this version of the protocol.
|
||||
--------------------------------------------------------------------------*/
|
||||
typedef enum EdrxValueForS1ModeTag
|
||||
{
|
||||
EDRX_CYCLE_LEN_5_SEC_120_MS = 0, /* Rfer to NOTE 4 */
|
||||
EDRX_CYCLE_LEN_10_SEC_240_MS = 1, /* Rfer to NOTE 4 */
|
||||
EDRX_CYCLE_LEN_20_SEC_480_MS = 2,
|
||||
EDRX_CYCLE_LEN_40_SEC_960_MS = 3,
|
||||
EDRX_CYCLE_LEN_61_SEC_440_MS = 4, /* Rfer to NOTE 5 */
|
||||
EDRX_CYCLE_LEN_81_SEC_920_MS = 5,
|
||||
EDRX_CYCLE_LEN_102_SEC_400_MS = 6, /* Rfer to NOTE 5 */
|
||||
EDRX_CYCLE_LEN_122_SEC_880_MS = 7, /* Rfer to NOTE 5 */
|
||||
EDRX_CYCLE_LEN_143_SEC_360_MS = 8, /* Rfer to NOTE 5 */
|
||||
EDRX_CYCLE_LEN_163_SEC_840_MS = 9,
|
||||
EDRX_CYCLE_LEN_327_SEC_680_MS = 10,
|
||||
EDRX_CYCLE_LEN_655_SEC_360_MS = 11,
|
||||
EDRX_CYCLE_LEN_1310_SEC_720_MS = 12,
|
||||
EDRX_CYCLE_LEN_2621_SEC_440_MS = 13,
|
||||
EDRX_CYCLE_LEN_5242_SEC_880_MS = 14, /* Rfer to NOTE 6 */
|
||||
EDRX_CYCLE_LEN_10485_SEC_760_MS = 15, /* Rfer to NOTE 6 */
|
||||
EDRX_CYCLE_LEN_INVALID = 0xFF /* Set to this value while AT+CEDRX=0(disable the use of eDRX and discard all parameters for eDRX) */
|
||||
}EdrxValueForS1Mode;
|
||||
|
||||
typedef UINT8 EdrxValueForS1ModeT;
|
||||
|
||||
typedef struct _EPAT_ExtendedDrxParametersTag
|
||||
{
|
||||
EdrxValueForS1ModeT edrxValue;
|
||||
PagingTimeWindowForWBModeT ptw;
|
||||
}ExtendedDrxParameters; // 2 bytes
|
||||
|
||||
typedef enum CemmCiotOptTypeEnum_Tag
|
||||
{
|
||||
CEMM_NO_CIOT_OPT = 0, // not support CIOT OPT, for NB, CP OPT is must, useless, but for CAT1, this is set to default value
|
||||
CEMM_CP_CIOT_OPT = 1,
|
||||
CEMM_UP_CIOT_OPT = 2,
|
||||
CEMM_CP_AND_UP_OPT = 3
|
||||
}CemmCiotOptTypeEnum;
|
||||
|
||||
typedef enum CemmPsmReqModeEnum_Tag
|
||||
{
|
||||
CEMM_DISABLE_PSM = 0,
|
||||
CEMM_ENABLE_PSM = 1,
|
||||
CEMM_DISCARD_PSM = 2 /* disable PSM, and discard PSM PARMs */
|
||||
}CemmPsmReqModeEnum;
|
||||
|
||||
typedef enum CemmEdrxReqModeEnum_Tag
|
||||
{
|
||||
CEMM_DISABLE_EDRX = 0,
|
||||
CEMM_ENABLE_EDRX = 1,
|
||||
CEMM_DISCARD_EDRX = 2 /* disable EDRX, and discard EDRX PARMs */
|
||||
}CemmEdrxReqModeEnum;
|
||||
|
||||
/******************************************************************************
|
||||
* EPS update status
|
||||
******************************************************************************/
|
||||
typedef enum EpsUpdateStatus_Tag
|
||||
{
|
||||
USIM_EUS_UPDATED = 0,
|
||||
USIM_EUS_NOT_UPDATED = 1,
|
||||
USIM_EUS_ROAMING_NOT_ALLOWED = 2,
|
||||
USIM_EUS_RESERVED = 7
|
||||
}EpsUpdateStatus;
|
||||
|
||||
/******************************************************************************
|
||||
* NAS key set identifier
|
||||
******************************************************************************/
|
||||
typedef enum NasKsiTag
|
||||
{
|
||||
NAS_KSI_0 = 0,
|
||||
NAS_KSI_1 = 1,
|
||||
NAS_KSI_2 = 2,
|
||||
NAS_KSI_3 = 3,
|
||||
NAS_KSI_4 = 4,
|
||||
NAS_KSI_5 = 5,
|
||||
NAS_KSI_6 = 6,
|
||||
NO_KEY_IS_AVAILABLE = 7 /* no key is available(UE to network);reserved(network to UE) */
|
||||
}NasKsi;
|
||||
|
||||
typedef enum CemmPlmnSelectTypeEnum_Tag
|
||||
{
|
||||
CEMM_DEFAULT_PLMN_REG = 0, // CEMM PLMN module decide by self
|
||||
CEMM_AUTO_PLMN_REG,
|
||||
CEMM_MANUAL_PLMN_REG,
|
||||
CEMM_MANUAL_THEN_AUTO_PLMN_REG, //if manual selection fails, automatic mode
|
||||
}CemmPlmnSelectTypeEnum;
|
||||
|
||||
typedef enum _SIG_EPAT_CEPLMN_CFG_PLMN_SEARCH_LEVEL
|
||||
{
|
||||
/*
|
||||
* OOS PLMN interval: 5s, 10s, 20s
|
||||
*/
|
||||
PLMN_SEARCH_POWER_LEVEL_NOT_CARE = 0,
|
||||
/*
|
||||
* OOS PLMN interval: 15s, 30s, 1 min (default setting)
|
||||
*/
|
||||
PLMN_SEARCH_POWER_LEVEL_NORMAL_CARE = 1,
|
||||
/*
|
||||
* OOS PLMN interval: 5 mins, 10 mins, 15 mins
|
||||
*/
|
||||
PLMN_SEARCH_POWER_LEVEL_MORE_CARE = 2,
|
||||
/*
|
||||
* OOS PLMN interval: 30s, then stop PLMN search, and let AT: AT+ECPLMNS to start PLMN search
|
||||
*/
|
||||
PLMN_SEARCH_POWER_LEVEL_STRICT_CARE = 3,
|
||||
/*
|
||||
* Don't trigger PLMN search after OOS, let user decide to start PLMN search or not
|
||||
*/
|
||||
PLMN_SEARCH_POWER_LEVEL_USER_CONTROL = 4
|
||||
}PlmnSearchPowerLevel;
|
||||
|
||||
/******************************************************************************
|
||||
* Access Point Name
|
||||
******************************************************************************/
|
||||
#define MAX_APN_NAME 100
|
||||
typedef struct AccessPointNameTag
|
||||
{
|
||||
UINT8 length;
|
||||
UINT8 reserved0;
|
||||
UINT16 reserved1;
|
||||
UINT8 name[MAX_APN_NAME];
|
||||
}AccessPointName; //104 byte
|
||||
|
||||
typedef enum ConfigurationProtocolTag
|
||||
{
|
||||
CONFIG_PROTOCOL_PPP = 0,
|
||||
CONFIG_PROTOCOL_OSP_IHOSS = 1
|
||||
}ConfigurationProtocol;
|
||||
|
||||
typedef enum PdnTypeTag
|
||||
{
|
||||
PDN_IP_V4 = 0x01,
|
||||
PDN_IP_V6 = 0x02,
|
||||
PDN_IP_V4V6 = 0x03,
|
||||
PDN_UNUSED = 0x04,
|
||||
PDN_NON_IP = 0x05
|
||||
}PdnType;
|
||||
|
||||
typedef UINT8 PdnTypeT;
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* MSGADDRESS
|
||||
******************************************************************************/
|
||||
#define MAX_SMS_ADDRESS_LENGTH 20
|
||||
#define MAX_SMS_LEN 160
|
||||
#define UICC_MAX_ADDR_LEN 20
|
||||
|
||||
typedef struct MsgAddress_Tag
|
||||
{
|
||||
UINT8 length;
|
||||
UINT8 typeOfNumber; //TypeOfNumber
|
||||
UINT8 numberPlanId; //NumberingPlanId
|
||||
UINT8 reserved;
|
||||
UINT8 addressValue[MAX_SMS_ADDRESS_LENGTH];
|
||||
}MsgAddress;
|
||||
|
||||
typedef struct UsatAddressTag
|
||||
{
|
||||
UINT8 TON; //UsatBcdTON
|
||||
UINT8 NPI; //UsatBcdNPI
|
||||
UINT8 len;
|
||||
UINT8 addrValue[UICC_MAX_ADDR_LEN]; //Bcd number
|
||||
}
|
||||
UsatAddress;
|
||||
|
||||
typedef enum UsatSmsTpduType_Tag
|
||||
{
|
||||
USAT_SMTPDU_DELIVER = 0,
|
||||
USAT_SMTPDU_SUBMIT = 1,
|
||||
USAT_SMTPDU_COMMAND = 2
|
||||
}UsatSmsTpduType;
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* SMS Protocol ID
|
||||
*****************************************************************************/
|
||||
typedef struct SmsProtocolIdentifier_Tag
|
||||
{
|
||||
UINT8 smsPidType; //SmsPidType
|
||||
union
|
||||
{
|
||||
UINT8 smAlProtocolid; /* NO_INTERWORKING */
|
||||
UINT8 interWorkingProtocolId; /* TELEMATIC_INTERWORKING */
|
||||
UINT8 scCommandProtocolId; /* SHORT_MESSAGE_RELATED */
|
||||
UINT8 meCommandProtocolId; /* ME_RELATED */
|
||||
UINT8 reservedProtocolId; /* RESERVED */
|
||||
UINT8 scSpecificProtocolId; /* SC_SPECIFIC_USE */
|
||||
UINT8 pId;
|
||||
}protocolId;
|
||||
UINT16 reserved;
|
||||
}SmsProtocolIdentifier;
|
||||
|
||||
/******************************************************************************
|
||||
* SMS Data Coding
|
||||
*****************************************************************************/
|
||||
|
||||
typedef enum MessageWaitingIndicationType_Tag
|
||||
{
|
||||
VOICEMAIL_MESSAGE_WAITING = 0x00, /* Voicemail Message Waiting */
|
||||
FAX_MESSAGE_WAITING = 0x01, /* Fax Message Waiting */
|
||||
ELECTRONIC_MAIL_MESSAGE_WAITING = 0x02, /* Electronic Mail Message Waiting */
|
||||
OTHER_MESSAGE_WAITING = 0x03 /* Other Message Waiting */
|
||||
}MessageWaitingIndicationType;
|
||||
|
||||
typedef struct MessageWaitingIndication_Tag
|
||||
{
|
||||
BOOL discardMessage; /* Discard Message */
|
||||
BOOL storeMessage; /* Store Message */
|
||||
BOOL setIndActive; /* Set Indication Active(TRUE)/Inactive(FALSE) */
|
||||
UINT8 waitingIndType; /* MessageWaitingIndicationType */
|
||||
}MessageWaitingIndication;
|
||||
|
||||
typedef struct SmsDataCodingSchemeTag
|
||||
{
|
||||
UINT8 smsCoding; /* SmsCoding */
|
||||
UINT8 smsClass; /* SmsMessageClass */
|
||||
BOOL bCompressed; /* the text is compressed */
|
||||
BOOL bCodingAndClass; /* Data coding/message class */
|
||||
BOOL bMessageWait; /* Message Waiting Indication Group */
|
||||
MessageWaitingIndication waitIndication; /* Message Waiting Indication Group content */
|
||||
}SmsDataCodingScheme;
|
||||
|
||||
/*
|
||||
* Uicc Pin status
|
||||
*/
|
||||
typedef struct UiccPinStatusTag
|
||||
{
|
||||
UINT8 keyRef; /* UiccKeyRefValue */
|
||||
UINT8 numRemainingAttempts;/* the number of remianing PIN attempts */
|
||||
UINT8 bEnabled:1; /* indicate whether the status of PIN is enable or not (disabled) */
|
||||
UINT8 bVerified:1; /* indicate whether the status of PIN is verified or not */
|
||||
UINT8 bUsed:1; /* TS102.221 9.5.2 The usage qualifier indicates whether an enabled PIN need to be verfied for access */
|
||||
UINT8 reserved1:5;
|
||||
UINT8 reserved2;
|
||||
}
|
||||
UiccPinStatus;
|
||||
|
||||
/*
|
||||
* Uicc File path
|
||||
*/
|
||||
#define MAX_FILE_PATH_ELEMENTS 10
|
||||
typedef struct UiccFilePathTag
|
||||
{
|
||||
UINT8 len;
|
||||
UINT8 reserved;
|
||||
UINT8 path[MAX_FILE_PATH_ELEMENTS];
|
||||
}
|
||||
UiccFilePath;
|
||||
|
||||
typedef struct EmmEventStatisNvmInfo_Tag
|
||||
{
|
||||
UINT16 numAttachSucc; /* count of Attach Success */
|
||||
UINT16 numAttachFail;
|
||||
UINT16 numTauSucc; /* count of TAU Success */
|
||||
UINT16 numTauFail;
|
||||
UINT16 numSrSucc; /* count of Service request Success */
|
||||
UINT16 numSrFail;
|
||||
UINT16 numAuthFail; /* count of Authentication Success */
|
||||
UINT16 numDetach; /* count of Detach */
|
||||
}
|
||||
EmmEventStatisNvmInfo;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* ---------------------ipv4 header format--------------------
|
||||
* 0 1 2 3
|
||||
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* |Version| IHL |Type of Service| Total Length |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | Identification |Flags| Fragment Offset |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | Time to Live | Protocol | Header Checksum |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | Source Address |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | Destination Address |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | Options | Padding |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* Example Internet Datagram Header
|
||||
*/
|
||||
typedef struct PsIp4Hdr_Tag
|
||||
{
|
||||
#if defined (LITTLE_ENDIAN_BITFIELD)
|
||||
UINT8 ihl :4;
|
||||
UINT8 version :4;
|
||||
#else
|
||||
UINT8 version :4;
|
||||
UINT8 ihl :4;
|
||||
#endif
|
||||
UINT8 tos;
|
||||
UINT16 tot_len;
|
||||
UINT16 id;
|
||||
UINT16 frag_off;
|
||||
UINT8 ttl;
|
||||
UINT8 protocol;
|
||||
UINT16 check_sum;
|
||||
UINT8 saddr[4];
|
||||
UINT8 daddr[4];
|
||||
}PsIp4Hdr;
|
||||
|
||||
/*
|
||||
* IPv6 Header Format
|
||||
*
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* |Version| Traffic Class | Flow Label |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | Payload Length | Next Header | Hop Limit |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | |
|
||||
* + +
|
||||
* | |
|
||||
* + Source Address +
|
||||
* | |
|
||||
* + +
|
||||
* | |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | |
|
||||
* + +
|
||||
* | |
|
||||
* + Destination Address +
|
||||
* | |
|
||||
* + +
|
||||
* | |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
*
|
||||
*/
|
||||
typedef struct PsIp6Hdr_Tag
|
||||
{
|
||||
UINT32 ver_tc_fl;
|
||||
UINT16 payload_len;
|
||||
UINT8 protocol; //next header
|
||||
UINT8 hop_limit;
|
||||
|
||||
UINT8 saddr[16];
|
||||
UINT8 daddr[16];
|
||||
}PsIp6Hdr;
|
||||
|
||||
/*
|
||||
* ------ User Datagram Header Format
|
||||
* 0 7 8 15 16 23 24 31
|
||||
* +--------+--------+--------+--------+
|
||||
* | SourcePort | DestinationPort |
|
||||
* +--------+--------+--------+--------+
|
||||
* | Length | Checksum |
|
||||
* +--------+--------+--------+--------+
|
||||
* |
|
||||
* | data octets ...
|
||||
* +---------------- ...
|
||||
*/
|
||||
typedef struct PsUdpHdr_Tag
|
||||
{
|
||||
UINT16 sport;
|
||||
UINT16 dport;
|
||||
UINT16 length;
|
||||
UINT16 check_sum;
|
||||
}PsUdpHdr;
|
||||
|
||||
/*
|
||||
*/
|
||||
typedef struct PsTcpHdr_Tag
|
||||
{
|
||||
UINT16 sport;
|
||||
UINT16 dport;
|
||||
UINT32 seq; /* sequence number */
|
||||
UINT32 ack; /* ack number */
|
||||
#if defined (LITTLE_ENDIAN_BITFIELD)
|
||||
UINT8 rsvd0 : 4;
|
||||
UINT8 thl : 4; /* tcp header length */
|
||||
UINT8 flag : 6;
|
||||
UINT8 rsvd1 : 2;
|
||||
#else
|
||||
UINT8 thl : 4; /* tcp header length */
|
||||
UINT8 rsvd0 : 4;
|
||||
UINT8 rsvd1: 2;
|
||||
UINT8 flag : 6;
|
||||
#endif
|
||||
UINT16 window; /* window size */
|
||||
UINT16 cks; /* check sum */
|
||||
UINT16 urgt; /* urgent */
|
||||
}PsTcpHdr;
|
||||
|
||||
|
||||
/*
|
||||
* ----IPSEC_HEADER format ----
|
||||
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | Security parameter index |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | Sequence number |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | |
|
||||
* | Authentication data.... |
|
||||
* +------------------------------------ ...
|
||||
*
|
||||
*/
|
||||
typedef struct PsIpSecEspHdr_Tag
|
||||
{
|
||||
UINT32 spi;
|
||||
UINT32 sn;
|
||||
}PsIpSecEspHdr;
|
||||
|
||||
|
||||
typedef UINT8 LocationType_r10_t;
|
||||
typedef enum _EPAT_LocationType_r10_Tag
|
||||
{
|
||||
LocationInfo_r10_ellipsoid_Point_r10,
|
||||
LocationInfo_r10_ellipsoidPointWithAltitude_r10,
|
||||
LocationInfo_r10_ellipsoidPointWithUncertaintyCircle_r11,
|
||||
LocationInfo_r10_ellipsoidPointWithUncertaintyEllipse_r11,
|
||||
LocationInfo_r10_ellipsoidPointWithAltitudeAndUncertaintyEllipsoid_r11,
|
||||
LocationInfo_r10_ellipsoidArc_r11,
|
||||
LocationInfo_r10_r10_polygon_r11,
|
||||
}LocationType_r10;
|
||||
|
||||
typedef struct LocationOcteStringTag
|
||||
{
|
||||
UINT8 data[22]; //temp data size
|
||||
UINT16 size;
|
||||
}LocationOcteString;
|
||||
|
||||
//LocationInfo_r10 provided for cerrc
|
||||
typedef struct LocationInformationTag
|
||||
{
|
||||
LocationType_r10_t locationInfoType; //LocationType_r10
|
||||
LocationOcteString locationCoordinates;
|
||||
|
||||
UINT8 horizontalVelocity_r10Present;
|
||||
UINT8 gnss_TOD_msec_r10Present;
|
||||
UINT8 reserved;
|
||||
LocationOcteString horizontalVelocity_r10;
|
||||
LocationOcteString gnss_TOD_msec_r10;
|
||||
}LocationInformation;
|
||||
|
||||
|
||||
typedef struct Psmd5HashContextTag
|
||||
{
|
||||
UINT32 total[2];
|
||||
UINT32 state[4];
|
||||
UINT8 buffer[64]; /*temp buffer*/
|
||||
}
|
||||
Psmd5HashContext;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,221 @@
|
||||
#ifndef __PS_DEBUG_H__
|
||||
#define __PS_DEBUG_H__
|
||||
|
||||
/******************************************************************************
|
||||
******************************************************************************
|
||||
Copyright: - 2017, All rights reserved by AirM2M
|
||||
File name: - psdebug.h
|
||||
Description: - PS system common include header files, and common MARCO
|
||||
History: - 02/28/2020, Originated by Jason
|
||||
******************************************************************************
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
* include OS header files
|
||||
******************************************************************************/
|
||||
#ifdef WIN32
|
||||
#include "winsys.h"
|
||||
#else
|
||||
#include "osasys.h"
|
||||
#include "ostask.h"
|
||||
#include "cmsis_os2.h"
|
||||
#endif
|
||||
|
||||
/******************************************************************************
|
||||
*****************************************************************************
|
||||
* MARCO
|
||||
*****************************************************************************
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*****************************************************************************
|
||||
* STRUCT
|
||||
*****************************************************************************
|
||||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* same as: "T_SYS_TIME", to record the PHY TIME info
|
||||
*/
|
||||
typedef struct {
|
||||
UINT32 hfnsfnsbn; // hfn(10)|sfn(10)|sbn(4)
|
||||
UINT32 spn; // spn(11)
|
||||
}PHY_T_SYS_TIME;
|
||||
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
******************************************************************************
|
||||
* PS RAM LOG
|
||||
******************************************************************************
|
||||
******************************************************************************/
|
||||
|
||||
#define PS_RAM_LOG_BUF_SIZE 32*1024
|
||||
|
||||
#define PS_RAM_LOG_BUF_END_OFFSET (PS_RAM_LOG_BUF_SIZE-4)
|
||||
|
||||
#define PS_RAM_LOG_START_OFFSET_INIT 0xFFFF
|
||||
|
||||
#define PS_RAM_LOG_MAGIC_WORD 0xB6C7
|
||||
|
||||
/*
|
||||
* PsRamLogBuf
|
||||
* Used as a cycle buffer,
|
||||
* RAM log record from "endOffset"
|
||||
*/
|
||||
typedef struct PsRamLogBuf_Tag
|
||||
{
|
||||
UINT16 magicWord;
|
||||
UINT16 endOffset; //Next RAM log start from it;
|
||||
|
||||
UINT8 buf[PS_RAM_LOG_BUF_SIZE-4];
|
||||
}PsRamLogBuf;
|
||||
|
||||
/*
|
||||
* +-----------------------+-----------------------+
|
||||
* | PsRamLogHdr (4 bytes) | RAM RECORD BODY... |
|
||||
* +-----------------------+-----------------------+
|
||||
*/
|
||||
|
||||
/*
|
||||
* 4 bits, MAX 15
|
||||
*/
|
||||
typedef enum PsRamLogType_Enum
|
||||
{
|
||||
PS_RAM_VAR = 0,
|
||||
PS_RAM_SIG_RECORD = 1,
|
||||
PS_RAM_SIG_DUMP = 2,
|
||||
PS_RAM_HEX_DUMP = 3,
|
||||
PS_RAM_INTERNAL_MSG_RECORD = 4,
|
||||
PS_RAM_DEBUG_ASSERT_RECORD = 5,
|
||||
PS_RAM_ASSERT_RECORD = 6
|
||||
}PsRamLogType;
|
||||
|
||||
/*
|
||||
* 8 bytes header, before PS RAM LOG
|
||||
*/
|
||||
typedef struct PsRamLogHdr_Tag
|
||||
{
|
||||
UINT16 magicWord;
|
||||
UINT16 logType: 4;
|
||||
UINT16 logLen: 12;
|
||||
UINT32 hfnhfnSfnSbn; //hfn(10)|sfn(10)|sbn(4)
|
||||
}PsRamLogHdr;
|
||||
|
||||
#define PS_RAM_LOG_HDR_SIZE sizeof(PsRamLogHdr)
|
||||
|
||||
/*
|
||||
* VAR RAM LOG
|
||||
* 10 bytes (filename) + 2 bytes (line) + 12 bytes (var1&var2&var3)
|
||||
* 24 bytes
|
||||
* PS_RAM_VAR
|
||||
*/
|
||||
typedef struct PsRamVarLog_Tag
|
||||
{
|
||||
UINT8 fileName[10];
|
||||
UINT16 lineNum;
|
||||
UINT32 var1;
|
||||
UINT32 var2;
|
||||
UINT32 var3;
|
||||
}PsRamVarLog;
|
||||
|
||||
#define PS_RAM_VAR_LOG_SIZE sizeof(PsRamVarLog)
|
||||
|
||||
/*
|
||||
* SIGNAL RAM LOG
|
||||
* 4 bytes
|
||||
* PS_RAM_SIG_RECORD
|
||||
*/
|
||||
typedef struct PsRamSigLog_Tag
|
||||
{
|
||||
UINT16 dTaskId;
|
||||
UINT16 sigId;
|
||||
}PsRamSigLog;
|
||||
|
||||
#define PS_RAM_SIG_LOG_SIZE sizeof(PsRamSigLog)
|
||||
|
||||
/*
|
||||
* SIGNAL DUMP RAM LOG
|
||||
* 4 bytes
|
||||
* PS_RAM_SIG_DUMP
|
||||
*/
|
||||
typedef struct PsRamSigDumpLog_Tag
|
||||
{
|
||||
UINT16 dTaskId;
|
||||
UINT16 sigId;
|
||||
UINT8 sigBody[];
|
||||
}PsRamSigDumpLog;
|
||||
|
||||
|
||||
/*
|
||||
* VAR RAM LOG
|
||||
* 10 bytes (filename) + 2 bytes (line) + hexDump
|
||||
* PS_RAM_HEX_DUMP
|
||||
*/
|
||||
#define PS_RAM_HEX_DUMP_FILE_NAME_SIZE 8
|
||||
typedef struct PsRamHexDumpLog_Tag
|
||||
{
|
||||
UINT8 fileName[PS_RAM_HEX_DUMP_FILE_NAME_SIZE];
|
||||
UINT16 hexLen;
|
||||
UINT16 lineNum;
|
||||
UINT8 hexDump[];
|
||||
}PsRamHexDumpLog;
|
||||
|
||||
#define PS_RAM_HEX_DUMP_MAX_SIZE 1024
|
||||
|
||||
|
||||
/*
|
||||
* INTERNAL MSG RECORD
|
||||
* PS_RAM_INTERNAL_MSG_RECORD
|
||||
* 40 bytes
|
||||
*/
|
||||
#define PS_RAM_INTERNAL_MSG_STR_SIZE 32
|
||||
typedef struct PsRamInternalMsgLog_Tag
|
||||
{
|
||||
UINT8 srcId; // msg from which sub-module
|
||||
UINT8 argvUint8;
|
||||
UINT16 argvUint16;
|
||||
UINT32 argvUint32;
|
||||
|
||||
UINT8 handlerStr[PS_RAM_INTERNAL_MSG_STR_SIZE];
|
||||
}PsRamInternalMsgLog;
|
||||
|
||||
#define PS_RAM_INTERNAL_MSG_LOG_SIZE sizeof(PsRamInternalMsgLog)
|
||||
|
||||
/*
|
||||
* PS_RAM_DEBUG_ASSERT_RECORD
|
||||
* PS_RAM_ASSERT_RECORD
|
||||
* sizeof(PsRamAssertInfoLog) = 60
|
||||
*/
|
||||
#define PS_RAM_ASSERT_FUNC_STR_SIZE 32
|
||||
#define PS_RAM_ASSERT_FILE_STR_SIZE 14
|
||||
typedef struct PsRamAssertInfoLog_Tag
|
||||
{
|
||||
//printf("Assert (%.32s), file: %s, (0x%lx, 0x%lx, 0x%lx), line: %d", #cond, __FILE__, (v1), (v2), (v3), __LINE__);
|
||||
UINT8 func[PS_RAM_ASSERT_FUNC_STR_SIZE];
|
||||
UINT8 fileName[PS_RAM_ASSERT_FILE_STR_SIZE];
|
||||
UINT16 lineNum;
|
||||
UINT32 var1;
|
||||
UINT32 var2;
|
||||
UINT32 var3;
|
||||
}PsRamAssertInfoLog;
|
||||
#define PS_RAM_ASSERT_INFO_LOG_SIZE sizeof(PsRamAssertInfoLog)
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
******************************************************************************
|
||||
* API
|
||||
******************************************************************************
|
||||
******************************************************************************/
|
||||
void PsRamLogVar(UINT8 *file, UINT16 line, UINT32 var1, UINT32 var2, UINT32 var3);
|
||||
void PsRamLogSig(UINT16 dTaskId, UINT16 sigId);
|
||||
void PsRamLogSigDump(UINT16 dTaskId, SignalBuf *pSig);
|
||||
void PsRamLogHexDump(UINT8 *file, UINT16 line, UINT16 hexLen, UINT8 *hex);
|
||||
void PsRamLogInternalMsg(UINT8 *strHandler, UINT8 srcId, UINT8 argvUint8, UINT16 argvUint16, UINT32 argvUint32);
|
||||
//void GosLogDebugAssertInfo(UINT8 *pFunc, UINT8 *pFile, UINT16 line, UINT32 var1, UINT32 var2, UINT32 var3);
|
||||
//void GosLogAssertInfo(UINT8 *pFunc, UINT8 *pFile, UINT16 line, UINT32 var1, UINT32 var2, UINT32 var3);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
#ifndef PSIF_HDR_API_H
|
||||
#define PSIF_HDR_API_H
|
||||
|
||||
/******************************************************************************
|
||||
******************************************************************************
|
||||
Copyright: - 2018- Copyrights of AirM2M Ltd.
|
||||
File name: - psifapi.h
|
||||
Description: - ps netif UL/DL function header
|
||||
History: - 01/02/2018, Originated by xwang
|
||||
******************************************************************************
|
||||
******************************************************************************/
|
||||
#include "pspdu.h"
|
||||
|
||||
#define PS_DLPDUBLOCK_SIZE sizeof(DlPduBlock)
|
||||
|
||||
typedef enum PsIfRetEnum_Tag
|
||||
{
|
||||
PSIF_SUCC = 0,
|
||||
PSIF_ERROR
|
||||
}PsIfRetEnum;
|
||||
|
||||
typedef struct PsifDlDataHeader_Tag
|
||||
{
|
||||
UINT16 magic; //PS_UL_MAGIC
|
||||
UINT16 dlLen; // UL packet length
|
||||
}PsifDlDataHeader;
|
||||
|
||||
#define PBUF_DLRAM_HLEN (sizeof(PsifDlDataHeader))
|
||||
|
||||
|
||||
typedef UINT8 PsIfRet;
|
||||
|
||||
/******************************************************************************
|
||||
* DL, NW -> UE, PS -> LWIP *
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
/*
|
||||
* PSIF API:
|
||||
* DL IP PKG memory allocation API
|
||||
* 1> Here, LWIP could reserve the "pbuf" memory before this return memory, and LWIP don't need to copy the PKG data again
|
||||
* in function "ps_receive_data()";
|
||||
* 2> This API dhouls safe for several tasks access
|
||||
* 3> ip pkg len must not bigger than: (PBUF_POOL_BUFSIZE - sizeof(struct pbuf) - sizeof(DlPduBlock))
|
||||
* The memory allocated:
|
||||
* +-----------------+--------------------------+--------------------------+
|
||||
* | pbuf (16 bytes) | DlPduBlock (12 bytes) | ip pkg Len |
|
||||
* +-----------------+--------------------------+--------------------------+
|
||||
* ^
|
||||
* | return address
|
||||
*
|
||||
* Input: UINT16 ipPkgLen = ip pkg len
|
||||
*
|
||||
* Note: DlPduBlock not need to init in this API
|
||||
*/
|
||||
DlPduBlock *PsifAllocDlIpPkgBlockMem(UINT16 ipPkgLen);
|
||||
|
||||
/*
|
||||
* LWIP API
|
||||
* DL IP PKG memory free API, free all list memory
|
||||
* if PS found the IP PKG is not right, could free the memory
|
||||
*/
|
||||
void PsifFreeDlIpPkgBlockList(DlPduBlock *pPkgBlock);
|
||||
|
||||
/*
|
||||
* LWIP API
|
||||
* process the DL IP PKG
|
||||
* 1> This API maybe called in ISR, don't take too much operation;
|
||||
* 2> PS -> LWIP, could send several IP pkg at one time;
|
||||
* 3> LWIP response for the memory free;
|
||||
* 4> 0 success,others fail
|
||||
*/
|
||||
PsIfRet PsifRecvDlIpPkg(UINT8 cid, DlPduBlock *pPduHdr);
|
||||
|
||||
/*
|
||||
* LWIP API
|
||||
*/
|
||||
void PsifFreeUlIpPkgMem(UINT8 *pPkgData);
|
||||
|
||||
|
||||
/*
|
||||
* LWIP API
|
||||
* Whether LWIP DL high water, if return not zero, don't call "PsifAllocDlIpPkgBlockMem()" to allocate the DL memory;
|
||||
*/
|
||||
UINT8 PsifIsDlHighWater(void);
|
||||
|
||||
|
||||
/*
|
||||
* LWIP API
|
||||
* Called by PS, notify LWIP task whether PS is suspended or resumed;
|
||||
* Note:
|
||||
* 1> if need to some operation with NETIF, suggest handle it in LWIP task;
|
||||
* 2> "bSuspend" = TRUE, just means PS suspended, can't send any UL pkg;
|
||||
* 3> "bSuspend" = FALSE, just means PS resumed, then LWIP could send UL pkg (maybe pended UL pkg);
|
||||
* 4> In some case, maybe UL "exception" data could still allow to send if suspended, here, we don't support it now; - TBD
|
||||
*/
|
||||
void PsifPsResumeSuspendInd(BOOL bSuspend);
|
||||
|
||||
/*
|
||||
* LWIP API
|
||||
* Check whether any UL pending(suspended) pkg in LWIP task;
|
||||
*/
|
||||
BOOL PsifAnySuspendULPendingPkg(void);
|
||||
|
||||
|
||||
/*
|
||||
* PSIF API
|
||||
* check whether reserved size (LWIP_PBUF_STRUCT_LEN) is enough for pbuf
|
||||
*/
|
||||
void PsifPbufSizeCheck(void);
|
||||
|
||||
/*
|
||||
* PSIF API
|
||||
* Set and init pbuf struct, which located before "DlPduBlock", called by CEDR, when alloc DL PKG memory
|
||||
*/
|
||||
void PsifInitPsDlPkgPbuf(DlPduBlock *pDlPduBlk);
|
||||
|
||||
/*
|
||||
* PSIF API
|
||||
* Free pbuf which type is: PBUF_PS_DL_PKG, called by: pbuf_free()
|
||||
* input: struct pbuf *p
|
||||
*/
|
||||
void PsifFreePsDlPkgPbuf(void *pbuf);
|
||||
|
||||
UINT16 PsifGetCurrentPacketDelay(void);
|
||||
|
||||
|
||||
/*
|
||||
* Free all netif TFT packet filter list
|
||||
*/
|
||||
void PsifNetifTftFree(void *tft_list);
|
||||
|
||||
BOOL PsifDlRamCheckHighWater(UINT16 preAllocLength);
|
||||
|
||||
struct pbuf * PsifTcpipDlHighWaterChkInput(struct pbuf *pInput);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
#ifndef PSIF_HDR_EVENT_H
|
||||
#define PSIF_HDR_EVENT_H
|
||||
|
||||
/******************************************************************************
|
||||
******************************************************************************
|
||||
Copyright: - 2018- Copyrights of AirM2M Ltd.
|
||||
File name: - psifevent.h
|
||||
Description: - ps if related event header file
|
||||
History: - 11/01/2018, Originated by xwang
|
||||
******************************************************************************
|
||||
******************************************************************************/
|
||||
#include "networkmgr.h"
|
||||
#include "netif.h"
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*****************************************************************************
|
||||
* STRUCT
|
||||
*****************************************************************************
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*****************************************************************************
|
||||
* Functions
|
||||
*****************************************************************************
|
||||
******************************************************************************/
|
||||
//void PsifSendNetifInfoInd(struct netif *pNetif, NmNetifStatus status, NmNetifStatusChangeCause cause);
|
||||
void PsifSendNetifInfoInd(struct netif *pNetif, NmNetifStatusChangeCause cause);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copy right: 2017-, Copyrigths of AirM2M Ltd.
|
||||
* File name: psl1commtype.h
|
||||
* Description:
|
||||
* History: 25/04/2021 Originated
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef _PS_L1_COMMON_TYPE_H_
|
||||
#define _PS_L1_COMMON_TYPE_H_
|
||||
|
||||
/*********************************************************************************
|
||||
* Includes
|
||||
*********************************************************************************/
|
||||
#ifdef WIN32
|
||||
#include "pssys.h"
|
||||
#else
|
||||
#include "CommonTypedef.h"
|
||||
#endif
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*****************************************************************************
|
||||
* MACRO
|
||||
*****************************************************************************
|
||||
******************************************************************************/
|
||||
#define SUPPORT_MAX_BAND_NUM 32 //Extend from 16 to 32, 2020-7-28
|
||||
#define RRC_PHY_SUPPORT_BAND_NUM SUPPORT_MAX_BAND_NUM //this value should be the same as PHY_SUPPORT_BAND_NUM
|
||||
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*****************************************************************************
|
||||
* STRUCT
|
||||
*****************************************************************************
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
* Plmn
|
||||
* Numberic PLMN format, 4 bytes,
|
||||
* example: CMCC: 46000; mcc = 0x0460, mnc = 0xf000
|
||||
* 00101; mcc = 0x0001, mnc = 0xf001
|
||||
* 46012; mcc = 0x0460, mnc = 0xf012
|
||||
* 460123; mcc = 0x0460, mnc = 0x0123
|
||||
******************************************************************************/
|
||||
typedef struct _EPAT_Plmn_Tag
|
||||
{
|
||||
UINT16 mcc;
|
||||
UINT16 mncWithAddInfo; // if 2-digit MNC type, the 4 MSB bits should set to 'F',
|
||||
}Plmn;
|
||||
|
||||
|
||||
/*
|
||||
* UE category, ref to 36.306
|
||||
*/
|
||||
typedef UINT8 UeCategoryType_t;
|
||||
typedef enum _EPAT_UeCategoryType_Tag
|
||||
{
|
||||
UeCategory_NB1 = 0x01,
|
||||
UeCategory_NB2 = 0x02,
|
||||
UeCategory_M1 = 0x11,
|
||||
UeCategory_M2 = 0x12,
|
||||
UeCategory_Cat1Base = 0x20, //only used for Cat1 start point
|
||||
UeCategory_Cat1 = 0x21,
|
||||
UeCategory_Cat1bis = 0x22,
|
||||
}UeCategoryType;
|
||||
|
||||
/*
|
||||
* As Release, start from Rel-13
|
||||
*/
|
||||
typedef UINT8 AsReleaseType_t;
|
||||
typedef enum _EPAT_AsReleaseType_Tag
|
||||
{
|
||||
AsRelease_13 = 13,
|
||||
AsRelease_14,
|
||||
AsRelease_15,
|
||||
}AsReleaseType;
|
||||
|
||||
|
||||
/*
|
||||
* CERRC_CFG_UE_POWER_CLASS_SETTING
|
||||
*/
|
||||
typedef struct PsCfgConfigedUePowerClassTag
|
||||
{
|
||||
//now support to 255
|
||||
UINT8 freqBandIndicator;
|
||||
/*refer to TS36.101 table 6.2.2F-1,
|
||||
-- 3 represents Class3(maxpower: 23dBm)
|
||||
-- 5 represents Class5 (maxpower: 20dBm)
|
||||
-- 6 represents Class6 (maxpower: 14dBm) and only apply for R14 and later */
|
||||
UINT8 uePowerClass;
|
||||
}PsCfgConfigedUePowerClass;
|
||||
|
||||
typedef struct PsCfgCerrcUePowerClassSetting_Tag
|
||||
{
|
||||
UINT8 numOfBand;
|
||||
UINT8 rsvd0;
|
||||
UINT16 rsvd1;
|
||||
PsCfgConfigedUePowerClass bandAndPowerClass[RRC_PHY_SUPPORT_BAND_NUM];
|
||||
}PsCfgCerrcUePowerClassSetting; // 68 bytes
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
#ifndef __PS_NVM_UTIL_H__
|
||||
#define __PS_NVM_UTIL_H__
|
||||
/******************************************************************************
|
||||
******************************************************************************
|
||||
Copyright: - 2017- Copyrights of AirM2M Ltd.
|
||||
File name: - psnvmutil.h
|
||||
Description: - Protocol Stack NVM basic utility
|
||||
History: - 13/09/2020, Originated by Jason
|
||||
******************************************************************************
|
||||
******************************************************************************/
|
||||
#include "pssys.h"
|
||||
|
||||
#define PS_USE_OSA_NVM_FUNC 1
|
||||
|
||||
typedef enum PsNvmFileIdEnum_Tag
|
||||
{
|
||||
//PS_BASE_NVM = 0,
|
||||
/*
|
||||
* PS info NVM, maintained in psinfonvm.c
|
||||
*/
|
||||
PS_CCM_INFO_NVM = 0,
|
||||
PS_CEMM_EMM_INFO_NVM,
|
||||
PS_CEMM_COMM_INFO_NVM,
|
||||
PS_CEMM_PLMN_INFO_NVM,
|
||||
PS_CESM_INFO_NVM,
|
||||
PS_UICCCTRL_INFO_NVM,
|
||||
PS_CERRC_INFO_NVM,
|
||||
|
||||
PS_INFO_NVM_MAX,
|
||||
|
||||
/*
|
||||
* PS config NVM, maintained in psnvm.c
|
||||
*/
|
||||
PS_CESM_PDP_CONFIG_NVM = PS_INFO_NVM_MAX,
|
||||
PS_CESM_PDP_AUTH_CONFIG_NVM,
|
||||
|
||||
PS_MAX_NVM
|
||||
}PsNvmFileIdEnum;
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*****************************************************************************
|
||||
* STRUCT
|
||||
*****************************************************************************
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
* PS NVM filer header structure
|
||||
* by now: 36 bytes
|
||||
******************************************************************************/
|
||||
#define PS_NVM_FILE_NAME_SIZE 32
|
||||
|
||||
#if (PS_USE_OSA_NVM_FUNC != 1)
|
||||
typedef struct PsNvmFileHeader_Tag
|
||||
{
|
||||
UINT8 fName[PS_NVM_FILE_NAME_SIZE];
|
||||
UINT16 fileBodySize; //file body size, not include size of header;
|
||||
UINT8 version;
|
||||
UINT8 checkSum;
|
||||
}PsNvmFileHeader; //36 bytes
|
||||
#endif
|
||||
|
||||
/*
|
||||
* if no NVM file found, use the default value.
|
||||
*/
|
||||
typedef void (*PsNvmSetDefaultValueFunc)(void *ctxBuf, UINT16 bufSize);
|
||||
/*
|
||||
* adjust NVM file, from OLD VERSION -> CUR/Latest verion
|
||||
*/
|
||||
typedef BOOL (*PsNvmAdjustVersionFunc)(UINT8 oldVer, void *oldCtx, UINT16 oldCtxSize, void *curCtx, UINT16 curCtxSize);
|
||||
/*
|
||||
* 44 bytes
|
||||
*/
|
||||
typedef struct PsNvmFileOper_Tag
|
||||
{
|
||||
UINT8 fileId; //PsNvmFileIdEnum
|
||||
UINT8 curVersion;
|
||||
UINT16 fileSize;
|
||||
|
||||
UINT8 fileName[PS_NVM_FILE_NAME_SIZE];
|
||||
|
||||
PsNvmSetDefaultValueFunc setDefaultFunc;
|
||||
PsNvmAdjustVersionFunc adjustVerFunc;
|
||||
}PsNvmFileOper;
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*****************************************************************************
|
||||
* Functions
|
||||
*****************************************************************************
|
||||
******************************************************************************/
|
||||
BOOL PsNvmRead(PsNvmFileIdEnum fileId, void *dataBuf, UINT16 bufSize);
|
||||
BOOL PsNvmWrite(PsNvmFileIdEnum fileId, void *dataBuf, UINT16 bufSize);
|
||||
#define PsNvmUpdate(fileId, dataBuf, bufSize) \
|
||||
PsNvmWrite(fileId, dataBuf, bufSize)
|
||||
void PsNvmSaveAll(void);
|
||||
BOOL PsNvmSave(PsNvmFileIdEnum fileId);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
603
sdk/合宙/air780e/csdk/luatos-soc-2022/PLAT/prebuild/PS/inc/pssys.h
Normal file
603
sdk/合宙/air780e/csdk/luatos-soc-2022/PLAT/prebuild/PS/inc/pssys.h
Normal file
@@ -0,0 +1,603 @@
|
||||
#ifndef __PS_SYS_H__
|
||||
#define __PS_SYS_H__
|
||||
|
||||
/******************************************************************************
|
||||
******************************************************************************
|
||||
Copyright: - 2017, All rights reserved by AirM2M
|
||||
File name: - pssys.h
|
||||
Description: - PS system common include header files, and common MARCO
|
||||
History: - 08/09/2020, Originated by Jason
|
||||
******************************************************************************
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
* include OS header files
|
||||
******************************************************************************/
|
||||
#ifdef WIN32
|
||||
#include "winsys.h"
|
||||
#include "osautil.h"
|
||||
#else
|
||||
#include "osasys.h"
|
||||
#include "ostask.h"
|
||||
#include "cmsis_os2.h"
|
||||
#include "debug_trace.h"
|
||||
#include "sctdef.h"
|
||||
#endif
|
||||
#include "osanvm.h"
|
||||
#include "psdebug.h"
|
||||
#include "pstrace.h"
|
||||
|
||||
#ifdef WIN32
|
||||
//#define EUTRAN_CAT_MODE
|
||||
#endif
|
||||
//#define EUTRAN_NB_MODE
|
||||
|
||||
#undef PS_ENABLE_LPP_LCS_FEATURE /* Cat1 disable LCS feature */
|
||||
//#define PS_ENABLE_LPP_LCS_FEATURE
|
||||
|
||||
/*
|
||||
* offset of body in a structure
|
||||
*/
|
||||
#ifndef OFFSETOF
|
||||
#define OFFSETOF(type, body) ((UINT32)&(((type *)0)->body))
|
||||
#endif
|
||||
|
||||
#ifndef GOS_GET_SIGNAL_FROM_BODY
|
||||
#define GOS_GET_SIGNAL_FROM_BODY OSA_GET_SIGNAL_FROM_BODY
|
||||
#endif
|
||||
|
||||
/*
|
||||
* 4 bytes align
|
||||
*/
|
||||
#ifndef ALIGNED_4BYTE
|
||||
#ifdef WIN32
|
||||
#define ALIGNED_4BYTE
|
||||
#else
|
||||
#define ALIGNED_4BYTE __ALIGNED(4)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef ALIGNED_128KB
|
||||
#ifdef WIN32
|
||||
#define ALIGNED_128KB
|
||||
#else
|
||||
#define ALIGNED_128KB CAT_UP_DATA //__ALIGNED(0x20000)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Code in RAM
|
||||
*/
|
||||
#ifndef PS_CODE_IN_RAM
|
||||
#ifdef WIN32
|
||||
#define PS_CODE_IN_RAM
|
||||
#else
|
||||
//#define PS_CODE_IN_RAM __attribute__((__section__(".ramCode2")))
|
||||
#define PS_CODE_IN_RAM PS_FM_RAMCODE /* FM: Full image, MSMB */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef PS_SLP2_ZI
|
||||
#ifdef WIN32
|
||||
#define PS_SLP2_ZI
|
||||
#else
|
||||
#define PS_SLP2_ZI PS_FA_ZI /* DATA in ASMB, remain in sleep2, and zero inited */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef PS_SLP2_DATA
|
||||
#ifdef WIN32
|
||||
#define PS_SLP2_DATA
|
||||
#else
|
||||
#define PS_SLP2_DATA PS_FA_DATA /* DATA in ASMB, remain in sleep2 */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* 4 bytes aligned size
|
||||
*/
|
||||
#define FOUR_BYTE_ALIGN_SIZE(size) (((size)+3)&(0xFFFFFFFC))
|
||||
|
||||
#ifndef CAT_PSPHY_SHAREDATA
|
||||
#ifdef WIN32
|
||||
#define CAT_PSPHY_SHAREDATA
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef WIN32
|
||||
#define PS_HW_REG_WRITE_32(_pHW, val)
|
||||
#define PS_HW_REG_READ_32(_pHW, val)
|
||||
#else
|
||||
|
||||
#if defined ( __CC_ARM )
|
||||
|
||||
#define PS_HW_REG_WRITE_32(_pHW, val) \
|
||||
do { \
|
||||
__asm \
|
||||
{ \
|
||||
STR val, [_pHW] \
|
||||
} \
|
||||
}while(FALSE)
|
||||
|
||||
#define PS_HW_REG_READ_32(_pHW, val) \
|
||||
do { \
|
||||
__asm \
|
||||
{ \
|
||||
LDR val, [_pHW] \
|
||||
} \
|
||||
}while(FALSE)
|
||||
|
||||
#elif defined ( __GNUC__ )
|
||||
|
||||
#define PS_HW_REG_WRITE_32(_pHW, val) __STREXW(val, _pHW)
|
||||
|
||||
#define PS_HW_REG_READ_32(_pHW, val) val = __LDREXW(_pHW)
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* InternalMsg
|
||||
* internal message in a task, used to communicate between sub-modules in a task
|
||||
* 16 bytes
|
||||
*****************************************************************************/
|
||||
typedef void (*MsgHandler)(UINT8 srcId, UINT8 argvUint8, UINT16 argvUint16, UINT32 argvUint32, void* argvPtr);
|
||||
typedef struct InternalMsg_Tag
|
||||
{
|
||||
MsgHandler msgHandler;
|
||||
|
||||
UINT8 srcId; // msg from which sub-module
|
||||
UINT8 argvUint8;
|
||||
UINT16 argvUint16;
|
||||
UINT32 argvUint32;
|
||||
void *argvPtr;
|
||||
}InternalMsg;
|
||||
|
||||
/******************************************************************************
|
||||
* MsgQueue
|
||||
* Message buffer queue, use to buffer internal message
|
||||
*****************************************************************************/
|
||||
typedef UnitQueue MsgQueue;
|
||||
|
||||
/******************************************************************************
|
||||
* EMPTY SIGNAL
|
||||
******************************************************************************/
|
||||
typedef UINT32 GosEmptySignal;
|
||||
|
||||
/******************************************************************************
|
||||
* SIG_WIN_SIMULATE_INTERNAL_MSG
|
||||
******************************************************************************/
|
||||
typedef struct WinSimulateInternalMsg_Tag
|
||||
{
|
||||
MsgHandler msgHandler;
|
||||
|
||||
UINT8 srcId; // msg from which sub-module
|
||||
UINT8 argvUint8;
|
||||
UINT16 argvUint16;
|
||||
UINT32 argvUint32;
|
||||
void *argvPtr;
|
||||
}WinSimulateInternalMsg;
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
******************************************************************************
|
||||
* external some SYS/OS API
|
||||
******************************************************************************
|
||||
*****************************************************************************/
|
||||
void GosLogSig(UINT16 dTaskId, SignalBuf *pSig);
|
||||
void GosDumpSig(UINT16 dTaskId, SignalBuf *pSig);
|
||||
|
||||
//void GosCreateSignal(UINT16 sigId, UINT16 sigBodySize, SignalBuf **signal);
|
||||
#define GosCreateSignal OsaCreateSignal
|
||||
//void GosCreateZeroSignal(UINT16 sigId, UINT16 sigBodySize, SignalBuf **signal);
|
||||
#define GosCreateZeroSignal OsaCreateZeroSignal
|
||||
//void GosCreateIsrSignal(UINT16 sigId, UINT16 sigBodySize, SignalBuf **signal);
|
||||
#define GosCreateIsrSignal OsaCreateIsrSignal
|
||||
#define GosCreateZeroIsrSignal OsaCreateZeroIsrSignal
|
||||
|
||||
//void GosSendSignal(UINT16 taskId, SignalBuf **signal);
|
||||
#define GosSendSignal OsaSendSignal
|
||||
#define GosSendNoLogSignal OsaSendNoLogSignal
|
||||
// dump the signal to RAM
|
||||
#define GosSendDumpSignal OsaSendDumpSignal
|
||||
#define GosSendNoDumpSignal OsaSendNoDumpSignal
|
||||
//void OsaSendSignalToFront(UINT16 taskId, SignalBuf **signal)
|
||||
#define GosSendSignalToFront OsaSendSignalToFront
|
||||
|
||||
|
||||
//void GosDestroySignal(SignalBuf **signal);
|
||||
#define GosDestroySignal OsaDestroySignal
|
||||
//void OsaDestroyFastSignal(SignalBuf **signal);
|
||||
#define GosDestroyIsrSignal OsaDestroyIsrSignal
|
||||
//void GosReceiveSignal(UINT16 taskId, SignalBuf **signal); // if no signal received, just blocked
|
||||
#define GosReceiveSignal OsaReceiveSignal
|
||||
|
||||
|
||||
/* Create PHY signal, called by ERRC/L2 */
|
||||
void GosCreateSignalToPhy(UINT16 sigId, UINT16 sigBodySize, SignalBuf **signal);
|
||||
|
||||
/* Send the signal to PHY*/
|
||||
void GosSendSignalToPhy(SignalBuf **signal);
|
||||
|
||||
/* Destory the signal to PHY, if ERRC/L2 not need to send the signal to PHY */
|
||||
void GosDestroySignalToPhy(SignalBuf **signal);
|
||||
|
||||
/* Destory the signal send from PHY, called by ERRC/L2 */
|
||||
void GosDestroySignalFromPhy(SignalBuf **signal);
|
||||
|
||||
/* Allocate the dynamic memory, which need to pass to PHY */
|
||||
void* GosAllocMemoryToPhy(UINT16 size);
|
||||
|
||||
/* Free the memory, which comes from PHY */
|
||||
void GosFreeMemoryFromPhy(void **ptr); //after free it, *ptr is set to PNULL
|
||||
|
||||
//void* GosAllocMemory(UINT16 size); // if no memory left, NULL will return
|
||||
#define GosAllocMemory OsaAllocMemory
|
||||
//void* GosAllocZeroMemory(UINT16 size);
|
||||
#define GosAllocZeroMemory OsaAllocZeroMemory
|
||||
//void* GosAllocMemoryNoAssert(UINT32 size);
|
||||
#define GosAllocMemoryNoAssert OsaAllocMemoryNoAssert /* return PNULL, if no memory allcated */
|
||||
//void* GosAllocZeroMemoryNoAssert(UINT32 size);
|
||||
#define GosAllocZeroMemoryNoAssert OsaAllocZeroMemoryNoAssert /* return PNULL, if no memory allcated */
|
||||
//void GosFreeMemory(void **ptr); //after free it, *ptr is set to PNULL
|
||||
#define GosFreeMemory OsaFreeMemory
|
||||
|
||||
|
||||
//UINT8 PsNvmCalcCrcValue(const UINT8 *dataBuf, UINT16 bufSize)
|
||||
#define PsNvmCalcCrcValue OsaCalcCrcValue
|
||||
|
||||
#ifdef WIN32
|
||||
#define GosRand rand
|
||||
#else
|
||||
#define GosRand OsaRand
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#define PsAllocSlp2Mem GosAllocMemory
|
||||
#define PsAllocZeroSlp2Mem GosAllocZeroMemory
|
||||
#define PsFreeSlp2Mem GosFreeMemory
|
||||
#else
|
||||
/*
|
||||
* Memory allocated in sleep2 ASMB memory
|
||||
* !!! Note: memory may alloc fail. and return PNULL !!!
|
||||
*/
|
||||
void *PsSlp2MallocEC(UINT32 xWantedSize, unsigned int funcPtr);
|
||||
void *PsSlp2MallocZero(UINT32 xWantedSize);
|
||||
void PsSlp2FreeEC( void *pv );
|
||||
|
||||
#define PsAllocSlp2Mem(size) PsSlp2MallocEC((size), 0)
|
||||
#define PsAllocZeroSlp2Mem(size) PsSlp2MallocZero((size))
|
||||
#define PsFreeSlp2Mem(pPtr) \
|
||||
do { \
|
||||
GosCheck((pPtr) != PNULL && (*(pPtr)) != PNULL, (pPtr), (*(pPtr)), 0); \
|
||||
PsSlp2FreeEC(*(pPtr)); \
|
||||
(*(pPtr)) = PNULL; \
|
||||
}while(FALSE);
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* NVM file APIs
|
||||
*/
|
||||
#ifdef WIN32
|
||||
typedef FILE* GOSFILE;
|
||||
//GOSFILE GosFopen(UINT8 nvId, UINT8 *fileName, UINT8 *mode);
|
||||
#define GosFopen(nvId, fileName, mode) WinFopen((fileName), (mode))
|
||||
#define GosFclose WinFclose
|
||||
#define GosFread WinFread
|
||||
#define GosFwrite WinFwrite
|
||||
#define GosFremove WinFremove
|
||||
#elif defined NVRAM_FILE_SYSTEM //old file system
|
||||
//typedef NVFILE_HANDLER GOSFILE;
|
||||
typedef void* GOSFILE;
|
||||
//GOSFILE GosFopen(UINT8 nvId, UINT8 *fileName, UINT8 *mode);
|
||||
#define GosFopen(nvId, fileName, mode) (GOSFILE)NVFopen((nvId), (mode))
|
||||
//UINT32 GosFclose(GOSFILE fp);
|
||||
#define GosFclose(fp) NVFclose((NVFILE_HANDLER)(fp))
|
||||
//UINT32 GosFread(void *buf, UINT32 size, UINT32 count, GOSFILE fp);
|
||||
#define GosFread(buf, size, count, fp) NVFread((buf), (size), (count), (NVFILE_HANDLER)(fp))
|
||||
//UINT32 GosFwrite(void *buf, UINT32 size, UINT32 count, GOSFILE fp);
|
||||
#define GosFwrite(buf, size, count, fp) NVFwrite((buf), (size), (count), (NVFILE_HANDLER)(fp))
|
||||
//UINT32 GosFremove(UINT8 *fileName);
|
||||
#define GosFremove(fileName) NVFremove(0)
|
||||
#else
|
||||
typedef OSAFILE GOSFILE;
|
||||
//GOSFILE GosFopen(UINT8 nvId, UINT8 *fileName, UINT8 *mode);
|
||||
#define GosFopen(nvId, fileName, mode) (GOSFILE)OsaFopen((const char *)(fileName), (const char *)(mode))
|
||||
#define GosFclose OsaFclose
|
||||
#define GosFread OsaFread
|
||||
#define GosFwrite OsaFwrite
|
||||
#define GosFremove OsaFremove
|
||||
#endif
|
||||
|
||||
/*
|
||||
* OSA NVM operation
|
||||
*/
|
||||
typedef OsaNvmRet PsNvmRet;
|
||||
typedef OsaNvmBodyInfo PsNvmBodyInfo;
|
||||
|
||||
/*
|
||||
* void OsaNvmFreeBody(OsaNvmBodyInfo *pNvmBodyInfo);
|
||||
*/
|
||||
#define PsNvmFreeBody OsaNvmFreeBody
|
||||
|
||||
|
||||
/*
|
||||
* GosGetSysTickCout
|
||||
*/
|
||||
#ifdef WIN32
|
||||
#define GosGetSysTickCount() GetTickCount()
|
||||
#else
|
||||
#define GosGetSysTickCount() osKernelGetTickCount()
|
||||
#endif
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
******************************************************************************
|
||||
externl functions
|
||||
******************************************************************************
|
||||
******************************************************************************/
|
||||
typedef enum PsPrintModId_Tag
|
||||
{
|
||||
PS_MOD_START_ID = 0x10,
|
||||
PS = PS_MOD_START_ID,
|
||||
PS_UP = 0x11,
|
||||
PS_CERRC,
|
||||
PS_NAS,
|
||||
PS_UICC,
|
||||
PS_UICC_DRV,
|
||||
PS_CCM,
|
||||
PS_CAC,
|
||||
|
||||
PS_MOD_MAX_ID = 0x30
|
||||
}PsPrintModId;
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* GosPrintf/GosPsPrintf
|
||||
******************************************************************************/
|
||||
#ifdef WIN32
|
||||
#define GosTraceAddModule(_module_name, _trace_level)
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#define GosPrintf OsaPrintf
|
||||
#else
|
||||
#define GosPrintf(level, fmt, ...)
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#define GosPsPrintf OsaPsPrintf
|
||||
#else
|
||||
#define GosPsPrintf(mod, submod, level, fmt, ...)
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#define GosHexDump(_module, _level, _dump_name, _data, _len) \
|
||||
OsaHexDump((_dump_name), _data, _len)
|
||||
#else
|
||||
//void GosHexDump(_module, _level,_dump_name, _data, _len)
|
||||
#define GosHexDump(_module, _level, _dump_name, _data, _len)
|
||||
#endif
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* GosCheck/GosDebugBegin/GosDebugEnd
|
||||
******************************************************************************/
|
||||
#define GosCheck OsaCheck
|
||||
#define GosDebugBegin OsaDebugBegin
|
||||
#define GosDebugEnd OsaDebugEnd
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* Internal message queue function
|
||||
******************************************************************************/
|
||||
void GosLogInternalMsg(InternalMsg *msg, const CHAR *pHdr, UINT16 varSize);
|
||||
|
||||
//void GosMsgQueueInit(MsgQueue *msgQ);
|
||||
#define GosMsgQueueInit(Q) UnitQueueInit((Q), sizeof(InternalMsg))
|
||||
/*
|
||||
* void GosMsgEnQueue(MsgQueue *msgQ, InternalMsg *msg, MsgHandler hdr, UINT16 varSize);
|
||||
* MsgQueue *msgQ; // internal Msg queue
|
||||
* InternalMsg *msg; // internal Msg;
|
||||
* MsgHandler hdr; //which callback func;
|
||||
* UINT16 varSize; //size of "argvPtr"
|
||||
*/
|
||||
//#define GosMsgEnQueue(Q, M, H, S) UnitEnQueue((Q), (M))
|
||||
#define GosMsgEnQueue(Q, M, H, S) \
|
||||
do { \
|
||||
GosLogInternalMsg((M), #H, (S)); \
|
||||
UnitEnQueue((Q), (M)); \
|
||||
}while(FALSE)
|
||||
|
||||
|
||||
//void GosMsgDeQueue(MsgQueue *msgQ, InternalMsg *msg);
|
||||
#define GosMsgDeQueue(Q, M) UnitDeQueue((Q), (M))
|
||||
//void GosMsgOnQueue(MsgQueue *msgQ);
|
||||
#define GosMsgOnQueue(Q) UnitOnQueue((Q))
|
||||
//void GosMsgFlushQueue(MsgQueue *msgQ);
|
||||
#define GosMsgFlushQueue(Q) UnitFlushQueue((Q))
|
||||
|
||||
/******************************************************************************
|
||||
* Gos Signal QUEUE function
|
||||
******************************************************************************/
|
||||
#define GosSigQueueInit OsaSigQueueInit
|
||||
//void GosSigEnQueue(SignalQueue *que, SignalBuf **signal);
|
||||
#define GosSigEnQueue OsaSigEnQueue
|
||||
//void GosSigDeQueue(SignalQueue *que, SignalBuf **signal);
|
||||
#define GosSigDeQueue OsaSigDeQueue
|
||||
//BOOL GosSigOnQueue(SignalQueue *que);
|
||||
#define GosSigOnQueue OsaSigOnQueue
|
||||
//void GosSigFlushQueue(SignalQueue *que);
|
||||
#define GosSigFlushQueue OsaSigFlushQueue
|
||||
|
||||
/******************************************************************************
|
||||
* Gos Task Flags function
|
||||
******************************************************************************/
|
||||
//UINT32 GosTaskFlagsSet(UINT16 taskId, UINT32 flags);
|
||||
#define GosTaskFlagsSet OsaTaskFlagsSet
|
||||
//UINT32 GosTaskFlagsWait(UINT32 waitFlags);
|
||||
#define GosTaskFlagsWait OsaTaskFlagsWait
|
||||
//UINT32 OsaTaskFlagsClear(UINT32 clearFlags)
|
||||
#define GosTaskFlagsClear OsaTaskFlagsClear
|
||||
|
||||
/******************************************************************************
|
||||
* Gos signal timer function
|
||||
* When timer expiry, timer task will create a signal (TIMER_EXPIRY) to SRC task
|
||||
******************************************************************************/
|
||||
typedef OsaTimerId GosTimerId;
|
||||
|
||||
#define GOS_TIMER_NOT_CREATE OSA_TIMER_NOT_CREATE
|
||||
|
||||
typedef OsaTimerExpiry GosTimerExpiry;
|
||||
|
||||
void GosPsHibTimerExpiryFunc(OsaHibTimerId hibTimerId);
|
||||
|
||||
//GosTimerId GosTimerNew(UINT16 taskId, UINT16 timerEnum, osTimerType_t type);
|
||||
//osTimerId_t osTimerNew (osTimerFunc_t func, osTimerType_t type, void *argument, const osTimerAttr_t *attr)
|
||||
#ifdef WIN32
|
||||
void OsaTimerExpiryFunc(void *argument);
|
||||
#define OsaTimerNew(taskId, timerEnum, type) \
|
||||
osTimerNew(OsaTimerExpiryFunc, type, taskId, timerEnum) /* used for LPP UT */
|
||||
#define GosTimerNew(taskId, timerEnum, type) \
|
||||
osTimerNew(OsaTimerExpiryFunc, type, taskId, timerEnum)
|
||||
#else
|
||||
#define GosTimerNew OsaTimerNew
|
||||
#endif
|
||||
#define GosTimerStart OsaTimerStart
|
||||
#define GosTimerStop OsaTimerStop
|
||||
#define GosTimerIsRunning OsaTimerIsRunning
|
||||
//osStatus_t GosTimerDelete(GosTimerId *timer_id);
|
||||
#define GosTimerDelete OsaTimerDelete
|
||||
#define GosTimerGetRemainTicks OsaTimerGetRemainTicks
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
******************************************************************************
|
||||
* TIMER/SYS time ticks info, which need to still runing in HIBERNATE STATE
|
||||
******************************************************************************
|
||||
******************************************************************************/
|
||||
typedef OsaHibMs GosHibMs;
|
||||
|
||||
#ifdef WIN32
|
||||
typedef struct GosHibTimerExpiry_Tag
|
||||
{
|
||||
UINT8 hibTimerId;
|
||||
UINT8 reserved0;
|
||||
UINT16 reserved1;
|
||||
}GosHibTimerExpiry;
|
||||
#else
|
||||
typedef OsaHibTimerExpiry GosHibTimerExpiry;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Get current HIB second count
|
||||
*/
|
||||
#ifdef WIN32
|
||||
#define GosGetHibSecondCount() GetTickCount()
|
||||
#else
|
||||
extern uint32_t apmuGetHibSecondCount(void);
|
||||
#define GosGetHibSecondCount() apmuGetHibSecondCount()
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Get current HIB count in unit of 10 ms
|
||||
* Max count: 0x0FFFFFFF (745 hours), when extended 0x0FFFFFFF, will set to 0
|
||||
*/
|
||||
#define GOS_HIB_10MS_COUNT_MAX 0x0FFFFFFF
|
||||
#ifdef WIN32
|
||||
#define GosGetHib10MsCount() GetTickCount()
|
||||
#else
|
||||
extern uint32_t hibTimerGet10MsCnt(void);
|
||||
#define GosGetHib10MsCount() hibTimerGet10MsCnt()
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* MARCO:
|
||||
* SECONDS_TO_HIB_TICKS(sec)
|
||||
* MINUTES_TO_HIB_TICKS(min)
|
||||
* MILLISECONDS_TO_HIB_TICKS(MS)
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* GosHibTimerStart
|
||||
* Description: Start HIB timer
|
||||
* OsaHibTimerId timerId; //which HIB timer
|
||||
* UINT32 periodMs; //timer period in millisecond
|
||||
* output: void
|
||||
* Comment:
|
||||
* if "timerId" already start before, just print a warning, and restart it
|
||||
******************************************************************************/
|
||||
//void OsaHibTimerStart(OsaHibTimerId timerId, OsaHibMs nMs);
|
||||
#define GosHibTimerStart(hibTid, periodMs) OsaHibTimerStart(hibTid, periodMs)
|
||||
|
||||
/******************************************************************************
|
||||
* GosHibTimerIsRunning
|
||||
* Description: whether the HIB timer is running
|
||||
* input: OsaHibTimerId timerId
|
||||
* output: BOOL
|
||||
* Comment:
|
||||
******************************************************************************/
|
||||
//BOOL OsaHibTimerIsRunning(OsaHibTimerId timerId);
|
||||
#define GosHibTimerIsRunning(hibTid) OsaHibTimerIsRunning(hibTid)
|
||||
|
||||
/******************************************************************************
|
||||
* GosHibTimerStopAndDel
|
||||
* Description: stop HIB and delete HIB timer
|
||||
* input: OsaHibTimerId timerId
|
||||
* output: void
|
||||
* Comment:
|
||||
******************************************************************************/
|
||||
//void OsaHibTimerStopAndDel(OsaHibTimerId timerId);
|
||||
//#define GosHibTimerStop(hibTid)
|
||||
#define GosHibTimerStopAndDel(hibTid) OsaHibTimerStopAndDel(hibTid)
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* GosHibTimerGetRemainMs
|
||||
* Description: Get HIB timer remaining time value in milli-seconds
|
||||
* input: OsaHibTimerId hibTId
|
||||
* output: UINT32
|
||||
* Comment:
|
||||
******************************************************************************/
|
||||
//UINT32 OsaHibTimerGetRemainMs(OsaHibTimerId hibTId)
|
||||
#define GosHibTimerGetRemainMs(hibTid) OsaHibTimerGetRemainMs(hibTid)
|
||||
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* GosFwdWinSimulateInternalMsgSig
|
||||
* This API only use for integration testing in WIN PC
|
||||
******************************************************************************/
|
||||
void GosFwdWinSimulateInternalMsgSig(UINT8 srcId, UINT8 argvUint8, UINT16 argvUint16, UINT32 argvUint32, void* argvPtr);
|
||||
|
||||
/******************************************************************************
|
||||
* PsLastDeepHib
|
||||
* Description: Whether PS wake up from HIB. just means ASMB are all lost
|
||||
* input:
|
||||
* output: BOOL
|
||||
* Comment: Now: apmuBWakeupFromHib() & apmuBWakeupFromSlp2() is not suitable called for PS
|
||||
* as AP sleep mode maybe changed in MCU mode.
|
||||
******************************************************************************/
|
||||
BOOL PsLastDeepHib(void);
|
||||
|
||||
/******************************************************************************
|
||||
* PsLastDeepSlp2
|
||||
* Description: Whether PS wake up from sleep2. just means ASMB are still usefull
|
||||
* input:
|
||||
* output: BOOL
|
||||
* Comment:
|
||||
******************************************************************************/
|
||||
BOOL PsLastDeepSlp2(void);
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,170 @@
|
||||
#ifndef __PS_TRACE_H__
|
||||
#define __PS_TRACE_H__
|
||||
|
||||
/******************************************************************************
|
||||
******************************************************************************
|
||||
Copyright: - 2017, All rights reserved by AirM2M
|
||||
File name: - pstrace.h
|
||||
Description: - PS unilog trace header
|
||||
History: - 2020/11/24, Originated by Jason
|
||||
******************************************************************************
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
* include OS header files
|
||||
******************************************************************************/
|
||||
#ifndef WIN32
|
||||
#include "debug_trace.h"
|
||||
#endif
|
||||
|
||||
/******************************************************************************
|
||||
*****************************************************************************
|
||||
* MARCO
|
||||
*****************************************************************************
|
||||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* EC618 unilog header/Payload0 (UINT32) struct:
|
||||
* 31 28 27 23 21 20 16 15 9 8 7 0
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | ownId | modId | subId | payLoadLen |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* A> ownId[28:31], 4 bits
|
||||
* UniLogOwnerIdType: UNILOG_PLAT/UNILOG_MIDWARE/UNILOG_PS1/UNILOG_PS2/
|
||||
* UNILOG_PHY_ONLINE/UNILOG_PHY_OFFLINE/UNILOG_APP/...
|
||||
* B> modId[21:27], 7 bits, MAX: 127
|
||||
* C> subId[11:20], 10 bits, MAX: 1023
|
||||
* D> payLoadLen[0:10], 11 bits
|
||||
* Log length MAX: 2023 bytes
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*****************************************************************************
|
||||
* STRUCT/ENUM
|
||||
*****************************************************************************
|
||||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* Module ID defination for owner: UNILOG_PS1
|
||||
*/
|
||||
typedef enum UniLogPs1ModIdType_enum
|
||||
{
|
||||
UNILOG_PS_DUMP = 0, /**< used for PS HEX dump */
|
||||
|
||||
UNILOG_NB_RRC_BCCH_BCH_DUMP = 1,
|
||||
UNILOG_NB_RRC_BCCH_DL_SCH_DUMP,
|
||||
UNILOG_NB_RRC_DL_CCCH_DUMP,
|
||||
UNILOG_NB_RRC_DL_DCCH_DUMP,
|
||||
UNILOG_NB_RRC_DL_PCCH_DUMP,
|
||||
UNILOG_NB_RRC_UL_CCCH_DUMP,
|
||||
UNILOG_NB_RRC_UL_DCCH_DUMP,
|
||||
|
||||
UNILOG_LTE_RRC_BCCH_BCH_DUMP,
|
||||
UNILOG_LTE_RRC_BCCH_DL_SCH_DUMP,
|
||||
UNILOG_LTE_RRC_BCCH_DL_SCH_BR_DUMP,
|
||||
UNILOG_LTE_RRC_DL_CCCH_DUMP,
|
||||
UNILOG_LTE_RRC_DL_DCCH_DUMP,
|
||||
UNILOG_LTE_RRC_DL_PCCH_DUMP,
|
||||
UNILOG_LTE_RRC_SC_MCCH_DUMP,
|
||||
UNILOG_LTE_RRC_UL_CCCH_DUMP,
|
||||
UNILOG_LTE_RRC_UL_DCCH_DUMP,
|
||||
UNILOG_LTE_RRC_VAR_MEASCONFIG_DUMP,
|
||||
|
||||
UNILOG_EPS_SECURITY_DUMP,
|
||||
UNILOG_EPS_PLAIN_DUMP,
|
||||
|
||||
UNILOG_PS = 30,
|
||||
UNILOG_PS_SIG_DUMP,
|
||||
UNILOG_PS_INTER_MSG,
|
||||
UNILOG_UP,
|
||||
UNILOG_MAC,
|
||||
UNILOG_RLC,
|
||||
UNILOG_PDCP,
|
||||
UNILOG_BM,
|
||||
UNILOG_DR,
|
||||
UNILOG_CERRC = 40,
|
||||
UNILOG_NAS = 50,
|
||||
UNILOG_CEMM,
|
||||
UNILOG_CESM,
|
||||
UNILOG_SMS,
|
||||
UNILOG_SS,
|
||||
UNILOG_NAS_PLMN,
|
||||
UNILOG_UICC = 60,
|
||||
UNILOG_UICC_DRV,
|
||||
UNILOG_CCM = 70,
|
||||
UNILOG_CCM_REG,
|
||||
UNILOG_CCM_DEV,
|
||||
UNILOG_CCM_PS,
|
||||
UNILOG_CCM_SMS,
|
||||
UNILOG_CCM_SIM,
|
||||
UNILOG_CAM = 80,
|
||||
UNILOG_CAM_DEV,
|
||||
UNILOG_CAM_MM,
|
||||
UNILOG_CAM_PS,
|
||||
UNILOG_CAM_SIM,
|
||||
UNILOG_CAM_SMS,
|
||||
|
||||
/*
|
||||
* PS1 modID add here
|
||||
*/
|
||||
|
||||
UNILOG_PS1_MOD_MAX = 127
|
||||
}UniLogPs1ModIdType;
|
||||
|
||||
|
||||
#ifndef WIN32
|
||||
/*
|
||||
* used to compate: ECOMM_TRACE()
|
||||
*/
|
||||
#define ECPS_TRACE(moduleId, subId, debugLevel, argLen, format, ...) \
|
||||
do \
|
||||
{ \
|
||||
swLogPrintf(UNILOG_PS1##__##moduleId##__##subId, debugLevel, ##__VA_ARGS__); \
|
||||
{(void)format;} \
|
||||
}while(0)
|
||||
|
||||
/*
|
||||
* New API: ECPS_PRINTF(), could print atmost: 8 parameters, and support string print
|
||||
*/
|
||||
#define ECPS_PRINTF(moduleId, subId, debugLevel, format, ...) \
|
||||
do \
|
||||
{ \
|
||||
swLogPrintf(UNILOG_PS1##__##moduleId##__##subId, debugLevel, ##__VA_ARGS__); \
|
||||
{(void)format;} \
|
||||
}while(0)
|
||||
|
||||
/*
|
||||
* #define ECOMM_DUMP(moduleId, subId, debugLevel, format, dumpLen, dump)
|
||||
*/
|
||||
#define ECPS_DUMP(moduleId, subId, debugLevel, format, dumpLen, dump) \
|
||||
do \
|
||||
{ \
|
||||
swLogDump(UNILOG_PS1##__##moduleId##__##subId, debugLevel, dumpLen, dump); \
|
||||
{(void)format;} \
|
||||
}while(0)
|
||||
|
||||
/*
|
||||
* #define ECOMM_DUMP_POLLING(moduleID, subID, debugLevel, format, dumpLen, dump)
|
||||
*/
|
||||
#define ECPS_DUMP_POLLING(moduleId, subId, debugLevel, format, dumpLen, dump) \
|
||||
do \
|
||||
{ \
|
||||
swLogDumpPolling(UNILOG_PS1##__##moduleId##__##subId, debugLevel, dumpLen, dump); \
|
||||
{(void)format;} \
|
||||
}while(0)
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
/******************************************************************************
|
||||
******************************************************************************
|
||||
* API
|
||||
******************************************************************************
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,415 @@
|
||||
#ifndef __PS_UTIL_H__
|
||||
#define __PS_UTIL_H__
|
||||
/******************************************************************************
|
||||
******************************************************************************
|
||||
Copyright: - 2017- Copyrights of AirM2M Ltd.
|
||||
File name: - psutil.h
|
||||
Description: - Protocol Stack COMMON utility, just defined some common
|
||||
functions/structures which is common for all PS tasks
|
||||
History: - 14/09/2020, Originated by Jason
|
||||
******************************************************************************
|
||||
******************************************************************************/
|
||||
|
||||
#include "pssys.h"
|
||||
#include "pscommtype.h"
|
||||
#include "pspdu.h"
|
||||
#include "nascommon.h"
|
||||
|
||||
#define CHECK_EBI_VALID(ebi) (((ebi) >= EBI_5) && ((ebi) <= EBI_15))
|
||||
#define CHECK_CID_VALID(cid) (((UINT32)(cid)) <= 15)
|
||||
|
||||
|
||||
/*
|
||||
* UL PKG default (LT) life time
|
||||
*/
|
||||
#define PS_UL_PKG_DEFAULT_LIFE_TIME_SEC 20
|
||||
|
||||
/*
|
||||
* MAX UL PKG pending PKG size
|
||||
*/
|
||||
#define PS_NB_UL_MAX_PENDING_PKG_SIZE 4500 //3*1500
|
||||
|
||||
/*
|
||||
* MAX UL PKG pending PKG number
|
||||
*/
|
||||
#define PS_NB_UL_MAX_PENDING_PKG_NUM 10
|
||||
|
||||
/*
|
||||
* MAX UL PKG pending PKG size used for CAT1 mode
|
||||
* Here, we suggest service request procedure cost 50ms, and UL TPT is 5.12 Mbps
|
||||
* So pending PKG size = 50*5120/8 = 32KB
|
||||
*/
|
||||
#define PS_UL_MAX_PENDING_PKG_SIZE 32000
|
||||
|
||||
/*
|
||||
* MAX UL PKG pending PKG number, 32000/1500 ~= 22, here set to 32
|
||||
*/
|
||||
#define PS_UL_MAX_PENDING_PKG_NUM 32
|
||||
|
||||
|
||||
/*
|
||||
* Invalid band indicator, band range (1..70) ref to 36.101, Table 5.7.3-1
|
||||
*/
|
||||
#define PS_INVALID_BAND 0
|
||||
|
||||
|
||||
/*
|
||||
* set bit B to 1 in D
|
||||
* example:
|
||||
* Bit1Set(0x00, 0) = 0x01
|
||||
* Bit1Set(0x01, 4) = 0x11
|
||||
*/
|
||||
#define Bit1Set(D, B) ((D) |= ((UINT32)1<<(B)))
|
||||
|
||||
/*
|
||||
* set bit B to 0 in D
|
||||
* example:
|
||||
* Bit0Set(0xFF, 0) = 0xFE
|
||||
* Bit0Set(0xFE, 4) = 0xEE
|
||||
*/
|
||||
#define Bit0Set(D, B) ((D) &= (~((UINT32)1<<(B))))
|
||||
|
||||
|
||||
/*
|
||||
* whether bit B in D is 1
|
||||
* example:
|
||||
* IsBit1(1010 1010, 0) = FALSE
|
||||
* IsBit1(1010 1010, 1) = TRUE
|
||||
*/
|
||||
#define IsBit1(D, B) ((((D)>>(B))&0x01) == 0x01)
|
||||
|
||||
/*
|
||||
* whether bit B in D is 0
|
||||
* example:
|
||||
* IsBit0(1010 1010, 0) = TRUE
|
||||
* IsBit0(1010 1010, 1) = FALSE
|
||||
*/
|
||||
#define IsBit0(D, B) ((((D)>>(B))&0x01) == 0x00)
|
||||
|
||||
/*
|
||||
* Get bit N value
|
||||
* example:
|
||||
* GetBitN(1010 1010, 0) = 0
|
||||
* GetBitN(1010 1010, 1) = 1
|
||||
*/
|
||||
#define GetBitN(D, B) (((D)>>(B))&0x01)
|
||||
|
||||
/*
|
||||
* Get N bits value, start from S,
|
||||
* example:
|
||||
* GetBitsN(0x18, 0, 4) = 0x08
|
||||
* GetBitsN(0x18, 3, 2) = 0x03
|
||||
*/
|
||||
#define GetBitsN(D, S, N) (((D)>>(S))&(~(0xFFFFFFFF << (N))))
|
||||
|
||||
/*
|
||||
* Set N bits of D (UINT8) start from S to V,
|
||||
* (D) &= ~((~(0xFFFFFFFF<<(N)))<<(S)); // set N bits to 0
|
||||
* (D) |= (((V)&(~(0xFFFFFFFF<<(N))))<<(S)); // set N bits to V
|
||||
* example:
|
||||
* SetUint8BitsN(1111 1111, 2, 4, 1010) => 1110 1011
|
||||
* SetUint8BitsN(0000 0000, 4, 3, 101) => 0101 0000
|
||||
*/
|
||||
#define SetUint8BitsN(D, S, N, V) ((D) &= ~((~(0xFFFFFFFF<<(N)))<<(S)), (D) |= (((V)&(~(0xFFFFFFFF<<(N))))<<(S)))
|
||||
|
||||
/*
|
||||
* GET bytes number from bits number
|
||||
* example: GetBitsByteLen(3) = 1
|
||||
* GetBitsByteLen(8) = 1
|
||||
* GetBitsByteLen(10) = 2
|
||||
*/
|
||||
//#define GetBitsByteLen(bits) (((bits)&0x07) == 0 ? ((bits)>>3) : (((bits)>>3)+1))
|
||||
#define GetBitsByteLen(bitlen) (((bitlen)+7)>>3)
|
||||
|
||||
/*
|
||||
* GetBitLen(1) = 8
|
||||
* GetBitLen(2) = 16
|
||||
*/
|
||||
#define GetBitLen(byteLen) ((byteLen)<<3)
|
||||
|
||||
/*
|
||||
* Get4ByteAlignLen(0) = 0
|
||||
* Get4ByteAlignLen(1) = 4
|
||||
* Get4ByteAlignLen(8) = 8
|
||||
*/
|
||||
#define Get4ByteAlignLen(byteLen) (((byteLen)+3)&0xFFFFFFFC)
|
||||
|
||||
/*
|
||||
* IsByteAligned(8) = TRUE
|
||||
* IsByteAligned(13) = FALSE
|
||||
* IsByteAligned(16) = TRUE
|
||||
*/
|
||||
#define IsByteAligned(bitLen) (((bitLen)&0x07) == 0)
|
||||
|
||||
|
||||
/*
|
||||
* SHA-256 functions
|
||||
*/
|
||||
/* The right shift operation */
|
||||
#define SHR(x, n) ((x) >> (n))
|
||||
/* The rotate right (circular right shift) operation */
|
||||
#define ROTR(x, n) (((x) >> (n)) | ((x) << (32 - (n))))
|
||||
#define Ch(x, y, z) (((x) & (y)) ^ (~(x) & (z)))
|
||||
#define Maj(x, y, z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z)))
|
||||
#define SIGMA0(x) (ROTR((x), 2) ^ ROTR((x), 13) ^ ROTR((x), 22))
|
||||
#define SIGMA1(x) (ROTR((x), 6) ^ ROTR((x), 11) ^ ROTR((x), 25))
|
||||
#define sigma0(x) (ROTR((x), 7) ^ ROTR((x), 18) ^ (SHR((x), 3)))
|
||||
#define sigma1(x) (ROTR((x), 17) ^ ROTR((x), 19) ^ (SHR((x), 10)))
|
||||
|
||||
|
||||
#ifdef WIN32
|
||||
void PsFreeOneDlPduBlock(DlPduBlock **pDlPduBlk); //specification
|
||||
#else
|
||||
#define PsFreeOneDlPduBlock(ppDlPduBlk) OsaFreeOneDlPduBlock((ppDlPduBlk))
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
void PsFreeDlPduBlockList(DlPduBlock **pDlPduBlk); //specification
|
||||
#else
|
||||
#define PsFreeDlPduBlockList(ppDlPduBlk) OsaFreeDlPduBlockList((ppDlPduBlk))
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef WIN32
|
||||
void PsFreeOneUlPduBlock(UlPduBlock **pUlPduBlk); //specification
|
||||
#else
|
||||
#define PsFreeOneUlPduBlock(ppUlPduBlk) OsaFreeOneUlPduBlock((ppUlPduBlk))
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
void PsFreeUlPduBlockList(UlPduBlock **pUlPduBlk); //specification
|
||||
#else
|
||||
#define PsFreeUlPduBlockList(ppUlPduBlk) OsaFreeUlPduBlockList((ppUlPduBlk))
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Free the "UlPduBlock" list
|
||||
* void PsFreeDataPduList(UlPduBlock **pPdu);
|
||||
*/
|
||||
#ifdef WIN32
|
||||
#define PsFreeDataPduList(ppUlPduBlk) PsFreeUlPduBlockList((ppUlPduBlk))
|
||||
#else
|
||||
#define PsFreeDataPduList(ppUlPduBlk) OsaFreeUlPduBlockList((ppUlPduBlk))
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Single linked list operation MARCO
|
||||
* !!!! STRUCT must have "pNext" element !!!
|
||||
*/
|
||||
#define PsSingleLinkAddOne(pHdr, pTailer, pNew) \
|
||||
do { \
|
||||
if ((pHdr) == PNULL) \
|
||||
{ \
|
||||
GosCheck((pTailer) == PNULL && (pNew) != PNULL && ((pNew)->pNext) == PNULL, (pTailer), ((pNew)->pNext), 0xABCDEF); \
|
||||
(pHdr) = (pTailer) = (pNew); \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
GosCheck((pTailer) != PNULL && (pNew) != PNULL && ((pNew)->pNext) == PNULL, (pTailer), ((pNew)->pNext), 0xFEDCBA); \
|
||||
(pTailer)->pNext = (pNew); \
|
||||
(pTailer) = (pNew); \
|
||||
} \
|
||||
}while(FALSE)
|
||||
|
||||
/*
|
||||
*/
|
||||
#define PsSingleLinkAddList(pHdr, pTailer, pNewHdr, pNewTailer) \
|
||||
do { \
|
||||
if ((pHdr) == PNULL) \
|
||||
{ \
|
||||
GosCheck((pTailer) == PNULL && (pNewHdr) != PNULL && ((pNewTailer)->pNext) == PNULL, (pTailer), ((pNewTailer)->pNext), 0x12345678); \
|
||||
(pHdr) = (pNewHdr); \
|
||||
(pTailer) = (pNewTailer); \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
GosCheck((pTailer) != PNULL && (pNewHdr) != PNULL && ((pNewTailer)->pNext) == PNULL, (pTailer), ((pNewTailer)->pNext), 0x87654321); \
|
||||
(pTailer)->pNext = (pNewHdr); \
|
||||
(pTailer) = (pNewTailer); \
|
||||
} \
|
||||
}while(FALSE)
|
||||
|
||||
|
||||
|
||||
#define SET_UINT32_DATA_LEFT_SHIFT(n,b,i) \
|
||||
{ \
|
||||
(n) = ( (UINT32) (b)[(i) ] ) \
|
||||
| ( (UINT32) (b)[(i) + 1] << 8 ) \
|
||||
| ( (UINT32) (b)[(i) + 2] << 16 ) \
|
||||
| ( (UINT32) (b)[(i) + 3] << 24 ); \
|
||||
}
|
||||
|
||||
#define SET_UINT32_DATA_RIGHT_SHIFT(n,b,i) \
|
||||
{ \
|
||||
(b)[(i) ] = (UINT8) (((n) ) & 0xFF ); \
|
||||
(b)[(i) + 1] = (UINT8) (((n) >> 8 ) & 0xFF ); \
|
||||
(b)[(i) + 2] = (UINT8) (((n) >> 16 ) & 0xFF ); \
|
||||
(b)[(i) + 3] = (UINT8) (((n) >> 24 ) & 0xFF ); \
|
||||
}
|
||||
|
||||
|
||||
|
||||
typedef enum PS_CHAP_AUTH_CODE_TYPE_Tag
|
||||
{
|
||||
CHAP_MSG_CODE_TYPE_CHALLENGE = 1,
|
||||
CHAP_MSG_CODE_TYPE_RESPONSE = 2,
|
||||
CHAP_MSG_CODE_TYPE_SUCCESS = 3,
|
||||
CHAP_MSG_CODE_TYPE_FAILURE = 4,
|
||||
}PS_CHAP_AUTH_CODE_TYPE;
|
||||
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*****************************************************************************
|
||||
* Functions specification
|
||||
*****************************************************************************
|
||||
******************************************************************************/
|
||||
|
||||
UINT8 Uint8Bit1Search(UINT8 data);
|
||||
UINT8 Uint16Bit1Search(UINT16 data);
|
||||
UINT8 Uint32Bit1Search(UINT32 data);
|
||||
UINT8 UintBit1Search(UINT32 data);
|
||||
|
||||
UINT8 Uint4Bit0Search(UINT8 data);
|
||||
UINT8 Uint8Bit0Search(UINT8 data);
|
||||
UINT8 Uint16Bit0Search(UINT16 data);
|
||||
UINT8 Uint32Bit0Search(UINT32 data);
|
||||
UINT8 UintBit0Search(UINT32 data);
|
||||
|
||||
#ifdef WIN32
|
||||
/*
|
||||
* set bits value (1-32 bits) ina UINT8 pBuf
|
||||
*/
|
||||
void SetBufBitsValue(UINT8 *pBuf, UINT32 *startBitOffset, UINT8 bitsLen, UINT32 value);
|
||||
|
||||
/*
|
||||
* Get "bitLen" (MAX 32 bits) bits value from "pBuf" start from "bitOffset"
|
||||
*/
|
||||
UINT32 GetBufBitsValue(const UINT8 *pBuf, UINT32 *startBitOffset, UINT8 bitsLen);
|
||||
|
||||
/*
|
||||
* Whether memory is all set to zero, 1 - TRUE, 0 - FALSE
|
||||
*/
|
||||
UINT32 BeZeroMemory(const void *pMem, UINT32 size);
|
||||
|
||||
#else
|
||||
|
||||
#define SetBufBitsValue(pBuf, startBitOffset, bitsLen, value) \
|
||||
OsaSetBufBitsValue((pBuf), (startBitOffset), (bitsLen), (value))
|
||||
|
||||
#define GetBufBitsValue(pBuf, startBitOffset, bitsLen) \
|
||||
OsaGetBufBitsValue((pBuf), (startBitOffset), (bitsLen))
|
||||
|
||||
#define BeZeroMemory(pMem, size) \
|
||||
OsaBeZeroMemory((pMem), (size))
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* BITS COPY
|
||||
*/
|
||||
void PsBitsCopy(UINT8 *pDestBuf, UINT16 *pDestBO, UINT8 *pSrcBuf, UINT16 ibo, UINT16 bitLen);
|
||||
|
||||
/*
|
||||
* get PLMN info from IMSI
|
||||
*/
|
||||
Plmn PsGetPlmnFromImsi(Imsi *pImsi);
|
||||
|
||||
void HmacSha256(UINT16 inputKeyLength, UINT8 *pInputKey, UINT32 messageLength, UINT8 *pMessageContent, UINT8 *outPut);
|
||||
|
||||
/*
|
||||
* Free the Data memory, which type is : UlPduMemType
|
||||
*/
|
||||
void PsFreeDataPduMem(UINT8 memType, UINT8 **ptr);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Free the "PacketFilterList" list
|
||||
*/
|
||||
void PsFreePacketFilterlist(PacketFilterList** pflist);
|
||||
|
||||
/*
|
||||
* Copy the "PacketFilterList" list
|
||||
*/
|
||||
void PsCopyTftList(const PacketFilterList *pSrcTftHdr, PacketFilterList **ppDestTftHdr);
|
||||
|
||||
/*
|
||||
* get next UL Pkg header in the list
|
||||
*/
|
||||
UlPduBlock* PsGetNextUlPkgHdr(UlPduBlock *pPdu);
|
||||
|
||||
/*
|
||||
* check whether the UL PKG(DATA) is out of date
|
||||
*/
|
||||
BOOL PsUlDataBeOutDate(UINT8 tickType, UINT32 sysTick, BOOL *bMustDiscard);
|
||||
|
||||
/*
|
||||
* Get the PDU pkg number, and valid total length in UL PDU list
|
||||
*/
|
||||
void PsGetUlPduNumAndLenInList(const UlPduBlock *pHdr, const UlPduBlock *pTailer, UINT32 *pPduNum, UINT32 *pPduLen);
|
||||
|
||||
/*
|
||||
* Clear the UL pending PKG list
|
||||
* check whether out of date, or pending pkg number/size overflow
|
||||
*/
|
||||
//UINT32 PsClearUlPendingPduList(UlPduBlock **pHdr, UlPduBlock **pTailer);
|
||||
|
||||
/*
|
||||
* Clear the UL pending PKG list
|
||||
* check whether out of date, or pending pkg number/size overflow
|
||||
*/
|
||||
void PsClearUlPendingPduList(UlPduBlock **pHdr,
|
||||
UlPduBlock **pTailer,
|
||||
UINT32 *pOutPkgNum,
|
||||
UINT32 *pOutPkgLen);
|
||||
|
||||
/*
|
||||
* TFT route, decide which bearer (return CID) carry this UL PKG
|
||||
*/
|
||||
UINT8 PsTftRouteUlPkg(UINT8 defaultIpv4Cid, UINT8 defaultIpv6Cid, const PacketFilterList *pfList, const UlPduBlock *pPdu);
|
||||
|
||||
/*
|
||||
* APN format convert
|
||||
*/
|
||||
void ConvertDisPlayApnToNetworkFormat(const UINT8 *srcApn, UINT8 srcApnLen, UINT8 *desApn, UINT8 *desApnLen);
|
||||
void ConvertNetworkApnToDisPlayFormat(const UINT8 *srcApn, UINT8 srcApnLen, UINT8 *desApn, UINT8 *desApnLen);
|
||||
|
||||
/*
|
||||
* Convert DL EARFCN to BAND
|
||||
*/
|
||||
UINT8 PsGetBandFromDlEarfcn(UINT32 dlEarfcn);
|
||||
|
||||
/*
|
||||
* Check overseas operator
|
||||
*/
|
||||
BOOL PsIsOverseasOperator(Plmn plmn);
|
||||
|
||||
/*
|
||||
* Encode GSM 7Bit
|
||||
*/
|
||||
UINT16 PsEncodeGsm7BitData(UINT8 *pInput, UINT16 inputLength, UINT8 *pOutput, UINT16 outputLength, UINT16 shiftBits);
|
||||
|
||||
/*
|
||||
* Decode GSM 7Bit
|
||||
*/
|
||||
UINT16 PsDecodeGsm7BitData(UINT8 *pInput, UINT16 inputLength, UINT8 *pOutput, UINT16 outputLength, UINT16 shiftBits);
|
||||
|
||||
/*Generate a defined length random */
|
||||
UINT16 PsGenRandom(UINT16 outPutLen,UINT8 *pOutPut);
|
||||
|
||||
|
||||
/* to generate a CHAP authenticaion response with MD5 hash */
|
||||
void PsGenChapMd5HashResponse(
|
||||
const UINT8 *identifier,
|
||||
const UINT8 *pSecretVal,
|
||||
const UINT16 secretLen,
|
||||
const UINT8 *pChallenge,
|
||||
const UINT16 challengeLen,
|
||||
UINT8 outPut[16]);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
#ifndef TCPIP_HDR_HIB_API_H
|
||||
#define TCPIP_HDR_HIB_API_H
|
||||
|
||||
/******************************************************************************
|
||||
******************************************************************************
|
||||
Copyright: - 2019- Copyrights of AirM2M Ltd.
|
||||
File name: - tcpiphibapi.h
|
||||
Description: - tcpip layer hib/sleep2 mode related API
|
||||
History: - 04/24/2019, Originated by xwang
|
||||
******************************************************************************
|
||||
******************************************************************************/
|
||||
#ifdef WIN32
|
||||
#include "winsys.h"
|
||||
#else
|
||||
#include "commontypedef.h"
|
||||
#endif
|
||||
|
||||
|
||||
#define PSIF_DNSCACHE_MAX_URL_LEN 68
|
||||
|
||||
/******************************************************************************
|
||||
*****************************************************************************
|
||||
* STRUCT
|
||||
*****************************************************************************
|
||||
******************************************************************************/
|
||||
|
||||
enum pcb_hib_state {
|
||||
PCB_HIB_DISABLE_DEACTIVE = 0,
|
||||
PCB_HIB_ENABLE_DEACTIVE = 1,
|
||||
PCB_HIB_ENABLE_ACTIVE = 2,
|
||||
};
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*****************************************************************************
|
||||
* Functions
|
||||
*****************************************************************************
|
||||
******************************************************************************/
|
||||
|
||||
BOOL PsifIsTcpipAllowEnterHIB(void);
|
||||
|
||||
void PsifRequestRecoverContextFromHib(void);
|
||||
|
||||
BOOL PsifGetPreTcpipHibContextInfo(UINT8 type);
|
||||
|
||||
BOOL PsifGetCurrTcpipHibContextInfo(UINT8 type);
|
||||
|
||||
void PsifSetCurrTcpipHibContext(BOOL exist, UINT8 type);
|
||||
|
||||
void PsifSetTcpipHibContextChanged(BOOL change, UINT8 type);
|
||||
|
||||
BOOL PsifGetTcpipHibContextChanged(UINT8 type);
|
||||
|
||||
void PisfCheckTcpipHibContextNeedChang(void);
|
||||
|
||||
void PsifTcpipAllowEnterHib(void);
|
||||
|
||||
void PsifTcpipNotAllowEnterHib(void);
|
||||
|
||||
void PsifTcpipHibModeInit(void);
|
||||
|
||||
UINT32 PsifGetCurrHibTicks(void);
|
||||
|
||||
BOOL PsifCheckWetherRecoverFromHib(void);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
/******************************************************************************
|
||||
******************************************************************************
|
||||
Copyright: - 2020- Copyrights of AirM2M Ltd.
|
||||
File name: - tcpipportmgrapi.h
|
||||
Description: - tcpip TCP/UDP port manager API:
|
||||
History: - 12/25/2020 xwang
|
||||
******************************************************************************
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef TCPIP_PORT_MGR_API_H
|
||||
#define TCPIP_PORT_MGR_API_H
|
||||
|
||||
#include "commontypedef.h"
|
||||
|
||||
#define TCPIP_IP_TYPE_4 4
|
||||
#define TCPIP_IP_TYPE_6 6
|
||||
|
||||
typedef enum
|
||||
{
|
||||
PORT_MGR_CONN_SOURCE_INVALID = 0,
|
||||
PORT_MGR_CONN_SOURCE_UE = 1,
|
||||
PORT_MGR_CONN_SOURCE_HOST_ETH = 2,
|
||||
PORT_MGR_CONN_SOURCE_HOST_PPP = 3,
|
||||
PORT_MGR_CONN_SOURCE_HOST_ETH_SECONDARY = 4,
|
||||
PORT_MGR_CONN_SOURCE_HOST_PPP_SECONDARY = 5,
|
||||
PORT_MGR_CONN_SOURCE_NW = 6,
|
||||
PORT_MGR_CONN_SOURCE_ANY = 7,
|
||||
|
||||
}PortMgrConnSource;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
PORT_MGR_CONN_DEST_UNDEFINE = 0,
|
||||
PORT_MGR_CONN_DEST_UE = 1,
|
||||
PORT_MGR_CONN_DEST_HOST = 2,
|
||||
PORT_MGR_CONN_DEST_HOST_ETH = 3,
|
||||
PORT_MGR_CONN_DEST_HOST_PPP = 4,
|
||||
PORT_MGR_CONN_DEST_NW = 5,
|
||||
PORT_MGR_CONN_DEST_MAPPING = 6,
|
||||
|
||||
PORT_MGR_CONN_DEST_UE_AND_HOST_ALL = 7,
|
||||
PORT_MGR_CONN_DEST_UE_AND_NW = 8,
|
||||
PORT_MGR_CONN_DEST_HOST_DNS_PKG = 9,
|
||||
PORT_MGR_CONN_DEST_HOST_ETH_DNS_PKG = 10,
|
||||
PORT_MGR_CONN_DEST_HOST_PPP_DNS_PKG = 11,
|
||||
PORT_MGR_CONN_DEST_NW_DNS_PKG = 12,
|
||||
PORT_MGR_CONN_DEST_DHCP_REQ_PKG = 13,
|
||||
|
||||
}PortMgrConnDest;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
PORT_MGR_CONN_TYPE_UDP = 0,
|
||||
PORT_MGR_CONN_TYPE_TCP = 1,
|
||||
}PortMgrConnType;
|
||||
|
||||
|
||||
UINT8 PortMgrCheckDest(UINT8 source, UINT8 destination, UINT16 sourcePort, UINT16 destPort, UINT8 ipType);
|
||||
|
||||
UINT16 PortMgrUlProcess(UINT8 connType, UINT8 source, UINT16 sourcePort, UINT16 destPort, UINT8 ipType, UINT8 cid);
|
||||
|
||||
UINT8 PortMgrDlMappingProcess(UINT8 connType, UINT16 *originalPort, UINT16 mappingPort, UINT8 ipType, UINT8 cid);
|
||||
|
||||
UINT16 PortMgrNewUeTcpPort(void);
|
||||
|
||||
UINT16 PortMgrNewUeUdpPort(void);
|
||||
|
||||
void PortMgrInit(void);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user