Gammu API  1.38.0
Memory

Data Structures

struct  GSM_MemoryStatus
 
struct  GSM_SubMemoryEntry
 
struct  GSM_MemoryEntry
 
struct  GSM_SpeedDial
 

Macros

#define GSM_MemoryTypeToString(x)
 

Enumerations

enum  GSM_MemoryType {
  MEM_ME = 1, MEM_SM, MEM_ON, MEM_DC,
  MEM_RC, MEM_MC, MEM_MT, MEM_FD,
  MEM_VM, MEM_SL, MEM_QD, MEM_INVALID
}
 
enum  GSM_EntryType {
  PBK_Number_General = 1, PBK_Number_Mobile, PBK_Number_Fax, PBK_Number_Pager,
  PBK_Number_Other, PBK_Text_Note, PBK_Text_Postal, PBK_Text_Email,
  PBK_Text_Email2, PBK_Text_URL, PBK_Date, PBK_Caller_Group,
  PBK_Text_Name, PBK_Text_LastName, PBK_Text_FirstName, PBK_Text_Company,
  PBK_Text_JobTitle, PBK_Category, PBK_Private, PBK_Text_StreetAddress,
  PBK_Text_City, PBK_Text_State, PBK_Text_Zip, PBK_Text_Country,
  PBK_Text_Custom1, PBK_Text_Custom2, PBK_Text_Custom3, PBK_Text_Custom4,
  PBK_RingtoneID, PBK_PictureID, PBK_Text_UserID, PBK_CallLength,
  PBK_Text_LUID, PBK_LastModified, PBK_Text_NickName, PBK_Text_FormalName,
  PBK_Text_PictureName, PBK_PushToTalkID, PBK_Number_Messaging, PBK_Photo,
  PBK_Text_SecondName, PBK_Text_VOIP, PBK_Text_SIP, PBK_Text_DTMF,
  PBK_Number_Video, PBK_Text_SWIS, PBK_Text_WVID, PBK_Text_NamePrefix,
  PBK_Text_NameSuffix
}
 
enum  GSM_EntryLocation { PBK_Location_Unknown = 0, PBK_Location_Home, PBK_Location_Work }
 
enum  GSM_VCardVersion {
  Nokia_VCard10 = 1, Nokia_VCard21, SonyEricsson_VCard10, SonyEricsson_VCard21,
  SonyEricsson_VCard21_Phone
}
 

Functions

GSM_Error GSM_GetMemoryStatus (GSM_StateMachine *s, GSM_MemoryStatus *status)
 
GSM_Error GSM_GetMemory (GSM_StateMachine *s, GSM_MemoryEntry *entry)
 
GSM_Error GSM_GetNextMemory (GSM_StateMachine *s, GSM_MemoryEntry *entry, gboolean start)
 
GSM_Error GSM_SetMemory (GSM_StateMachine *s, GSM_MemoryEntry *entry)
 
GSM_Error GSM_AddMemory (GSM_StateMachine *s, GSM_MemoryEntry *entry)
 
GSM_Error GSM_DeleteMemory (GSM_StateMachine *s, GSM_MemoryEntry *entry)
 
GSM_Error GSM_DeleteAllMemory (GSM_StateMachine *s, GSM_MemoryType MemoryType)
 
GSM_Error GSM_GetSpeedDial (GSM_StateMachine *s, GSM_SpeedDial *Speed)
 
GSM_Error GSM_SetSpeedDial (GSM_StateMachine *s, GSM_SpeedDial *Speed)
 
unsigned char * GSM_PhonebookGetEntryName (const GSM_MemoryEntry *entry)
 
void GSM_PhonebookFindDefaultNameNumberGroup (const GSM_MemoryEntry *entry, int *Name, int *Number, int *Group)
 
GSM_Error GSM_EncodeVCARD (GSM_Debug_Info *di, char *Buffer, const size_t buff_len, size_t *Pos, GSM_MemoryEntry *pbk, const gboolean header, const GSM_VCardVersion Version)
 
GSM_Error GSM_DecodeVCARD (GSM_Debug_Info *di, char *Buffer, size_t *Pos, GSM_MemoryEntry *Pbk, const GSM_VCardVersion Version)
 

Detailed Description

Memory entries manipulations.

Macro Definition Documentation

§ GSM_MemoryTypeToString

#define GSM_MemoryTypeToString (   x)
Value:
((x) == MEM_ME ? "ME" : \
((x) == MEM_SM ? "SM" : \
((x) == MEM_ON ? "ON" : \
((x) == MEM_DC ? "DC" : \
((x) == MEM_RC ? "RC" : \
((x) == MEM_MC ? "MC" : \
((x) == MEM_MT ? "MT" : \
((x) == MEM_FD ? "FD" : \
((x) == MEM_VM ? "VM" : \
((x) == MEM_QD ? "QD" : \
((x) == MEM_SL ? "SL" : "XX")))))))))))

Returns string representation of a memory type.

Parameters
xMemory type to convert
Returns
Static string.

Definition at line 95 of file gammu-memory.h.

Enumeration Type Documentation

§ GSM_EntryLocation

Location of memory contact.

Enumerator
PBK_Location_Unknown 

No/Unknown location.

PBK_Location_Home 

Home

PBK_Location_Work 

Work

Definition at line 348 of file gammu-memory.h.

§ GSM_EntryType

Type of specific phonebook entry. In parenthesis is specified in which member of GSM_SubMemoryEntry value is stored.

Enumerator
PBK_Number_General 

General number. (Text)

PBK_Number_Mobile 

Mobile number. (Text)

PBK_Number_Fax 

Fax number. (Text)

PBK_Number_Pager 

Pager number. (Text)

PBK_Number_Other 

Other number. (Text)

PBK_Text_Note 

Note. (Text)

PBK_Text_Postal 

Complete postal address. (Text)

PBK_Text_Email 

Email. (Text)

PBK_Text_Email2 
PBK_Text_URL 

URL (Text)

PBK_Date 

Date and time of last call. (Date)

PBK_Caller_Group 

Caller group. (Number)

PBK_Text_Name 

Name (Text)

PBK_Text_LastName 

Last name. (Text)

PBK_Text_FirstName 

First name. (Text)

PBK_Text_Company 

Company. (Text)

PBK_Text_JobTitle 

Job title. (Text)

PBK_Category 

Category. (Number, if -1 then text)

PBK_Private 

Whether entry is private. (Number)

PBK_Text_StreetAddress 

Street address. (Text)

PBK_Text_City 

City. (Text)

PBK_Text_State 

State. (Text)

PBK_Text_Zip 

Zip code. (Text)

PBK_Text_Country 

Country. (Text)

PBK_Text_Custom1 

Custom information 1. (Text)

PBK_Text_Custom2 

Custom information 2. (Text)

PBK_Text_Custom3 

Custom information 3. (Text)

PBK_Text_Custom4 

Custom information 4. (Text)

PBK_RingtoneID 

Ringtone ID. (Number)

PBK_PictureID 

Picture ID. (Number)

PBK_Text_UserID 

User ID. (Text)

PBK_CallLength 

Length of call (Number)

PBK_Text_LUID 

LUID - Unique Identifier used for synchronisation (Text)

PBK_LastModified 

Date of last modification (Date)

PBK_Text_NickName 

Nick name (Text)

PBK_Text_FormalName 

Formal name (Text)

PBK_Text_PictureName 

Picture name (on phone filesystem). (Text)

PBK_PushToTalkID 

Push-to-talk ID (Text)

PBK_Number_Messaging 

Favorite messaging number. (Text)

PBK_Photo 

Photo (Picture).

PBK_Text_SecondName 

Second name. (Text)

PBK_Text_VOIP 

VOIP address (Text).

PBK_Text_SIP 

SIP address (Text).

PBK_Text_DTMF 

DTMF (Text).

PBK_Number_Video 

Video number. (Text)

PBK_Text_SWIS 

See What I See address. (Text)

PBK_Text_WVID 

Wireless Village user ID. (Text)

PBK_Text_NamePrefix 

Name prefix (Text)

PBK_Text_NameSuffix 

Name suffix (Text)

Definition at line 144 of file gammu-memory.h.

144  {
148  PBK_Number_General = 1,
177  /*
178  * Second email. (Text)
179  */
184  PBK_Text_URL,
188  PBK_Date,
216  PBK_Category,
220  PBK_Private,
236  PBK_Text_Zip,
304  PBK_Photo,
316  PBK_Text_SIP,
341 } GSM_EntryType;
GSM_EntryType
Definition: gammu-memory.h:144

§ GSM_MemoryType

Enum defines ID for various phone and SIM memories. Phone modules can translate them to values specific for concrete models. Two letter codes (excluding VM and SL) are from GSM 07.07.

Enumerator
MEM_ME 

Internal memory of the mobile equipment

MEM_SM 

SIM card memory

MEM_ON 

Own numbers

MEM_DC 

Dialled calls

MEM_RC 

Received calls

MEM_MC 

Missed calls

MEM_MT 

Combined ME and SIM phonebook

MEM_FD 

Fixed dial

MEM_VM 

Voice mailbox

MEM_SL 

Sent SMS logs

MEM_QD 

Quick dialing choices.

MEM_INVALID 

Invalid memory type.

Definition at line 31 of file gammu-memory.h.

31  {
35  MEM_ME = 1,
39  MEM_SM,
43  MEM_ON,
47  MEM_DC,
51  MEM_RC,
55  MEM_MC,
59  MEM_MT,
63  MEM_FD,
64 
68  MEM_VM,
69 
73  MEM_SL,
74 
78  MEM_QD,
79 
GSM_MemoryType
Definition: gammu-memory.h:31

§ GSM_VCardVersion

Types of vCard.

Enumerator
Nokia_VCard10 

vCard 1.0 hacked for Nokia.

Nokia_VCard21 

vCard 2.1 hacked for Nokia.

SonyEricsson_VCard10 

vCard 1.0 hacked for Sony-Ericsson (should be standard vCard).

SonyEricsson_VCard21 

vCard 2.1 hacked for Sony-Ericsson (should be standard vCard).

SonyEricsson_VCard21_Phone 

vCard 2.1 hacked for Sony-Ericsson (should be standard vCard) from phone (no parsing of location and memory type).

Definition at line 602 of file gammu-memory.h.

Function Documentation

§ GSM_AddMemory()

GSM_Error GSM_AddMemory ( GSM_StateMachine s,
GSM_MemoryEntry entry 
)

Adds memory (phonebooks or calls) entry.

Parameters
sState machine pointer.
entryEntry to add, Location is ignored, MemoryType has to be set.
Returns
Error code.

§ GSM_DecodeVCARD()

GSM_Error GSM_DecodeVCARD ( GSM_Debug_Info di,
char *  Buffer,
size_t *  Pos,
GSM_MemoryEntry Pbk,
const GSM_VCardVersion  Version 
)

Decodes memory entry from vCard.

Parameters
diPointer to debugging description.
[in]BufferBuffer to readCard text.
[in,out]PosPosition in output buffer.
[out]PbkPhonebook data read from vCard.
[in]VersionWhat vCard version to parse.
Returns
Error code.

§ GSM_DeleteAllMemory()

GSM_Error GSM_DeleteAllMemory ( GSM_StateMachine s,
GSM_MemoryType  MemoryType 
)

Deletes all memory (phonebooks or calls) entries of specified type.

Parameters
sState machine pointer.
MemoryTypeWhere to delete all entries.
Returns
Error code.

§ GSM_DeleteMemory()

GSM_Error GSM_DeleteMemory ( GSM_StateMachine s,
GSM_MemoryEntry entry 
)

Deletes memory (phonebooks or calls) entry.

Parameters
sState machine pointer.
entryEntry to delete, Location and MemoryType has to be set.
Returns
Error code.

§ GSM_EncodeVCARD()

GSM_Error GSM_EncodeVCARD ( GSM_Debug_Info di,
char *  Buffer,
const size_t  buff_len,
size_t *  Pos,
GSM_MemoryEntry pbk,
const gboolean  header,
const GSM_VCardVersion  Version 
)

Encodes memory entry to vCard.

Parameters
diPointer to debugging description.
[out]BufferBuffer to store vCard text.
[in]buff_lenSize of output buffer.
[in,out]PosPosition in output buffer.
[in,out]pbkPhonebook data, AddError will be set on non converted entries.
[in]headerWhether to include vCard header in output.
[in]VersionWhat vCard version to create.
Returns
Error code.

§ GSM_GetMemory()

GSM_Error GSM_GetMemory ( GSM_StateMachine s,
GSM_MemoryEntry entry 
)

Reads entry from memory (phonebooks or calls). Which entry should be read is defined in entry.

Parameters
sState machine pointer.
entryStorage for retrieved entry, MemoryType and Location has to be set.
Returns
Error code.

§ GSM_GetMemoryStatus()

GSM_Error GSM_GetMemoryStatus ( GSM_StateMachine s,
GSM_MemoryStatus status 
)

Gets memory (phonebooks or calls) status (eg. number of used and free entries).

Parameters
sState machine pointer.
statusStorage for status information, MemoryType has to be set.
Returns
Error code.

§ GSM_GetNextMemory()

GSM_Error GSM_GetNextMemory ( GSM_StateMachine s,
GSM_MemoryEntry entry,
gboolean  start 
)

Reads entry from memory (phonebooks or calls). Which entry should be read is defined in entry. This can be easily used for reading all entries.

Parameters
sState machine pointer.
entryStorage for retrieved entry. MemoryType has to be set for first call (with start set to TRUE), for subsequent calls Location has to stay intact from previous reading.
startWhether we should start from beginning.
Returns
Error code.

§ GSM_GetSpeedDial()

GSM_Error GSM_GetSpeedDial ( GSM_StateMachine s,
GSM_SpeedDial Speed 
)

Gets speed dial.

Parameters
sState machine pointer.
SpeedStorage for speed dial, Location has to be set.
Returns
Error code.

§ GSM_PhonebookFindDefaultNameNumberGroup()

void GSM_PhonebookFindDefaultNameNumberGroup ( const GSM_MemoryEntry entry,
int *  Name,
int *  Number,
int *  Group 
)

Finds default name, number and group for entry.

Parameters
entryEntry to process.
NameOutput index of name.
NumberOutput index of number.
GroupOutput index of group.

§ GSM_PhonebookGetEntryName()

unsigned char* GSM_PhonebookGetEntryName ( const GSM_MemoryEntry entry)

Returns name of entry. It might be possibly concatenated from first and last names.

Parameters
entryEntry to process.
Returns
Static unicode string containing name.

§ GSM_SetMemory()

GSM_Error GSM_SetMemory ( GSM_StateMachine s,
GSM_MemoryEntry entry 
)

Sets memory (phonebooks or calls) entry.

Parameters
sState machine pointer.
entryEntry to set, Location and MemoryType has to be set.
Returns
Error code.

§ GSM_SetSpeedDial()

GSM_Error GSM_SetSpeedDial ( GSM_StateMachine s,
GSM_SpeedDial Speed 
)

Sets speed dial.

Parameters
sState machine pointer.
SpeedSspeed dial to set.
Returns
Error code.