This commit was manufactured by cvs2svn to create tag 'bp_uc_works1'.
[gnokii.git] / Docs / developers / other / RE RE.txt
1 Do: Markus Plail
2 Temat: RE: RE:
3
4
5 Hi,
6
7 > Sorry for the confusion. I wrote the subject (getsms for 6210) in 
8 > the CC field.
9 No problem :-)
10
11 > So this is what I want to try, in linux btw. U wrote that u can 
12 > give some information on that topic.
13 OK. Good.
14
15 First of all, you HAVE to understand, how/where are created all phone functions. Look into n7110.c for N7110_Functions. This is our structure for each function - getting SMS, etc. You have pointers to each function sending request.
16
17 Example:  N6110_NetMonitor for netmonitor function.
18
19 If each function (let's say N6110_NetMonitor) you send frame for phone:
20 -----------------------------
21   unsigned char req[] = { 0x00, 0x01, 0x7e, 0x00 };
22   
23   GSM_Error error;
24   
25   error=N6110_EnableExtendedCommands(0x01);
26   if (error!=GE_NONE) return error;
27
28   CurrentNetmonitor=Screen;
29
30   req[3]=mode;
31
32   return N6110_SendMessageSequence
33     (20, &CurrentNetmonitorError, 4, 0x40, req);
34 ---------------------------
35 In req you prepare it (see 6110.txt/7110.txt for frame for netmonitor and compare it with req).
36
37 First (this is specific for netmonitor and some other) need to send something, we call EnableExtendedCommands - we must send special frame and wait for answer. And ONLY after it phone will answer with 0x40 frames. For SMS in 6210 it's not required.
38
39 After it we set pointer to structure given by user (pointers are declared in gsm-api.c & gsm-api.h): CurrentNetmonitor=Screen;
40
41 Prepare frame send to phone...
42
43 And use N6110_SendMessageSequence -> first is, how long we can wait for phone answer (20), next: what variable is used to see, if phone answered (I will later describe more - variable created in gsm-api.c & gsm-api.h), how many bytes in req, frame type and req.
44
45 That's all here.
46
47 All answers are handled in N7110_DispatchMessage
48
49 In example look for:
50
51         fprintf(stdout, _("Message: Netmonitor menu %d received:\n"), MessageBuffer[3]);
52
53 You copy formatted answer to structure pointed by CurrentNetmonitor (in example) and set CurrentNetmonitorError to GE_NONE (it makes, that N6110_SendMessageSequence returns: NO error). That's all.
54 --------------------
55 If you understand, let's start:
56
57 1.need to make new N7110_GetSMSFolders similiar to N6110_GetSMSFolders (send frame - it's described in 7110.txt: "Get folder names", wait for answer and return it) and set N7110_Functions to point on it (in line 127).
58
59 After it we will be able to make "real" getsms...
60
61 Any questions ?
62
63 Pozdrowienia/Best Regards
64 --
65 Marcin Wiacek -> mailto:marcinwiacek@topnet.pl http://marcin-wiacek.topnet.pl (http://www.fkn.pl/marcinw) -> netmonitor, firmware, mygnokii (GSM & Nokia)
66 http://www.mds.mdh.se/~cel95eig/mygnokii/ & http://grumble.zereau.com/gnokii/ & http://reinhold.bachrain.de/ -> mygnokii mirrors