📄 push.h
字号:
/*
* Copyright (C) Ericsson Mobile Communications AB, 2000.
* Licensed to AU-System AB.
* All rights reserved.
*
* This software is covered by the license agreement between
* the end user and AU-System AB, and may be used and copied
* only in accordance with the terms of the said agreement.
*
* Neither Ericsson Mobile Communications AB nor AU-System AB
* assumes any responsibility or liability for any errors or inaccuracies in
* this software, or any consequential, incidental or indirect damage arising
* out of the use of the Generic WAP Client software.
*/
#ifndef _Push_H
#define _Push_H
/*========================================================================
WAP Implementation Project
==========================================================================
File: push.h
Description:
Author: Martin Ranstorp, Kent Olsson AU-System Radio AB
Revision history:
Date Rev Sign Comment
990920 PA1 MRP First version.
991206 PA2 MRP Updated. Working in WAE test environment.
000118 PA3 MRP Updated after validation inspection.
000124 PA4 MRP Updated after code inspection.
000208 PA5 JPR Function ME_Push_DateTime2Int moved to PUSHElm.h
000214 PA6 MRP Copyright addded.
000316 PA7 MRP Push API changed.
000918 PA8 MRP Updated configuration handling (4.x).
001114 PA9 KEOL Uppdated after change request regarding handling of GetSI and GetSL (reply with initiators URI as well)
001220 PA10 HEAD Added ME_Push_Get_First=Get first element in the list,
ME_Push_Get_Next=get next element in list, and
ME_Push_Get_PushListStruct=get content of the list element.
=========================================================================*/
#include "cmmnrsrc.h"
#include "wae_cmmn.h"
#include "wmlelm.h"
#include "p_contif.h"
#include "pushdef.h"
/************************************/
/* Service Indication Content type */
/************************************/
typedef struct
{
UINT8 iStatus;
UINT32 iCreated;
UINT32 iExpires;
UINT8 iAction;
WCHAR* pwchSIid;
WCHAR* pwchMessage;
BYTE* pbUrl;
BYTE* pbInitUri;
} SICONTENTSTRUCT, *pSICONTENTSTRUCT;
/************************************/
/* Service Loading Content type */
/************************************/
typedef struct
{
UINT8 iStatus;
UINT8 iAction;
BYTE* pbUrl;
BYTE* pbInitUri;
} SLCONTENTSTRUCT, *pSLCONTENTSTRUCT;
typedef struct
{
UINT8 iType;
UINT8 iPortType;
UINT32 iId;
UINT8 iNewChannelId;
union {
SICONTENTSTRUCT* pSIContentStruct;
SLCONTENTSTRUCT* pSLContentStruct;
} content;
} PUSHCONTENTSTRUCT, *pPUSHCONTENTSTRUCT;
typedef struct
{
UINT8 iPushType;
UINT8 iStatus;
UINT32 iCreated;
UINT32 iExpires;
UINT8 iAction;
UINT32 iLLPushId;
WCHAR* pwchPushId;
UINT8 iChannel;
UINT16 iIdNumber;
UINT8 iPortType;
} PUSHLISTSTRUCT, *pPUSHLISTSTRUCT;
typedef struct
{
UINT8 iChannel;
UINT16 iClientPushId;
UINT8 iPortType;
BOOL bConfirm;
VOID* pPushBody;
UINT32 iBodyLen;
VOID* pPushHeader;
UINT32 iHeaderLen;
} SIGNALSTRUCT, *pSIGNALSTRUCT;
typedef struct
{
UINT8 iSIAId;
UINT8 iChannel;
} SIASTRUCT, *pSIASTRUCT;
/***********************/
/* Push Type values */
/***********************/
#define SI 1
#define SL 2
#define CO 3
#define SIA 4
/***********************/
/* Push Status values */
/***********************/
#define PUSH_NEW 1
#define PUSH_STORED 2
#define PUSH_ACTIVE 3
#define PUSH_POSTPONED 4
#define PUSH_POSTPONED_READ 5
/***********************/
/* Debug stuff */
/***********************/
#ifdef WAE_DEBUG
#if defined XSCT_CMICRO || defined NOT_USING_SDL
#define URL_DEBUG_PRINT(a) printf(a)
#else
#define URL_DEBUG_PRINT(a) xTraceAlg(a)
#endif
#endif
/*========================================================================
FUNCTION PROTOTYPES
=========================================================================*/
/*========================================================================
ME_Push_GetConnection
==========================================================================
Purpose: Check and get first correct address and if ok request connection
Params: pvAddressList
Return: 1 if ok, else 0
=========================================================================*/
UINT8 ME_Push_GetConnection( void* pvAddressList );
/*========================================================================
ME_Push_GetFreeIdNumber
==========================================================================
Purpose: Get free IdNumber to use
Params: pvList (any list)
Return: UINT16 IdNumber, 0 means failure
=========================================================================*/
UINT16 ME_Push_GetFreeIdNumber(void* pvList);
/*========================================================================
ME_Free_PushContentStruct
==========================================================================
Purpose: Free the PushContent struct
Params: vsPushContent
Return: TRUE
=========================================================================*/
void ME_Free_PushContentStruct(void* pvPushContentStruct);
/*========================================================================
ME_Push_List_Add
==========================================================================
Purpose: Add a new element to the Push List
Params: pvPushList, pvPushListStruct
Return: 1 if ok, else 0
=========================================================================*/
UINT8 ME_Push_List_Add( void* pvPushList, void* pvPushListStruct );
/*========================================================================
ME_Push_Change_Place_In_List
==========================================================================
Purpose: Change place on OldElement and NewElement in the list
Params: pvPushList, pvPushListStructNew, pvPushListStructOld
Return:
=========================================================================*/
void ME_Push_Change_ElementId_In_List(void* pvPushList, void* pvPushListStructNew, void* pvPushListStructOld);
/*========================================================================
ME_Push_List_Delete
==========================================================================
Purpose: Deletes an element from the Push List
Params: pvPushList, pvPushListStruct
Return:
=========================================================================*/
void ME_Push_List_Delete( void* pvPushList, void* pvPushListStruct );
/*========================================================================
ME_Push_List_Sort
==========================================================================
Purpose: Sort the elements in the Push List
Params: pvPushList
Return:
=========================================================================*/
void* ME_Push_List_Sort(void* pvPushList);
/*========================================================================
ME_CompareWString
==========================================================================
Purpose: Compares two WCHAR strings
Params: pwch1, pwch2
Return: Boolean
=========================================================================*/
BOOL ME_CompareWString(WCHAR* pwch1, WCHAR* pwch2);
/*========================================================================
ME_Push_Get_First_New
==========================================================================
Purpose: Gets first new Push in Push list
Params: pvPushList
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -