summaryrefslogtreecommitdiffabout
path: root/gammu/emb/common/service/gsmnet.h
Unidiff
Diffstat (limited to 'gammu/emb/common/service/gsmnet.h') (more/less context) (ignore whitespace changes)
-rw-r--r--gammu/emb/common/service/gsmnet.h98
1 files changed, 98 insertions, 0 deletions
diff --git a/gammu/emb/common/service/gsmnet.h b/gammu/emb/common/service/gsmnet.h
new file mode 100644
index 0000000..aaea22f
--- a/dev/null
+++ b/gammu/emb/common/service/gsmnet.h
@@ -0,0 +1,98 @@
1/* (c) 2002-2003 by Marcin Wiacek & Michal Cihar */
2
3#ifndef __gsm_net_h
4#define __gsm_net_h
5
6/**
7 * Find network name from given network code.
8 */
9char *GSM_GetNetworkName(char *NetworkCode);
10
11/**
12 * Find country name from given country code.
13 */
14char *GSM_GetCountryName(char *CountryCode);
15
16/**
17 * Status of network logging
18 */
19typedef enum {
20 /**
21 * Home network for used SIM card.
22 */
23 GSM_HomeNetwork = 1,
24 /**
25 * No network available for used SIM card.
26 */
27 GSM_NoNetwork,
28 /**
29 * SIM card uses roaming.
30 */
31 GSM_RoamingNetwork,
32 /**
33 * Network registration denied - card blocked or expired or disabled.
34 */
35 GSM_RegistrationDenied,
36 /**
37 * Unknown network status.
38 */
39 GSM_NetworkStatusUnknown,
40 /**
41 * Network explicitely requested by user.
42 */
43 GSM_RequestingNetwork
44} GSM_NetworkInfo_State;
45
46/**
47 * Structure for getting the current network info.
48 */
49typedef struct {
50 /**
51 * Cell ID (CID)
52 */
53 unsigned char CID[10];
54 /**
55 * GSM network code.
56 */
57 char NetworkCode[10];
58 /**
59 * Status of network logging. If phone is not logged into any network,
60 * some values are not filled
61 */
62 GSM_NetworkInfo_State State;
63 /**
64 * LAC (Local Area Code).
65 */
66 unsigned char LAC[10];
67 /**
68 * Name of current network like returned from phone (or empty).
69 */
70 unsigned char NetworkName[15*2];
71} GSM_NetworkInfo;
72
73void NOKIA_EncodeNetworkCode (unsigned char* buffer, unsigned char* output);
74void NOKIA_DecodeNetworkCode (unsigned char* buffer, unsigned char* output);
75
76/**
77 * Information about signal quality, all these should be -1 when unknown.
78 */
79typedef struct {
80 /*
81 * Signal strength in dBm
82 */
83 int SignalStrength;
84 /**
85 * Signal strength in percent.
86 */
87 int SignalPercent;
88 /**
89 * Bit error rate in percent.
90 */
91 int BitErrorRate;
92} GSM_SignalQuality;
93
94#endif
95
96/* How should editor hadle tabs in this file? Add editor commands here.
97 * vim: noexpandtab sw=8 ts=8 sts=8:
98 */