Multitech xDot Utils
Diff: MultitechDot.h
- Revision:
- 2:8d1c64670642
- Parent:
- 1:73cea350269e
- Child:
- 3:7fa5603c10dc
--- a/MultitechDot.h Thu Jul 20 16:43:35 2017 +0300 +++ b/MultitechDot.h Mon Feb 19 16:11:52 2018 +0200 @@ -5,33 +5,34 @@ #include "mDot.h" #include "MTSLog.h" #include "MTSText.h" +#include "dot_defs.h" #include "xdot_low_power.h" class MultitechDot : public mDot { public: - static MultitechDot* getInstance(); - void config( - uint8_t *network_address, uint8_t *network_session_key, uint8_t *data_session_key, - uint8_t frequency_sub_band, bool public_network, uint8_t ack - ); + static MultitechDot *get_instance(struct dot_config *config); + + void config(struct dot_config *config); + + struct dot_config *get_config(); void display_config(); + //todo use dot_config param void update_ota_config_name_phrase( std::string network_name, std::string network_passphrase, uint8_t frequency_sub_band, bool public_network, uint8_t ack ); + //todo use dot_config param void update_ota_config_id_key( uint8_t *network_id, uint8_t *network_key, uint8_t frequency_sub_band, bool public_network, uint8_t ack ); - void update_manual_config( - uint8_t *network_address, uint8_t *network_session_key, uint8_t *data_session_key, - uint8_t frequency_sub_band, bool public_network, uint8_t ack - ); + void update_manual_config(struct dot_config *config); + //todo use dot_config param void update_peer_to_peer_config( uint8_t *network_address, uint8_t *network_session_key, uint8_t *data_session_key, uint32_t tx_frequency, uint8_t tx_datarate, uint8_t tx_power @@ -58,6 +59,22 @@ void sleep_restore_io(); void send_data(std::vector<uint8_t> data); + + /** + * Set debug mode so that debug logs are enabled + * @param is_debug_mode true to enable debug mode, false otherwise + */ + void set_debug_mode(bool is_debug_mode); + + + /** + * Set sleep time + * @param sleep_time sleep time in seconds + */ + void set_sleep_time(uint32_t sleep_time); + +protected: + struct dot_config *_config; };