-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathCatM1ConnectionHandler.h
More file actions
62 lines (42 loc) · 1.87 KB
/
CatM1ConnectionHandler.h
File metadata and controls
62 lines (42 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
This file is part of the Arduino_ConnectionHandler library.
Copyright (c) 2023 Arduino SA
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef ARDUINO_CATM1_CONNECTION_HANDLER_H_
#define ARDUINO_CATM1_CONNECTION_HANDLER_H_
/******************************************************************************
INCLUDE
******************************************************************************/
#include "ConnectionHandlerInterface.h"
#if defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_EDGE_CONTROL)
#include <GSM.h>
#endif
#ifndef BOARD_HAS_CATM1_NBIOT
#error "Board doesn't support CATM1_NBIOT"
#endif
/******************************************************************************
CLASS DECLARATION
******************************************************************************/
class CatM1ConnectionHandler : public ConnectionHandler
{
public:
CatM1ConnectionHandler();
CatM1ConnectionHandler(const char * pin, const char * apn, const char * login, const char * pass, RadioAccessTechnologyType rat = CATM1, uint32_t band = BAND_3 | BAND_20 | BAND_19, bool const keep_alive = true);
unsigned long getTime() override;
Client & getClient() override { return _gsm_client; };
UDP & getUDP() override { return _gsm_udp; };
protected:
NetworkConnectionState update_handleInit () override;
NetworkConnectionState update_handleConnecting () override;
NetworkConnectionState update_handleConnected () override;
NetworkConnectionState update_handleDisconnecting() override;
NetworkConnectionState update_handleDisconnected () override;
private:
bool _reset;
GSMUDP _gsm_udp;
GSMClient _gsm_client;
};
#endif /* #ifndef ARDUINO_CATM1_CONNECTION_HANDLER_H_ */