@@ -98,6 +98,7 @@ const char SARA_R5_NEW_MESSAGE_IND[] = "+CNMI"; // New [SMS] message indication
98
98
const char SARA_R5_PREF_MESSAGE_STORE[] = " +CPMS" ; // Preferred message storage
99
99
const char SARA_R5_READ_TEXT_MESSAGE[] = " +CMGR" ; // Read message
100
100
// V24 control and V25ter (UART interface)
101
+ const char SARA_R5_FLOW_CONTROL[] = " &K" ; // Flow control
101
102
const char SARA_R5_COMMAND_BAUD[] = " +IPR" ; // Baud rate
102
103
// ### Packet switched data services
103
104
const char SARA_R5_MESSAGE_PDP_DEF[] = " +CGDCONT" ; // Packet switched Data Profile context definition
@@ -162,6 +163,13 @@ const unsigned long SARA_R5_SUPPORTED_BAUD[NUM_SUPPORTED_BAUD] =
162
163
230400 };
163
164
#define SARA_R5_DEFAULT_BAUD_RATE 115200
164
165
166
+ // Flow control definitions for AT&K
167
+ // Note: SW (XON/XOFF) flow control is not supported on the SARA_R5
168
+ typedef enum
169
+ {
170
+ SARA_R5_DISABLE_FLOW_CONTROL = 0 ,
171
+ SARA_R5_ENABLE_FLOW_CONTROL = 3
172
+ } SARA_R5_flow_control_t;
165
173
166
174
// The standard Europe profile should be used as the basis for all other MNOs in Europe outside of Vodafone
167
175
// and Deutsche Telekom. However, there may be changes that need to be applied to the module for proper
@@ -394,6 +402,21 @@ typedef enum
394
402
SARA_R5_PSD_ACTION_DEACTIVATE
395
403
} SARA_R5_pdp_actions_t;
396
404
405
+ typedef enum
406
+ {
407
+ MINIMUM_FUNCTIONALITY = 0 , // (disable both transmit and receive RF circuits by deactivating both CS and PS services)
408
+ FULL_FUNCTIONALITY = 1 ,
409
+ AIRPLANE_MODE = 4 ,
410
+ SIM_TOOLKIT_ENABLE_DEDICATED = 6 ,
411
+ SIM_TOOLKIT_DISABLE_DEDICATED = 7 ,
412
+ SIM_TOOLKIT_ENABLE_RAW = 9 ,
413
+ FAST_SAFE_POWER_OFF = 10 ,
414
+ // SILENT_RESET_WITHOUT_SIM = 15, // Not supported on SARA-R5
415
+ SILENT_RESET_WITH_SIM = 16
416
+ // MINIMUM_FUNCTIONALITY = 19, // Not supported on SARA-R5
417
+ // DEEP_LOW_POWER_STATE = 127 // Not supported on SARA-R5
418
+ } SARA_R5_functionality_t;
419
+
397
420
class SARA_R5 : public Print
398
421
{
399
422
public:
@@ -514,6 +537,7 @@ class SARA_R5 : public Print
514
537
515
538
// V24 Control and V25ter (UART interface) AT commands
516
539
SARA_R5_error_t setBaud (unsigned long baud);
540
+ SARA_R5_error_t setFlowControl (SARA_R5_flow_control_t value = SARA_R5_ENABLE_FLOW_CONTROL);
517
541
518
542
// GPIO
519
543
// GPIO pin map
@@ -649,6 +673,13 @@ class SARA_R5 : public Print
649
673
// File system
650
674
SARA_R5_error_t getFileContents (String filename, String *contents);
651
675
676
+ // Functionality
677
+ SARA_R5_error_t functionality (SARA_R5_functionality_t function = FULL_FUNCTIONALITY);
678
+
679
+ // Send a custom command with an expected (potentially partial) response, store entire response
680
+ SARA_R5_error_t sendCustomCommandWithResponse (const char *command, const char *expectedResponse,
681
+ char *responseDest, unsigned long commandTimeout = SARA_R5_STANDARD_RESPONSE_TIMEOUT, boolean at = true );
682
+
652
683
private:
653
684
HardwareSerial *_hardSerial;
654
685
#ifdef SARA_R5_SOFTWARE_SERIAL_ENABLED
@@ -683,29 +714,12 @@ class SARA_R5 : public Print
683
714
SARA_R5_INIT_RESET
684
715
} SARA_R5_init_type_t;
685
716
686
- typedef enum
687
- {
688
- MINIMUM_FUNCTIONALITY = 0 , // (disable both transmit and receive RF circuits by deactivating both CS and PS services)
689
- FULL_FUNCTIONALITY = 1 ,
690
- AIRPLANE_MODE = 4 ,
691
- SIM_TOOLKIT_ENABLE_DEDICATED = 6 ,
692
- SIM_TOOLKIT_DISABLE_DEDICATED = 7 ,
693
- SIM_TOOLKIT_ENABLE_RAW = 9 ,
694
- FAST_SAFE_POWER_OFF = 10 ,
695
- // SILENT_RESET_WITHOUT_SIM = 15, // Not supported on SARA-R5
696
- SILENT_RESET_WITH_SIM = 16
697
- // MINIMUM_FUNCTIONALITY = 19, // Not supported on SARA-R5
698
- // DEEP_LOW_POWER_STATE = 127 // Not supported on SARA-R5
699
- } SARA_R5_functionality_t;
700
-
701
717
SARA_R5_error_t init (unsigned long baud, SARA_R5_init_type_t initType = SARA_R5_INIT_STANDARD);
702
718
703
719
void powerOn (void );
704
720
705
721
void hwReset (void );
706
722
707
- SARA_R5_error_t functionality (SARA_R5_functionality_t function = FULL_FUNCTIONALITY);
708
-
709
723
SARA_R5_error_t setMNOprofile (mobile_network_operator_t mno, boolean autoReset = false , boolean urcNotification = false );
710
724
SARA_R5_error_t getMNOprofile (mobile_network_operator_t *mno);
711
725
0 commit comments