@@ -98,6 +98,7 @@ const char SARA_R5_NEW_MESSAGE_IND[] = "+CNMI"; // New [SMS] message indication
9898const char SARA_R5_PREF_MESSAGE_STORE[] = " +CPMS" ; // Preferred message storage
9999const char SARA_R5_READ_TEXT_MESSAGE[] = " +CMGR" ; // Read message
100100// V24 control and V25ter (UART interface)
101+ const char SARA_R5_FLOW_CONTROL[] = " &K" ; // Flow control
101102const char SARA_R5_COMMAND_BAUD[] = " +IPR" ; // Baud rate
102103// ### Packet switched data services
103104const 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] =
162163 230400 };
163164#define SARA_R5_DEFAULT_BAUD_RATE 115200
164165
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;
165173
166174// The standard Europe profile should be used as the basis for all other MNOs in Europe outside of Vodafone
167175// and Deutsche Telekom. However, there may be changes that need to be applied to the module for proper
@@ -394,6 +402,21 @@ typedef enum
394402 SARA_R5_PSD_ACTION_DEACTIVATE
395403} SARA_R5_pdp_actions_t;
396404
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+
397420class SARA_R5 : public Print
398421{
399422public:
@@ -514,6 +537,7 @@ class SARA_R5 : public Print
514537
515538 // V24 Control and V25ter (UART interface) AT commands
516539 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);
517541
518542 // GPIO
519543 // GPIO pin map
@@ -649,6 +673,13 @@ class SARA_R5 : public Print
649673 // File system
650674 SARA_R5_error_t getFileContents (String filename, String *contents);
651675
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+
652683private:
653684 HardwareSerial *_hardSerial;
654685#ifdef SARA_R5_SOFTWARE_SERIAL_ENABLED
@@ -683,29 +714,12 @@ class SARA_R5 : public Print
683714 SARA_R5_INIT_RESET
684715 } SARA_R5_init_type_t;
685716
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-
701717 SARA_R5_error_t init (unsigned long baud, SARA_R5_init_type_t initType = SARA_R5_INIT_STANDARD);
702718
703719 void powerOn (void );
704720
705721 void hwReset (void );
706722
707- SARA_R5_error_t functionality (SARA_R5_functionality_t function = FULL_FUNCTIONALITY);
708-
709723 SARA_R5_error_t setMNOprofile (mobile_network_operator_t mno, boolean autoReset = false , boolean urcNotification = false );
710724 SARA_R5_error_t getMNOprofile (mobile_network_operator_t *mno);
711725
0 commit comments