FreeCalypso > hg > fc-magnetite
view src/aci2/bmi/mmiGprs.h @ 600:8f50b202e81f
board preprocessor conditionals: prep for more FC hw in the future
This change eliminates the CONFIG_TARGET_FCDEV3B preprocessor symbol and
all preprocessor conditionals throughout the code base that tested for it,
replacing them with CONFIG_TARGET_FCFAM or CONFIG_TARGET_FCMODEM. These
new symbols are specified as follows:
CONFIG_TARGET_FCFAM is intended to cover all hardware designs created by
Mother Mychaela under the FreeCalypso trademark. This family will include
modem products (repackagings of the FCDEV3B, possibly with RFFE or even
RF transceiver changes), and also my desired FreeCalypso handset product.
CONFIG_TARGET_FCMODEM is intended to cover all FreeCalypso modem products
(which will be firmware-compatible with the FCDEV3B if they use TI Rita
transceiver, or will require a different fw build if we switch to one of
Silabs Aero transceivers), but not the handset product. Right now this
CONFIG_TARGET_FCMODEM preprocessor symbol is used to conditionalize
everything dealing with MCSI.
At the present moment the future of FC hardware evolution is still unknown:
it is not known whether we will ever have any beyond-FCDEV3B hardware at all
(contingent on uncertain funding), and if we do produce further FC hardware
designs, it is not known whether they will retain the same FIC modem core
(triband), if we are going to have a quadband design that still retains the
classic Rita transceiver, or if we are going to switch to Silabs Aero II
or some other transceiver. If we produce a quadband modem that still uses
Rita, it will run exactly the same fw as the FCDEV3B thanks to the way we
define TSPACT signals for the RF_FAM=12 && CONFIG_TARGET_FCFAM combination,
and the current fcdev3b build target will be renamed to fcmodem. OTOH, if
that putative quadband modem will be Aero-based, then it will require a
different fw build target, the fcdev3b target will stay as it is, and the
two targets will both define CONFIG_TARGET_FCFAM and CONFIG_TARGET_FCMODEM,
but will have different RF_FAM numbers. But no matter which way we are
going to evolve, it is not right to have conditionals on CONFIG_TARGET_FCDEV3B
in places like ACI, and the present change clears the way for future
evolution.
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 01 Apr 2019 01:05:24 +0000 |
parents | 3c2acfa1a72f |
children |
line wrap: on
line source
/******************************************************************************* CONDAT (UK) ******************************************************************************** This software product is the property of Condat (UK) Ltd and may not be disclosed to any third party without the express permission of the owner. ******************************************************************************** $Project name: $Project code: $Module: $File: MmiGprs.h $Revision: $Author: Condat(UK) $Date: ******************************************************************************** Description: Header file for GPRS handling for MMI. ******************************************************************************** $History: MmiGprs.h 15/05/2003 - SPR#1983 - SH - Updated to latest from 1.6.3 version. $End *******************************************************************************/ #ifndef _MMI_GPRS_H_ #define _MMI_GPRS_H_ #ifndef WIN32 // EF GPRS testing enabled for windows #undef TEST_MMIGPRS /* GPRS testing, gives extra menu functions */ #endif /******************************************************************************* GLOBAL DEFINITIONS *******************************************************************************/ /* GPRS states */ enum { GPRS_NOTHING = -1, /* Nothing - no event to send */ GPRS_OFF = 0, /* GPRS is not attached */ GPRS_SEARCHING, GPRS_ATTACHED, /* GPRS is attached */ GPRS_CONTEXT_ACTIVATE, /* PDP context is activated */ GPRS_CONTEXT_DEACTIVATE, /* PDP context is deactivated */ GPRS_ERROR /* General GPRS error */ }; #if (BOARD == 61) /* EDGE states */ enum { EDGE_NOTHING = -1, /* Nothing - no event to send */ EDGE_OFF = 0, /* EDGE is not attached */ EDGE_SEARCHING, EDGE_ATTACHED, /* EDGE is attached */ EDGE_CONTEXT_ACTIVATE, /* PDP context is activated */ EDGE_CONTEXT_DEACTIVATE, /* PDP context is deactivated */ EDGE_ERROR /* General EDGE error */ }; #endif typedef enum { MMI_GPRS_STATUS_IDLE, MMI_GPRS_STATUS_ATTACHING, MMI_GPRS_STATUS_DETACHING, MMI_GPRS_STATUS_DATA_COUNTER }; /* SMS options */ enum { SMS_SERVICE_GPRS = 0, SMS_SERVICE_CS, SMS_SERVICE_GPRS_PREF, SMS_SERVICE_CS_PREF, SMS_SERVICE_OMITTED = 0xFF }; /* Quality of service (QOS) parameters */ enum { QOS_PRECED_HIGH = 1, QOS_PRECED_NORMAL, QOS_PRECED_LOW }; enum { QOS_BEST = 1 }; /* Callback function */ typedef void (*T_GPRS_CB) (int);// Earlier argument not used void GPRS_Init(void); void GPRS_Exit(void); void GPRS_SetCallback(T_MFW_HND win, T_GPRS_CB callback); /* GPRS functionality */ int GPRS_Status(void); int GPRS_Attach(T_MFW_HND win); int GPRS_Detach(T_MFW_HND win); int GPRS_ContextDefine(SHORT cid, char *IPAddress, char *APN); int GPRS_ContextActivate(SHORT cid); int GPRS_ContextDeactivate(SHORT cid); int GPRS_SetQOS(SHORT cid, UBYTE preced, UBYTE delay, UBYTE relclass, UBYTE peak, UBYTE mean); int GPRS_SetMinQOS(SHORT cid, UBYTE preced, UBYTE delay, UBYTE relclass, UBYTE peak, UBYTE mean); UBYTE GPRS_SmsService(void); UBYTE GPRS_SetSmsService(UBYTE service); /* MMI functionality */ int GPRS_MenuAttach(MfwMnu* m, MfwMnuItem* i); int GPRS_MenuDetach(MfwMnu* m, MfwMnuItem* i); int GPRS_MenuIncomingDataCount(MfwMnu* m, MfwMnuItem* i); int GPRS_MenuOutgoingDataCount(MfwMnu* m, MfwMnuItem* i); int GPRS_MenuSelectSms(MfwMnu* menu, MfwMnuItem* item); int GPRS_MenuSelectSms_set(MfwMnu* menu, MfwMnuItem* item); /******************************************************************************* LOCAL DATA TYPES *******************************************************************************/ #define ULONG_SIZE_IN_DECIMAL 10 /* Max no. of decimal digits a ULONG can have */ #define KILOBYTE 1024 /* No of bytes in a kilobyte, used for data counter calculation. */ #define PLEASEWAIT_TIMEOUT 35000 /* Time for "please wait" window to time out */ /* Counter types */ typedef enum { MMI_GPRS_COUNTER_UPLINK, MMI_GPRS_COUNTER_DOWNLINK } T_MMI_GPRS_COUNTER; /* GPRS data */ typedef struct { T_MFW_HND mfw_gprs; /* Provide a handle to the GPRS information. */ UBYTE cid; /* The context id. Starts at 1 then increments. */ UBYTE reg_status; /* Registration status */ MfwHnd pleasewait_win; /* Handle for the Please Wait window */ MfwHnd edit_win; /* Handle for editor window */ MfwHnd menu_win; /* Handler for menu windows */ char *counterstring; /* String for counter digits */ ULONG uplink_counter; /* Value of uplink counter */ ULONG downlink_counter; /* Value of downlink counter */ USHORT counter_type; /* TRUE if uplink counter has been requested */ UBYTE sms_service; /* Type of SMS service */ BOOL display; /* Whether to display "OK" windows or not */ USHORT status; /* Current status */ T_MFW_HND notify_win; /* Window to which to send notification */ T_GPRS_CB callback; /* MMI provided callback function */ } T_MMI_GPRS_DATA; /******************************************************************************* LOCAL FUNCTION PROTOTYPES *******************************************************************************/ static T_MFW_HND GPRS_PleaseWait(T_MFW_HND parent_win, USHORT TextId1, USHORT TextId2); static void GPRS_PleaseWaitCb(T_MFW_HND win, UBYTE identifier, UBYTE reason); static void GPRS_PleaseWaitDestroy(void); static void GPRS_ShowCounter(T_MFW_HND win); static void GPRS_ShowCounterCb(T_MFW_HND win, USHORT identifier, USHORT reason); static void GPRS_ResetCounter(T_MFW_HND win, UBYTE identifier, UBYTE reason); static void GPRS_DestroyCounter(void); static void GPRS_UpdateCounter(void); static int GPRS_MfwCb(T_MFW_EVENT event, void* para); #endif