Tue 15 Feb 2011 02:05:20 PM UTC, comment #4:
from your response i've concluded that
--------------------
the question about :
"cost some resources"
and the answer is :
"You just need to loop over the set of 20 elements and 'just for one to call the GetSMSFolderStatus'. I consider "some resources" as close enough to 0. "
---------------------
---------------------
and for question :
"'combining number of sms' and wrap it"
answer :
"Probably these two could be combined into one API call which would act as the wrapper. But I do not see big benefit. Usually when you want the status of the folder you want it for all the folders. "
---------------------
thx, case closed :)
|
Tue 15 Feb 2011 01:50:16 PM UTC, comment #3:
> the required parameter :
> - memory type ( GN_MT_SM for example )
> then calling gn_sm_functions(GN_OP_NEWFEATURE,data,state)
> which supposed to generate :
Memory type is an abstraction. We need to ask the phone how given memory type maps to the actual folder ID. You do it by GetSMSFolders.
> - the number of sms inside 'memory type',
> which has been set ( in these example case 'GN_MT_SM' ),
> without 're-loop' for existence of all
> memory(which will cost some resources)
You just need to loop over the set of 20 elements and just for one to call the GetSMSFolderStatus. I consider "some resources" as close enough to 0.
Probably these two could be combined into one API call which would act as the wrapper. But I do not see big benefit. Usually when you want the status of the folder you want it for all the folders.
> - show sms info, `info` mean ( id, msg, date, etc like
> you wrote on gn_sms structure ), which this info come
> from the `memory type` which has been set before.
Which SMS? There can be thousands of them in the given memory type.
|
Tue 15 Feb 2011 01:34:56 PM UTC, comment #2:
im apologizing for bad language, coz im not speak english native though,
here are behave of the feature request,
the required parameter :
- memory type ( GN_MT_SM for example )
then calling gn_sm_functions(GN_OP_NEWFEATURE,data,state) which supposed to generate :
- the number of sms inside 'memory type', which has been set ( in these example case 'GN_MT_SM' ), without 're-loop' for existence of all memory(which will cost some resources)
- show sms info, `info` mean ( id, msg, date, etc like you wrote on gn_sms structure ), which this info come from the `memory type` which has been set before.
you could questioning for any typos that might make any confuse..
|
Tue 15 Feb 2011 12:27:10 PM UTC, original submission:
hi,
i had difficulties when tryin gettin number based on MEMORY_TYPE, after i conduct thoroughly investigation around file gnokii-sms.c
i found these :
function getsms()
{
..
e = gn_sm_functions(GN_OP_GetSMSFolders, data, state);
if (e == GN_ERR_NONE) {
for (j = 0; j < folderlist.number; j++) {
data->sms_folder = folderlist.folder + j;
if (folderlist.folder_id[j] == gn_str2memory_type(memory_type_string)) {
e = gn_sm_functions(GN_OP_GetSMSFolderStatus, data, state);
if (e == GN_ERR_NONE) {
folder_count = folderlist.folder[j].number;
dprintf("Folder %s (%s) has %u messages\n", folderlist.folder[j].name, gn_memory_type2str(folderlist.folder_id[j]), folderlist.folder[j].number);
}
}
}
}
....
}
which i thought it based number of sum all memory and re-parse the fit MEMORY_TYPE_STRING, and show the information,
i just curious, is there no other way ?, i thought, this might cost much resources for the loop of looking 'what kind memory that the phone had'.
is there another way like this algorithm :
1. set memory type // thus, the phone only will fetch data inside from 'set' memory
2. show counted number
3. sms and it own structure{id,msg,blablabla}
or perhaps this feature isnt yet exists ?
thank in advance :)
|