SIM900
Loading...
Searching...
No Matches
sim900_defs.h
1/*
2 * This file is part of the SIM900 Arduino Shield library.
3 * Copyright (c) 2023 Nathanne Isip
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a copy
6 * of this software and associated documentation files (the "Software"), to deal
7 * in the Software without restriction, including without limitation the rights
8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 * copies of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 * THE SOFTWARE.
22 */
23
32#ifndef SIM900_DEFS_H
33#define SIM900_DEFS_H
34
44typedef enum _SIM900DialResult {
46 SIM900_DIAL_RESULT_NO_DIALTONE,
47
49 SIM900_DIAL_RESULT_BUSY,
50
52 SIM900_DIAL_RESULT_NO_CARRIER,
53
55 SIM900_DIAL_RESULT_NO_ANSWER,
56
58 SIM900_DIAL_RESULT_ERROR,
59
61 SIM900_DIAL_RESULT_OK
62} SIM900DialResult;
63
73typedef enum _SIM900OperatorFormat {
75 SIM900_OPERATOR_FORMAT_AUTO,
76
78 SIM900_OPERATOR_FORMAT_MANUAL,
79
81 SIM900_OPERATOR_FORMAT_DEREGISTER,
82
84 SIM900_OPERATOR_FORMAT_SET_ONLY,
85
87 SIM900_OPERATOR_FORMAT_MANUAL_AUTO
88} SIM900OperatorFormat;
89
99typedef enum _SIM900OperatorMode {
101 SIM900_OPERATOR_MODE_GSM,
102
104 SIM900_OPERATOR_MODE_GSM_COMPACT,
105
107 SIM900_OPERATOR_MODE_UTRAN,
108
110 SIM900_OPERATOR_MODE_GSM_EGPRS,
111
113 SIM900_OPERATOR_MODE_UTRAN_HSDPA,
114
116 SIM900_OPERATOR_MODE_UTRAN_HSUPA,
117
119 SIM900_OPERATOR_MODE_UTRAN_HSDPA_HSUPA,
120
122 SIM900_OPERATOR_MODE_E_UTRAN
123} SIM900OperatorMode;
124
133typedef enum _SIM900CardService {
135 SIM900_CARD_SERVICE_ASYNC,
136
138 SIM900_CARD_SERVICE_SYNC,
139
141 SIM900_CARD_SERVICE_PAD_ACCESS,
142
144 SIM900_CARD_SERVICE_PACKET,
145
147 SIM900_CARD_SERVICE_VOICE,
148
150 SIM900_CARD_SERVICE_FAX
151} SIM900CardService;
152
162typedef enum _SIM900PhonebookType {
164 SIM900_PHONEBOOK_NATIONAL = 145,
165
167 SIM900_PHONEBOOK_INTERNATIONAL = 129,
168
170 SIM900_PHONEBOOK_UNKNOWN = 0
171} SIM900PhonebookType;
172
181typedef struct _SIM900Operator {
183 SIM900OperatorMode mode;
184
186 SIM900OperatorFormat format;
187
189 String name;
191
200typedef struct _SIM900RTC {
202 uint8_t day;
203
205 uint8_t month;
206
208 uint8_t year;
209
211 uint8_t hour;
212
214 uint8_t minute;
215
217 uint8_t second;
218
220 int8_t gmt;
221} SIM900RTC;
222
231typedef struct _SIM900APN {
233 String apn;
234
236 String username;
237
239 String password;
240} SIM900APN;
241
250typedef struct _SIM900HTTPHeader {
252 String key;
253
255 String value;
257
267typedef struct _SIM900HTTPRequest {
269 String method;
270
272 String data;
273
275 String domain;
276
278 String resource;
279
281 uint8_t status;
282
284 uint16_t port;
285
288
290 uint16_t header_count;
292
302typedef struct _SIM900HTTPResponse {
304 uint16_t status;
305
308
310 uint16_t header_count;
311
313 String data;
315
325typedef struct _SIM900CardAccount {
327 String name;
328
330 String number;
331
333 uint8_t type;
334
336 uint8_t speed;
337
339 SIM900PhonebookType numberType;
340
342 SIM900CardService service;
344
357
359 uint8_t used;
360
362 uint8_t max;
364
374typedef struct _SIM900Signal {
376 uint8_t rssi;
377
381
382#endif
A structure representing Access Point Name (APN) configuration for mobile data.
A structure representing a card account, including name, number, type, and service information.
A structure representing an HTTP header key-value pair.
A structure representing an HTTP request.
A structure representing an HTTP response.
A structure representing mobile network operator information.
A structure representing the capacity of a phonebook memory type.
A structure representing real-time clock (RTC) information.
A structure representing signal strength and bit error rate information.
String username
The username for APN authentication.
String apn
The Access Point Name (APN) for data connectivity.
String password
The password for APN authentication.
uint8_t type
The card's type (e.g., SIM card).
String name
The name associated with the card account.
SIM900CardService service
The type of card service (e.g., voice, data) associated with the card account.
SIM900PhonebookType numberType
The type of phonebook (national, international) where the number is stored.
uint8_t speed
The card's speed or data rate.
String number
The card's phone number.
String value
The header field value.
String key
The header field key.
String data
The data to be included in the request (e.g., POST data).
String resource
The resource or URL path to access on the server.
uint16_t header_count
The number of HTTP headers in the array.
String domain
The domain or server to which the request is sent.
SIM900HTTPHeader * headers
An array of HTTP headers associated with the request.
uint16_t port
The port on which the server is listening (e.g., 80 for HTTP).
String method
The HTTP method for the request (e.g., GET, POST).
uint8_t status
The status of the HTTP request.
String data
The data received in the HTTP response, such as HTML content or JSON data.
SIM900HTTPHeader * headers
An array of HTTP headers included in the response.
uint16_t header_count
The number of HTTP headers in the array.
uint16_t status
The HTTP status code of the response.
SIM900OperatorFormat format
The operator selection format.
String name
The name of the mobile network operator.
SIM900OperatorMode mode
The operating mode of the mobile network operator.
uint8_t used
The number of entries used in the phonebook memory.
uint8_t max
The maximum number of entries that can be stored in the phonebook memory.
String memoryType
The type of phonebook memory (e.g., "SM" for SIM memory).
uint8_t minute
Time component: minute.
int8_t gmt
GMT (Greenwich Mean Time) offset in hours.
uint8_t year
Date component: year.
uint8_t day
Date component: day.
uint8_t month
Date component: month.
uint8_t second
Time component: second.
uint8_t hour
Time component: hour.
uint8_t rssi
Received Signal Strength Indication (RSSI) in decibels (dBm).
uint8_t bit_error_rate
Bit Error Rate (BER) as a unitless ratio.