This commit was generated by cvs2svn to compensate for changes in r164,
[gnokii.git] / mgnetd / mg_demo_client / mg_net_api.txt
1 mg_net_api
2 a simple network api for (my)gnokii
3
4 (have also a look at demo-prg:
5  mg_demo_client.c)
6
7 You need latest mygnokii-tarball, look at:
8 Marcin Wiacek -> mailto:marcin-wiacek@topnet.pl
9 http://marcin-wiacek.topnet.pl (http://marcin-wiacek.fkn.pl/) -> netmonitor,
10 firmware, mygnokii (GSM & Nokia)
11 http://www.mds.mdh.se/~cel95eig/mygnokii/ &
12 http://grumble.zereau.com/gnokii/ & http://reinhold.bachrain.de/ -> mygnokii
13 mirrors
14
15 - install mygnokii
16 - customize .gnokii.rc (at least gnokii --identify should run)
17 - run udp network daeon with: mgnetd <password>
18
19 --------------------------------------------------------------------------------
20
21
22
23 Version 0.3
24
25 All functions return a negative value if there is an error.
26
27 --------------------------------------------------------------------------------
28
29 int mg_init(char *hostname, char *passwd);
30 char *hostname - Hostname or IP-Address of Server with running mygnokii server.
31                  (could be 'localhost' if mygnokii runs on same machine)
32 char *passwd - password of running mygnokii server
33
34 This function MUST be called first in your program.
35
36 --------------------------------------------------------------------------------
37
38 int mg_exit(void);
39
40 Kill the running mygnokii server
41
42 --------------------------------------------------------------------------------
43
44 int mg_version(MG_rq_version *version);
45 typedef struct {
46         int major;
47         int minor;
48 } MG_rq_version;
49
50 Get versioninformation from running mygnokii server
51
52 --------------------------------------------------------------------------------
53
54 int mg_identify(MG_rq_identify *ident);
55 typedef struct {
56         char imei[64];
57         char model[64];
58         char rev[64];
59 } MG_rq_identify;
60
61 Get imei, model and revision from phone connected to mygnokii server
62
63 --------------------------------------------------------------------------------
64
65 int mg_memorystatus(MG_rq_memorystatus *stats);
66 typedef struct {
67         char memtype[3];        -> ME for internal phonememory, SM for SIM-Card 
68         int used;               -> free entrys within selected memory 
69         int free;               -> used entrys within selected memory    
70 } MG_rq_memorystatus;
71
72 Get memory status from phone connected to mygnokii server
73
74 --------------------------------------------------------------------------------
75
76 int mg_get_memory_location(MG_rq_phonebook_location *rph);
77 typedef struct {
78         char memtype[3];                -> ME for internal phonememory, SM for SIM-Card
79         int location;                   -> location of entry within selected memory
80         char name[51];
81         char group[49];
82         char nr_general[49];
83         char nr_mobile[49];
84         char nr_work[49];
85         char nr_fax[49];
86         char nr_home[49];
87         char note[51];
88         char postal[51];
89         char email[51];
90 } MG_rq_phonebook_location;
91
92 Get phonebook entry at location-number from phone connected to mygnokii server
93
94 --------------------------------------------------------------------------------
95
96 int mg_write_phonebook_location(MG_rq_phonebook_location *wph);
97 typedef struct {
98         char memtype[3];                -> ME for internal phonememory, SM for SIM-Card
99         int location;                   -> location of entry within selected memory
100         char name[51];
101         char group[49];
102         char nr_general[49];
103         char nr_mobile[49];
104         char nr_work[49];
105         char nr_fax[49];
106         char nr_home[49];
107         char note[51];
108         char postal[51];
109         char email[51];
110 } MG_rq_phonebook_location;
111  
112 Write phonebook entry to location-number from phone connected to mygnokii server
113
114 --------------------------------------------------------------------------------
115
116 int mg_delete_phonebook_location(int location)
117 int location - Location of phonebookentry to delete
118
119 Delete phonebook entry at location-number from phone connected to mygnokii server
120
121 --------------------------------------------------------------------------------
122
123 int mg_send_sms(MG_rq_send_sms *sms);
124 typedef struct {
125         char destination[12];                           /* destination */
126         char message[161];                              /* the message */
127         char SMSCNumber[100];                           /* SMSC number (could be NULL)*/
128         int  SMSCenter;                                 /* SMSC number index in phone memory */
129         int  SMSValidity;                               /* validity of sms eg: 4320 -> 3 days !*/
130         char longsms;                                   /* long messages, NOT USED ! */
131         char enablevoice;                               /* SMS enables voice indicator TRUE/FALSE*/
132         char disablevoice;                              /* SMS disables voice indicator TRUE/FALSE*/
133         char enableemail;                               /* SMS enables email indicator TRUE/FALSE*/
134         char disableemail;                              /* SMS disables email indicator TRUE/FALSE*/
135         char enablefax;                                 /* SMS enables fax indicator TRUE/FALSE*/
136         char disablefax;                                /* SMS disables fax indicator TRUE/FALSE*/
137         char unicode;                                   /* SMS coding type TRUE/FALSE*/
138         char delivery;                                  /* we want delivery report TRUE/FALSE*/
139 } MG_send_sms;
140 Send sms message 'message' to destination at 'destination' via phone connected to mygnokii server
141
142 --------------------------------------------------------------------------------