📄 common.h
字号:
/* $Id: common.h,v 1.133 2004/02/20 11:02:25 uid66849 Exp $ G N O K I I A Linux/Unix toolset and driver for Nokia mobile phones. This file is part of gnokii. Gnokii is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Gnokii is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with gnokii; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Copyright (C) 1999, 2000 Hugh Blemings & Pavel Jan韐 ml. Header file for the definitions, enums etc. that are used by all models of handset.*/#ifndef _gnokii_common_h#define _gnokii_common_h#include <gnokii/rlp-common.h>/* Type of connection. Now we support serial connection with FBUS cable and IR (only with 61x0 models) */typedef enum { GN_CT_Serial, /* Serial connection. */ GN_CT_DAU9P, /* Serial connection using DAU9P cable; use only with 6210/7110 if you want faster initialization */ GN_CT_DLR3P, /* Serial connection using DLR3P cable */ GN_CT_Infrared, /* Infrared connection. */ GN_CT_Irda, /* Linux IrDA support */ GN_CT_Bluetooth,/* Linux Bluetooth support */ GN_CT_Tekram, /* Tekram Ir-Dongle */ GN_CT_TCP, /* TCP network connection */ GN_CT_M2BUS /* Serial connection with M2BUS protocol */} gn_connection_type;/* Maximum length of device name for serial port */#define GN_DEVICE_NAME_MAX_LENGTH (32)/* Define an enum for specifying memory types for retrieving phonebook entries, SMS messages etc. This type is not mobile specific - the model code should take care of translation to mobile specific numbers - see 6110 code. 01/07/99: Two letter codes follow GSM 07.07 release 6.2.0*/typedef enum { GN_MT_ME, /* Internal memory of the mobile equipment */ GN_MT_SM, /* SIM card memory */ GN_MT_FD, /* Fixed dial numbers */ GN_MT_ON, /* Own numbers */ GN_MT_EN, /* Emergency numbers */ GN_MT_DC, /* Dialled numbers */ GN_MT_RC, /* Received numbers */ GN_MT_MC, /* Missed numbers */ GN_MT_LD, /* Last dialed */ GN_MT_MT, /* combined ME and SIM phonebook */ GN_MT_TA, /* for compatibility only: TA=computer memory */ GN_MT_CB, /* Currently selected memory */ GN_MT_IN, /* Inbox for folder aware phones */ GN_MT_OU, /* Outbox */ GN_MT_AR, /* Archive */ GN_MT_TE, /* Templates */ GN_MT_F1, /* 1st CUSTOM FOLDER */ GN_MT_F2, GN_MT_F3, GN_MT_F4, GN_MT_F5, GN_MT_F6, GN_MT_F7, GN_MT_F8, GN_MT_F9, GN_MT_F10, GN_MT_F11, GN_MT_F12, GN_MT_F13, GN_MT_F14, GN_MT_F15, GN_MT_F16, GN_MT_F17, GN_MT_F18, GN_MT_F19, GN_MT_F20, /* 20th CUSTOM FOLDER */ GN_MT_XX = 0xff /* Error code for unknown memory type (returned by fbus-xxxx functions). */} gn_memory_type;/* Power source types */typedef enum { GN_PS_ACDC = 1, /* AC/DC powered (charging) */ GN_PS_BATTERY /* Internal battery */} gn_power_source;/* Definition of security codes. */typedef enum { GN_SCT_SecurityCode = 0x01, /* Security code. */ GN_SCT_Pin, /* PIN. */ GN_SCT_Pin2, /* PIN 2. */ GN_SCT_Puk, /* PUK. */ GN_SCT_Puk2, /* PUK 2. */ GN_SCT_None /* Code not needed. */} gn_security_code_type;/* Security code definition. */typedef struct { gn_security_code_type type; /* Type of the code. */ char code[10]; /* Actual code. */ char new_code[10]; /* New code. */} gn_security_code;/* This structure is used to get the current network status */typedef struct { char network_code[10]; /* GSM network code */ unsigned char cell_id[10]; /* CellID */ unsigned char LAC[10]; /* LAC */} gn_network_info;/* Limits for sizing of array in gn_phonebook_entry. Individual handsets may not support these lengths so they have their own limits set. */#define GN_PHONEBOOK_NAME_MAX_LENGTH 61 /* For 6510 */#define GN_PHONEBOOK_NUMBER_MAX_LENGTH 49 /* For 6510 */#define GN_PHONEBOOK_SUBENTRIES_MAX_NUMBER 10 /* For 6510 */ /* 7110 is able to have in one * entry 5 numbers and 4 * texts [email,notice,postal,url] */#define GN_PHONEBOOK_CALLER_GROUPS_MAX_NUMBER 5#define GN_PHONEBOOK_ENTRY_MAX_LENGTH 1024/* This data type is used to report the number of used and free positions in memory (sim or internal). */typedef struct { gn_memory_type memory_type; /* Type of the memory */ int used; /* Number of used positions */ int free; /* Number of free positions */} gn_memory_status;/* General date and time structure. It is used for the SMS, calendar, alarm * settings, clock etc. */typedef struct { int year; /* The complete year specification - e.g. 1999. Y2K :-) */ int month; /* January = 1 */ int day; int hour; int minute; int second; int timezone; /* The difference between local time and GMT. Note that different SMSC software treat this field in the different ways. */} gn_timestamp;/* Some phones (at the moment 7110/6510 series) supports extended phonebook with additional data. Here we have structures for them */typedef enum { GN_PHONEBOOK_NUMBER_Home = 0x02, GN_PHONEBOOK_NUMBER_Mobile = 0x03, GN_PHONEBOOK_NUMBER_Fax = 0x04, GN_PHONEBOOK_NUMBER_Work = 0x06, GN_PHONEBOOK_NUMBER_General = 0x0a,} gn_phonebook_number_type;typedef enum { GN_PHONEBOOK_ENTRY_Name = 0x07, GN_PHONEBOOK_ENTRY_Email = 0x08, GN_PHONEBOOK_ENTRY_Postal = 0x09, GN_PHONEBOOK_ENTRY_Note = 0x0a, GN_PHONEBOOK_ENTRY_Number = 0x0b, GN_PHONEBOOK_ENTRY_Ringtone = 0x0c, GN_PHONEBOOK_ENTRY_Date = 0x13, /* Date is used for DC,RC,etc (last calls) */ GN_PHONEBOOK_ENTRY_Pointer = 0x1a, /* Pointer to the other memory */ GN_PHONEBOOK_ENTRY_Logo = 0x1b, GN_PHONEBOOK_ENTRY_LogoSwitch = 0x1c, GN_PHONEBOOK_ENTRY_Group = 0x1e, GN_PHONEBOOK_ENTRY_URL = 0x2c,} gn_phonebook_entry_type;typedef struct { gn_phonebook_entry_type entry_type; gn_phonebook_number_type number_type; union { char number[GN_PHONEBOOK_NAME_MAX_LENGTH + 1]; /* Number, Name, Address, eMail... */ gn_timestamp date; /* or the last calls list */ } data; int id;} gn_phonebook_subentry;/* Define datatype for phonebook entry, used for getting/writing phonebook entries. */typedef struct { int empty; /* Is this entry empty? */ char name[GN_PHONEBOOK_NAME_MAX_LENGTH + 1]; /* Plus 1 for nullterminator. */ char number[GN_PHONEBOOK_NUMBER_MAX_LENGTH + 1]; /* Number */ gn_memory_type memory_type; /* Type of memory */ int caller_group; /* Caller group */ int location; /* Location */ gn_timestamp date; /* The record date and time of the number. */ gn_phonebook_subentry subentries[GN_PHONEBOOK_SUBENTRIES_MAX_NUMBER]; /* For phones with * additional phonebook * entries */ int subentries_count; /* Should be set to 0, if extended phonebook is not used */} gn_phonebook_entry;/* This define speed dialing entries. */typedef struct { int number; /* Which number is used to dialing? */ gn_memory_type memory_type; /* Memory type of the number. */ int location; /* Location of the number in MemoryType. */} gn_speed_dial;/* Define enum used to describe what sort of date/time support is available. */typedef enum { GN_DT_None, /* The mobile phone doesn't support time and date. */ GN_DT_TimeOnly, /* The mobile phone supports only time. */ GN_DT_DateOnly, /* The mobile phone supports only date. */ GN_DT_DateTime /* Wonderful phone - it supports date and time. */} gn_datetime_support;/* Define enums for RF units. GRF_CSQ asks for units in form used in AT+CSQ command as defined by GSM 07.07 */typedef enum { GN_RF_Arbitrary, GN_RF_dBm, GN_RF_mV, GN_RF_uV, GN_RF_CSQ, GN_RF_Percentage} gn_rf_unit;/* Define enums for Battery units. */typedef enum { GN_BU_Arbitrary, GN_BU_Volts, GN_BU_Minutes, GN_BU_Percentage} gn_battery_unit;/* Define enums for Calendar Note types */typedef enum { GN_CALNOTE_MEETING = 0x01, /* Meeting */ GN_CALNOTE_CALL = 0x02, /* Call */ GN_CALNOTE_BIRTHDAY = 0x04, /* Birthday */ GN_CALNOTE_REMINDER = 0x08, /* Reminder */} gn_calnote_type;typedef enum { GN_CALNOTE_NEVER = 0, GN_CALNOTE_DAILY = 24, GN_CALNOTE_WEEKLY = 168, GN_CALNOTE_2WEEKLY = 336, GN_CALNOTE_MONTHLY = 65534, GN_CALNOTE_YEARLY = 65535} gn_calnote_recurrence;#define GN_CALNOTE_MAX_NUMBER 1024 /* FIXME how many are possible? */#define GN_CALNOTE_MAX_LENGTH 258#define GN_CALNOTE_NUMBER_MAX_LENGTH 49typedef struct { int enabled; /* Is alarm set ? */ gn_timestamp timestamp;} gn_calnote_alarm;/* Calendar note type */typedef struct { int location; /* The number of the note in the phone memory */ gn_calnote_type type; /* The type of the note */ gn_timestamp time; /* The time of the note */ gn_calnote_alarm alarm; /* The alarm of the note */ char text[GN_CALNOTE_MAX_LENGTH]; /* The text of the note */ char phone_number[GN_CALNOTE_NUMBER_MAX_LENGTH]; /* For Call only: the phone number */ gn_calnote_recurrence recurrence; /* Recurrence of the note */} gn_calnote;/* List of Calendar Notes in phone */typedef struct { unsigned int number; /* The number of notes in phone */ unsigned int location[GN_CALNOTE_MAX_NUMBER]; /* Location of the nth note */ unsigned int last; /* Index of the last allocated note */} gn_calnote_list;/* ToDo things. It is only supported by the newer phones. */#define GN_TODO_MAX_LENGTH 256#define GN_TODO_MAX_NUMBER 512typedef enum { GN_TODO_LOW = 3, GN_TODO_MEDIUM = 2, GN_TODO_HIGH = 1} gn_todo_priority;typedef struct { int location; /* The number of the note in the phone memory */ char text[GN_TODO_MAX_LENGTH]; /* The text of the note */ gn_todo_priority priority;} gn_todo;/* List of ToDo Notes in phone */typedef struct { int number; /* The number of notes in phone */ int location[GN_TODO_MAX_NUMBER]; /* Location of the nth note */} gn_todo_list;/* WAP */#define WAP_URL_MAX_LENGTH 258#define WAP_NAME_MAX_LENGTH 52#define WAP_SETTING_USERNAME_MAX_LENGTH 34#define WAP_SETTING_NAME_MAX_LENGTH 22#define WAP_SETTING_HOME_MAX_LENGTH 95#define WAP_SETTING_APN_MAX_LENGTH 102/* bookmarks */typedef struct { int location; char name[WAP_NAME_MAX_LENGTH]; char URL[WAP_URL_MAX_LENGTH];} gn_wap_bookmark;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -