Base class for the ublox-xxx-cellular-xxx classes. Cannot be used standalone, only inherited by classes that do properly useful stuff. Or, to put it another way, if you are using any of the ublox-xxx-cellular-xxx classes, you will need this class also.
Dependents: example-ublox-cellular-interface example-ublox-cellular-driver-gen HelloMQTT example-ublox-cellular-interface_r410M ... more
Diff: UbloxCellularBase.h
- Revision:
- 26:e4e444cc7b14
- Parent:
- 25:e67d3d9d2e7e
- Child:
- 29:8a38f91009ad
diff -r e67d3d9d2e7e -r e4e444cc7b14 UbloxCellularBase.h
--- a/UbloxCellularBase.h Wed May 29 12:39:28 2019 +0500
+++ b/UbloxCellularBase.h Thu Aug 01 18:57:01 2019 +0500
@@ -1,4 +1,4 @@
-/* Copyright (c) 2017 ARM Limited
+/* Copyright (c) 2019 ARM Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -83,6 +83,17 @@
ASLEEP = 1
} ModemPSMState;
+ /**
+ * edrx access technology
+ */
+ typedef enum {
+ EDRXGSM_EC_GSM_IoT_mode = 1,
+ EDRXGSM_A_Gb_mode,
+ EDRXUTRAN_Iu_mode,
+ EDRXEUTRAN_WB_S1_mode,
+ EDRXEUTRAN_NB_S1_mode
+ }tEDRXAccessTechnology;
+
/** Initialise the modem, ready for use.
*
* @param pin PIN for the SIM card.
@@ -400,6 +411,54 @@
bool is_modem_awake();
#endif
+#ifdef TARGET_UBLOX_C030_R41XM
+ /** Set discontinuous reception time on cellular device.
+ * SARA-R404M / SARA-R410M-02B / SARA-R410M-52B / SARA-R412M / SARA-N4 : The <Paging_time_window> parameter cannot be set by means of the set command.
+ *
+ *
+ * @remark See 3GPP TS 27.007 eDRX for details.
+ *
+ * @param mode disable or enable the use of eDRX
+ * @param act_type type of access technology
+ * @param edrx_value requested edxr value. Extended DRX parameters information element.
+ *
+ * @return 0 on success
+ * 1 on failure
+ */
+ int set_receive_period(int mode, tEDRXAccessTechnology act_type, uint8_t edrx_value);
+
+ /** Set discontinuous reception time on cellular device.
+ *
+ * @remark See 3GPP TS 27.007 eDRX for details.
+ *
+ * @param mode disable or enable the use of eDRX
+ * @param act_type type of access technology
+ *
+ * @return 0 on success
+ * 1 on failure
+ */
+ int set_receive_period(int mode, tEDRXAccessTechnology act_type);
+
+ /** Set discontinuous reception time on cellular device. (Disable)
+ *
+ * @remark See 3GPP TS 27.007 eDRX for details.
+ *
+ * @param mode disable or enable the use of eDRX
+ *
+ * @return 0 on success
+ * 1 on failure
+ */
+ int set_receive_period(int mode);
+
+ /** get discontinuous reception time on cellular device.
+ *
+ * @remark See 3GPP TS 27.007 eDRX for details.
+ *
+ * @return uint32_t
+ */
+ uint32_t get_receive_period();
+#endif
+
protected:
#define OUTPUT_ENTER_KEY "\r"
@@ -649,6 +708,16 @@
* @param bit_cnt defines how many bits are filled to buffer started from lsb
*/
void uint_to_binary_str(uint32_t num, char* str, int str_size, int bit_cnt);
+
+ /** Converts the given binary string to uint.
+ * For example binary_str_to_uint("0000001001", 10) would return 9
+ *
+ * @param binary_string binary string from where chars are converted to uint
+ * @param binary_string_length length of the param binary_string
+ * @return uint represented by the binary string
+ */
+ uint32_t binary_str_to_uint(const char *binary_string, int binary_string_length);
+
#endif
private:
@@ -677,6 +746,9 @@
Callback<void(void*)> _func_psm_coming_out; /**< Callback. */
void set_modem_psm_state(int state);
#endif
+#ifdef TARGET_UBLOX_C030_R41XM
+ bool _edrx_configured;
+#endif
};
#endif // _UBLOX_CELLULAR_BASE_
u-blox