Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: ChannelPlan.h
- Revision:
- 72:b1e07ec1c30d
- Parent:
- 70:0c5b5b02d17b
--- a/ChannelPlan.h Fri Nov 08 09:34:58 2019 -0600 +++ b/ChannelPlan.h Mon Feb 17 14:43:04 2020 -0600 @@ -193,12 +193,18 @@ virtual uint8_t GetMaxPayloadSize(); /** + * Get max payload size for a given datarate + * @return size in bytes + */ + virtual uint8_t GetMaxPayloadSize(uint8_t dr); + + /** * Get rx window settings for requested window * RX_1, RX_2, RX_BEACON, RX_SLOT * @param window * @return RxWindow */ - virtual RxWindow GetRxWindow(uint8_t window) = 0; + virtual RxWindow GetRxWindow(uint8_t window, int8_t id = 0) = 0; /** * Get current channel to use for transmitting @@ -271,7 +277,8 @@ virtual uint8_t SetRxConfig(uint8_t window, bool continuous, uint16_t wnd_growth = 1, - uint16_t pad_ms = 0) = 0; + uint16_t pad_ms = 0, + int8_t id = 0); /** * Set frequency sub band if supported by plan @@ -287,11 +294,6 @@ virtual uint8_t GetFrequencySubBand(); /** - * Reset the ack counter used to lower datarate if ACK's are missed - */ - virtual void ResetAckCounter(); - - /** * Callback for radio to request channel change when frequency hopping * @param currentChannel */ @@ -578,7 +580,7 @@ * @param [out] data extracted from the beacon if this packet was indeed a beacon * @return true if this packet is beacon, false if not */ - virtual bool DecodeBeacon(const uint8_t* payload, + virtual uint8_t DecodeBeacon(const uint8_t* payload, size_t size, BeaconData_t& data) = 0; @@ -600,10 +602,12 @@ * Search enabled channels for lowest available datarate */ virtual uint8_t GetMinEnabledDatarate(); - protected: SxRadio* GetRadio(); //!< Get pointer to the SxRadio object or assert if it is null Settings* GetSettings(); //!< Get pointer to the settings object or assert if it is null + + protected: + /** * 16 bit ITU-T CRC implementation */ @@ -663,6 +667,8 @@ static const uint8_t* MAX_PAYLOAD_SIZE; //!< List of max payload sizes for each datarate static const uint8_t* MAX_PAYLOAD_SIZE_REPEATER; //!< List of repeater compatible max payload sizes for each datarate + uint8_t _beaconSize; + uint8_t _plan; std::string _planName;