This commit was generated by cvs2svn to compensate for changes in r158,
[gnokii.git] / mgnetd / mg_demo_client / mg_net_api.h
1 /*
2
3   ( M Y  )G N O K I I
4
5   A Linux/Unix toolset and driver for Nokia mobile phones.
6
7   MyGnokii NET API
8
9   Version 0.3 Ralf Thelen 07.02.2002
10
11 */
12
13 #ifndef __mg_net_api_h
14 #define __mg_net_api_h
15
16 #define MG_NET_API_MAJOR_VERSION 0
17 #define MG_NET_API_MINOR_VERSION 3
18
19 #define MG_ERROR                (-1)
20 #define MG_ERROR_TIMEOUT        (-1001)
21
22 #define TRUE    1
23 #define FALSE   0
24
25 typedef enum {
26    MG_INIT,
27    MG_EXIT,
28    MG_VERSION,
29    MG_IDENTIFY,
30    MG_MEMORYSTATUS,
31    MG_GET_MEMORY_LOCATION,
32    MG_WRITE_PHONEBOOK_LOCATION,
33    MG_DELETE_PHONEBOOK_LOCATION,
34    MG_SEND_SMS
35 } MG_api_cmd;
36  
37  
38 typedef struct {
39         MG_api_cmd cmd;                 /* requestet command         */
40         char passwd[8];                 /* password for udp requests */
41         char buffer[1024];              /* parameter                 */
42 } MG_api_request;
43
44 typedef struct {
45         int major;
46         int minor;
47 } MG_rq_version;
48
49 typedef struct {
50         char imei[64];
51         char model[64];
52         char rev[64];
53 } MG_rq_identify;
54  
55 typedef struct {
56         char memtype[3];
57         int used;
58         int free;
59 } MG_rq_memorystatus;
60
61 typedef struct {
62         char memtype[3];
63         int location;
64         char name[51];
65         char group[49];
66         char nr_general[49];
67         char nr_mobile[49];
68         char nr_work[49];
69         char nr_fax[49];
70         char nr_home[49];
71         char note[51];
72         char postal[51];
73         char email[51];
74 } MG_rq_phonebook_location;
75
76 typedef struct {
77         char destination[12];                           /* destination */
78         char message[161];                              /* the message */
79         char SMSCNumber[100];                           /* SMSC number */
80         int  SMSCenterIndex;                            /* SMSC number index in phone memory */
81         int  SMSValidity;                               /* validity of sms */
82         char longsms;                                   /* long messages, NOT USED ! */
83         char enablevoice;                               /* SMS enables voice indicator */
84         char disablevoice;                              /* SMS disables voice indicator */
85         char enableemail;                               /* SMS enables email indicator */
86         char disableemail;                              /* SMS disables email indicator */
87         char enablefax;                                 /* SMS enables fax indicator */
88         char disablefax;                                /* SMS disables fax indicator */
89         char unicode;                                   /* SMS coding type */
90         char delivery;                                  /* we want delivery report */
91 } MG_rq_send_sms;
92
93 /* Prototypes */
94 int mg_init(char *hostname, char *passwd);
95 int mg_exit(void);
96 int mg_version(MG_rq_version *version);
97 int mg_identify(MG_rq_identify *ident);
98 int mg_memorystatus(MG_rq_memorystatus *stats);
99 int mg_get_memory_location(MG_rq_phonebook_location *rph);
100 int mg_write_phonebook_location(MG_rq_phonebook_location *wph);
101 int mg_delete_phonebook_location(MG_rq_phonebook_location *dph);
102 int mg_send_sms(MG_rq_send_sms *sms);
103  
104 #endif /* __mg_net_api_h */