📄 app_task.h
字号:
/****************************************************************************
* Program/file: APP_TASK.H
*
* Copyright (C) by RTX TELECOM A/S, Denmark.
* These computer program listings and specifications, are the property of
* RTX TELECOM A/S, Denmark and shall not be reproduced or copied or used in
* whole or in part without written permission from RTX TELECOM A/S, Denmark.
*
* Programmer: LHJ
*
* MODULE:
* CONTROLLING DOCUMENT:
* SYSTEM DEPENDENCIES:
*
*
* DESCRIPTION: Minimum application layer in the PP. Used for test of the
* DECT protocol.
*
*
*
*
*
****************************************************************************/
/****************************************************************************
* PVCS info
*****************************************************************************
$Author: SS $
$Date: 14 Jan 2004 13:19:54 $
$Revision: 1.19 $
$Modtime: 14 Jan 2004 13:16:04 $
*/
#include <modules\interfaces\cvm\usertask\apiintf.h>
#ifndef __APP_TASK_H
#define __APP_TASK_H
extern void AppTask(uint8 *MailPtr);
extern void AppTaskInit(void);
extern void AppPp(uint8 *MailPtr);
// extern void AppPpInit(void);
extern void AppFp(uint8 *MailPtr);
// extern void AppFpInit(void);
extern void Send_UnidataRealtimeClock(void);
enum ApiBitMap {
CallClassExtData, // bit 00 -
BroadcastToggleBit, // bit 01 |
CvmBatCradledReq, // bit 02 |
CvmBatCapacityReq, // bit 03 | BYTE 0
RealTimeClockSync, // bit 04 |
HookLedPin, // bit 05 |
Unused06, // bit 06 |
Unused07 // bit 07 -
};
#define SIZE_OF_BOOLEAN_ARRAY 1
extern uint8 APIBooleanArray[SIZE_OF_BOOLEAN_ARRAY];
#define SETAPIBIT(A) APIBooleanArray[(A>>3)] |= (1<< (A & 0x7))
#define CLRAPIBIT(A) APIBooleanArray[(A>>3)] &=~(1<< (A & 0x7))
#define TESTAPIBIT(A) (APIBooleanArray[(A>>3)] & (1<< (A & 0x7)))
#define TOGGLEAPIBIT(A) (APIBooleanArray[(A>>3)] & (1<< (A & 0x7))) ? (APIBooleanArray[(A>>3)] &=~(1<< (A & 0x7))) : (APIBooleanArray[(A>>3)] |= (1<< (A & 0x7)))
//extern uint8 XDATA usertask_bBaseNumber; /* Values: 0-4 (0 = not in service) */
extern void userutil_DefaultTPUI(void);
#define APP_STATE_IDLE 0
#define APP_STATE_UNLOCKED_ENROLL 3
#define APP_STATE_ENROLL_PENDING 5
#define APP_STATE_LOCKED 6
#define APP_STATE_OUTGOING_PENDING 7
#define APP_STATE_ACTIVE 8
#define APP_STATE_SERVICE_PENDING 9
#define APP_STATE_SERVICE_ACTIVE 10
#define APP_STATE_RELEASE_PENDING 11
#define ACCESS_RIGHTS_TIMEOUT_VALUE 60 //secs
// broadcast of unitdata
#define CMD_UNITDATA_GENERAL 0x00
#define CMD_UNITDATA_CVM_GENERIC 0x01
#define CMD_UNITDATA_REALTIME_CLOCK 0x02
#define CMD_UNITDATA_MESSAGE_WAITING 0x03
#define CMD_UNITDATA_PLUG_STATUS 0x04
#define CMD_UNITDATA_LINE_STATUS 0x05
#define CMD_UNITDATA_CLIP_PART1 0x06
#define CMD_UNITDATA_CLIP_PART2 0x07
#define CMD_UNITDATA_CLIP_PART3 0x08
#define UNITDATA_MAX_LENGTH 19
// CLIP sending defines
#define CID_REASON_CODE_INDEX 00
#define CID_NUMBER_LENGTH_INDEX 01
#define CID_TIME_DATE_INDEX 02
#define CID_NAME_INDEX 06
#define CID_NUMBER_INDEX 22
#define CID_TIME_DATE_LENGTH 04
// IWU-TO-IWU CLIP types
#define CID_EXIST 00 // Result nothing
#define CID_PRIVATE 01 // Result OK=Finish
#define CID_OUT_OF_AREA 02 // Result NG
#define CID_NO_DATA 03 // Result Continue
#define CID_CALL_BACK 04 // Result call back
#define CID_COIN_PHONE_CALL 05 // Result Coin Phone
#define CID_INTERNATIONAL 06 // Result International
#define CID_SPACE 0x20
#define CID_TELNO_MAX 22 // Telephon No.length max for IA5 format.
#define CID_BCD_MAX (CID_TELNO_MAX/2) // Telephon No.length max for BCD format.
#define CID_NAME_MAX 16 // Calling Name length max.
///////////////////////////////////////////////////////////////////////////////
// High Speed Data variables and defines //////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// Max number of simultanious high speed data connections
#define HSD_MAX_CONNECTIONS 6 //PROJCFG_MINIGAP_DATA_INSTANCES
// We never fill data into the busmail buffer, if it reduces its size to below this
#define HSD_MIN_REMAINING 100
// If busmail allocation failed we try again after this time
#define HSD_RESEND_TIMEOUT_VALUE (T100_MS)
// The Mcei variable is also used to store state information
#define HSD_MCEI_UNUSED 0xFF // Not used
#define HSD_MCEI_CONNECTION_SETUP 0xFE // Connection being setup
#define HSD_MCEI_NOT_INITIALIZED 0xFD // Connection setup, don't know Mcei yet
#define HSD_DATA_FIRST_INSTANCE (HSDData)
#define HSD_DATA_LAST_INSTANCE (HSDData+(HSD_MAX_CONNECTIONS-1))
typedef struct
{
uint8 Mcei; // Used for state and (in FP) stores Mcei when active
uint8 SwitchEi; // Only used in FP
uint8 McuReceiveReadyCount;
} HSDDataType;
extern HSDDataType HSDData[HSD_MAX_CONNECTIONS];
#define CLIP_BROADCAST_PACKAGE_LEN 18 // defines the length of each clip split packages
#define CLIP_BROADCAST_PACKAGE_QUANTITY 3 // defines in how many parts the clip package is split up
#define CLIP_BROADCAST_PACKAGE_RETRANS 3 // <<< defines how many times broadcast clip is retransmitted
///////////////////////////////////////////////////////////////////////////////
// Interface type definitions /////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
typedef struct
{
PrimitiveType PrimitiveIdentifier;
uint8 bVolIndex;
}CvmPpAudioSetVolReqType;
typedef struct
{
PrimitiveType PrimitiveIdentifier;
uint8 bHsPlugState;
}CvmPpAudioHsPlugType;
typedef struct
{
PrimitiveType PrimitiveIdentifier;
uint8 bIwuCode;
uint8 bDataLength;
uint8 bCommand;
uint16 wEepAdr;
uint8 bEepLength;
uint8 bEepData[1];
} CvmEepromRemoteWriteIndType;
typedef struct
{
PrimitiveType PrimitiveIdentifier;
uint8 bIwuCode;
uint8 bDataLength;
uint8 bCommand;
uint16 wEepAdr;
uint8 bEepLength;
} CvmEepromRemoteReadIndType;
typedef struct
{
PrimitiveType PrimitiveIdentifier;
uint8 MuteAttrib;
}CvmFpAudioMuteReqType;
typedef struct
{
PrimitiveType PrimitiveIdentifier;
uint8 bReason;
} MnmmAccessRightsRejType;
typedef struct
{
PrimitiveType PrimitiveIdentifier;
uint8 bSubscriptionNo;
uint8 AcString[4];
} AccessRightsReqType;
typedef struct
{
uint8 bDataLength;
uint8 bData[1];
} CvmGeneralDataType;
//UnidataCvmGenericType
typedef struct
{
uint8 MsgWaiting;
uint8 reserved1;
uint8 reserved2;
uint8 reserved3;
} UnidataCvmGenericType; // max 19 bytes !
// UnitdataRealTimeClockType
typedef struct
{
uint32 RealTimeClock;
} UnidataRealTimeClockType; // max 19 bytes !
// UnitdataPlugStatusType
typedef struct
{
uint8 PlugStatus;
} UnidataPlugStatusIndType; // max 19 bytes !
// UnitdataLineStatusType
typedef struct
{
uint8 LineStatus;
} UnidataLineStatusIndType; // max 19 bytes !
typedef struct
{
PrimitiveType PrimitiveIdentifier;
uint8 LineId;
uint8 ReasonCode;
uint8 ReasonName;
uint8 NumberLen;
uint8 NameLen;
uint8 TimeDateLen;
uint8 VmwiLen;
uint8 NmssLen;
uint8 MsgWaitingData;
} ApiClipDataIndType;
typedef struct
{
struct // 1st byte
{
uint8 NoNum:4; // bit0-3: Reason of No Data Number
uint8 NoName:4; // bit4-7: Reason of No Data Name
} Reason;
struct // 2nd+3rd byte
{
uint8 repeat:4; // bit0-3: Times of repeat
uint8 fOver:1; // bit4 : Data is more than COD_TELNO_MAX
uint8 ClipType:1; // bit5 : ClipType info (TYPE1 or TYPE2)
uint8 Reserve:3; // bit6-10: Reserve (real size 10bit MDA)
} FlagData;
uint8 Month; // Month
uint8 Day; // Day
uint8 Hour; // Hour
uint8 Minute; // Minute
uint8 name[CID_NAME_MAX];
} CidPreDataType;
typedef struct // CID Data for IWUtoIWU message, Telephone No. code is IA5.
{
uint8 AbIndex;
CidPreDataType CidPreData;
uint8 telno[CID_TELNO_MAX];
} CidMailDataType;
typedef struct
{
uint8 bClipType;
uint8 bClipReason;
uint8 bClipMonth;
uint8 bClipDate;
uint8 bClipHours;
uint8 bClipMinutes;
uint8 bClipNameLength;
uint8 bClipNumberLength;
} ApiClipIndHeaderType;
typedef struct
{
PrimitiveType PrimitiveIdentifier;
ApiClipIndHeaderType bClipHeader;
uint8 bClipData[1];
} ApiClipIndDataType;
typedef struct
{
PrimitiveType PrimitiveIdentifier; // Must be FP_MNCL_UNITDATA_REQ.
uint8 dummy[23];
uint8 bSignal;
} PpMnccSetupType;
//CVM_FP_SW_AUDIO_MUTE_IND
typedef struct
{
PrimitiveType PrimitiveIdentifier;
uint8 bConnectionEI;
uint8 bCtrlCmd;
} CvmFpSwAudioMuteIndType;
// CVM_MESSAGE_WAITING_IND
typedef struct
{
PrimitiveType PrimitiveIdentifier;
uint8 bIndication;
} ApiMessageWaitingIndType;
typedef struct
{
PrimitiveType PrimitiveIdentifier; // Must be CVM_PP_VREF_CTRL_REQ.
uint8 VrefMask; // set bit for Vref that should be enabled.
} CvmPpVrefCtrlReqType;
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -