Aidan Wynn / libmDot-mbed5

Dependents:   Cloudtracker

Revision:
69:e22889c7eaa9
Parent:
68:5f787643e7d7
Child:
70:0c5b5b02d17b
diff -r 5f787643e7d7 -r e22889c7eaa9 mDot.h
--- a/mDot.h	Thu Aug 29 08:32:27 2019 -0500
+++ b/mDot.h	Thu Aug 29 12:21:51 2019 -0500
@@ -61,6 +61,21 @@
         void waitForPacket();
         void waitForLinkCheck();
 
+
+        MBED_DEPRECATED("Will be removed in dotlib 3.3.0")
+        void setActivityLedState(const uint8_t& state);
+
+        MBED_DEPRECATED("Will be removed in dotlib 3.3.0")
+        uint8_t getActivityLedState();
+
+        MBED_DEPRECATED("Will be removed in dotlib 3.3.0")
+        void blinkActivityLed(void) {
+            if (_activity_led) {
+                int val = _activity_led->read();
+                _activity_led->write(!val);
+            }
+        }
+
         mDot(const mDot&);
         mDot& operator=(const mDot&);
 
@@ -82,7 +97,12 @@
 
         std::string _last_error;
         static const uint32_t _baud_rates[];
-
+        uint8_t _activity_led_state; //deprecated will be removed
+        Ticker _tick;
+        DigitalOut* _activity_led; //deprecated will be removed
+        bool _activity_led_enable; //deprecated will be removed
+        PinName _activity_led_pin;  //deprecated will be removed
+        bool _activity_led_external; //deprecated will be removed
         uint8_t _linkFailCount;
         uint8_t _class;
         InterruptIn* _wakeup;
@@ -142,8 +162,7 @@
         enum RX_Output {
             HEXADECIMAL,
             BINARY,
-            EXTENDED,
-            EXTENDED_HEX
+            EXTENDED
         };
 
         enum DataRates {
@@ -349,6 +368,21 @@
 
         lora::Settings* getSettings();
 
+        MBED_DEPRECATED("Will be removed in dotlib 3.3.0")
+        void setActivityLedEnable(const bool& enable);
+
+        MBED_DEPRECATED("Will be removed in dotlib 3.3.0")
+        bool getActivityLedEnable();
+
+        MBED_DEPRECATED("Will be removed in dotlib 3.3.0")
+        void setActivityLedPin(const PinName& pin);
+
+        MBED_DEPRECATED("Will be removed in dotlib 3.3.0")
+        void setActivityLedPin(DigitalOut* pin);
+
+        MBED_DEPRECATED("Will be removed in dotlib 3.3.0")
+        PinName getActivityLedPin();
+
         /**
          * Returns boolean indicative of start-up from standby mode
          * @returns true if dot woke from standby
@@ -660,20 +694,6 @@
         int32_t setNetworkKey(const std::vector<uint8_t>& id);
 
         /**
-         * Get generic app key
-         * @returns a vector containing key (size 16)
-         */
-        std::vector<uint8_t> getGenAppKey();
-
-        /**
-         * Set generic app key
-         * for use with Multicast key exchange
-         * @param id a vector of 16 bytes
-         * @returns MDOT_OK if success
-         */
-        int32_t setGenAppKey(const std::vector<uint8_t>& id);
-
-        /**
          * Get network key
          * @returns a vector containing network key (size 16)
          */
@@ -708,48 +728,19 @@
         const uint8_t* getAppKey();
 
         /**
-         * Set join nonce counter incremented with each Join Request
-         * @returns MDOT_OK if success
-         */
-        int32_t setJoinNonce(const uint16_t& nonce);
-
-        /**
-         * Get join nonce counter incremented with each Join Request
-         * @returns join nonce
-         */
-        uint16_t getJoinNonce();
-
-        /**
          * Add a multicast session address and keys
          * Downlink counter is set to 0
-         * Up to 8 MULTICAST_SESSIONS can be set
+         * Up to 3 MULTICAST_SESSIONS can be set
          */
-        int32_t setMulticastSession(uint8_t index, uint32_t addr, const uint8_t* nsk, const uint8_t* ask);
-
-        /**
-         * Set multicast session info
-         * Up to 8 MULTICAST_SESSIONS
-         */
-        int32_t setMulticastAddress(uint8_t index, uint32_t addr);
-        int32_t setMulticastNetworkSessionKey(uint8_t index, const uint8_t* nsk);
-        int32_t setMulticastApplicationSessionKey(uint8_t index, const uint8_t* ask);
+        int32_t setMulticastSession(uint8_t index, uint32_t addr, const uint8_t* nsk, const uint8_t* dsk);
 
         /**
          * Set a multicast session counter
-         * Up to 8 MULTICAST_SESSIONS
+         * Up to 3 MULTICAST_SESSIONS can be set
          */
         int32_t setMulticastDownlinkCounter(uint8_t index, uint32_t count);
 
         /**
-         * Get multicast session info
-         * Up to 8 MULTICAST_SESSIONS
-         */
-        uint32_t getMulticastAddress(uint8_t index);
-        int32_t getMulticastNetworkSessionKey(uint8_t index, uint8_t* nsk);
-        int32_t getMulticastApplicationSessionKey(uint8_t index, uint8_t* ask);
-        uint32_t getMulticastDownlinkCounter(uint8_t index);
-
-        /**
          * Attempt to join network
          * each attempt will be made with a random datarate up to the configured datarate
          * JoinRequest backoff between tries is enforced to 1% for 1st hour, 0.1% for 1-10 hours and 0.01% after 10 hours
@@ -1089,17 +1080,18 @@
          *
          * AU915 Datarates
          * ---------------
-         * DR0 - SF12BW125
-         * DR1 - SF11BW125
-         * DR2 - SF10BW125
-         * DR3 - SF9BW125
-         * DR4 - SF8BW125
-         * DR5 - SF7BW125
-         * DR6 - SF8BW500
+         * DR0 - SF10BW125
+         * DR1 - SF9BW125
+         * DR2 - SF8BW125
+         * DR3 - SF7BW125
+         * DR4 - SF8BW500
          *
          * @returns spreading factor and bandwidth
          */
         std::string getDataRateDetails(uint8_t rate);
+        MBED_DEPRECATED("Will be removed in 3.3.0")
+        std::string getDateRateDetails(uint8_t rate);
+
 
         /**
          * Set TX power output of radio before antenna gain, default: 14 dBm
@@ -1242,28 +1234,26 @@
         /**
          * Set the ADR ACK Limit
          * @param limit - ADR ACK limit
-         * @returns MDOT_OK if success
          */
-        int32_t setAdrAckLimit(uint8_t limit);
+        void setAdrAckLimit(uint16_t limit);
 
         /**
          * Get the ADR ACK Limit
          * @returns ADR ACK limit
          */
-        uint8_t getAdrAckLimit();
+        uint16_t getAdrAckLimit();
 
         /**
          * Set the ADR ACK Delay
          * @param delay - ADR ACK delay
-         * @returns MDOT_OK if success
          */
-        int32_t setAdrAckDelay(uint8_t delay);
+        void setAdrAckDelay(uint16_t delay);
 
         /**
          * Get the ADR ACK Delay
          * @returns ADR ACK delay
          */
-        uint8_t getAdrAckDelay();
+        uint16_t getAdrAckDelay();
 
         /**
          * Enable/disable CRC checking of packets
@@ -1554,8 +1544,6 @@
         // Return total size of all files saved in FLASH
         // Does not include SPIFFS overhead
         uint32_t getUsedSpace();
-
-        bool repairFlashFileSystem();
 #else
         ///////////////////////////////////////////////////////////////
         // EEPROM (Non Volatile Memory) Operation Functions for xDot //
@@ -1713,8 +1701,6 @@
         int32_t setDeviceId(const std::vector<uint8_t>& id);
         int32_t setProtectedAppEUI(const std::vector<uint8_t>& appEUI);
         int32_t setProtectedAppKey(const std::vector<uint8_t>& appKey);
-        std::vector<uint8_t> getProtectedAppEUI();
-        std::vector<uint8_t> getProtectedAppKey();
         int32_t setDefaultFrequencyBand(const uint8_t& band);
         bool saveProtectedConfig();
         // resets the radio/mac/link
@@ -1747,7 +1733,7 @@
 
         mdot_stats _stats;
 
-        Callback<void()> _wakeup_callback;
+        FunctionPointer _wakeup_callback;
 
         bool _standbyFlag;
         bool _testMode;