![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Fork to see if I can get working
Dependencies: BufferedSerial OneWire WinbondSPIFlash libxDot-dev-mbed5-deprecated
Fork of xDotBridge_update_test20180823 by
xDotBridge/inc/dot_util.h@91:8196900df6fe, 2017-11-18 (annotated)
- Committer:
- mbriggs_vortex
- Date:
- Sat Nov 18 18:01:43 2017 -0700
- Revision:
- 91:8196900df6fe
- Parent:
- 63:e1efbe3402d9
Added new 1.01 bootloader, removed unimplemented prints, removed secrets from being printed (using MACRO in dot_util.h)
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mfiore | 0:a151a6350d7f | 1 | #ifndef __DOT_UTIL_H__ |
mfiore | 0:a151a6350d7f | 2 | #define __DOT_UTIL_H__ |
mfiore | 0:a151a6350d7f | 3 | |
Matt Briggs | 63:e1efbe3402d9 | 4 | #include <inc/MyLog.h> |
Matt Briggs | 21:4be85f9c7dc7 | 5 | #include "../config.h" |
mfiore | 0:a151a6350d7f | 6 | #include "mbed.h" |
mfiore | 0:a151a6350d7f | 7 | #include "mDot.h" |
Matt Briggs | 63:e1efbe3402d9 | 8 | #include "MTSText.h" |
mfiore | 0:a151a6350d7f | 9 | #include "MTSLog.h" |
mbriggs_vortex | 91:8196900df6fe | 10 | |
mbriggs_vortex | 91:8196900df6fe | 11 | #define SHOW_SECRETS 0 // This will hide all the keys from printing |
mfiore | 0:a151a6350d7f | 12 | |
mfiore | 0:a151a6350d7f | 13 | extern mDot* dot; |
mfiore | 0:a151a6350d7f | 14 | |
mfiore | 0:a151a6350d7f | 15 | void display_config(); |
mfiore | 0:a151a6350d7f | 16 | |
Mike Fiore |
5:97ed5f2f099e | 17 | 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); |
Mike Fiore |
5:97ed5f2f099e | 18 | |
Mike Fiore |
5:97ed5f2f099e | 19 | 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); |
mfiore | 0:a151a6350d7f | 20 | |
Mike Fiore |
8:e667f4a507b1 | 21 | 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); |
Mike Fiore |
8:e667f4a507b1 | 22 | |
Mike Fiore |
12:ec9768677cea | 23 | 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); |
Mike Fiore |
12:ec9768677cea | 24 | |
Mike Fiore |
15:364df461110f | 25 | void update_network_link_check_config(uint8_t link_check_count, uint8_t link_check_threshold); |
Mike Fiore |
15:364df461110f | 26 | |
mfiore | 0:a151a6350d7f | 27 | void join_network(); |
mfiore | 0:a151a6350d7f | 28 | |
mfiore | 0:a151a6350d7f | 29 | void sleep_wake_rtc_only(bool deepsleep); |
mfiore | 0:a151a6350d7f | 30 | |
mfiore | 0:a151a6350d7f | 31 | void sleep_wake_interrupt_only(bool deepsleep); |
mfiore | 0:a151a6350d7f | 32 | |
mfiore | 0:a151a6350d7f | 33 | void sleep_wake_rtc_or_interrupt(bool deepsleep); |
mfiore | 0:a151a6350d7f | 34 | |
Mike Fiore |
7:724cb82a113e | 35 | void sleep_save_io(); |
Mike Fiore |
7:724cb82a113e | 36 | |
Mike Fiore |
7:724cb82a113e | 37 | void sleep_configure_io(); |
Mike Fiore |
7:724cb82a113e | 38 | |
Mike Fiore |
7:724cb82a113e | 39 | void sleep_restore_io(); |
Mike Fiore |
7:724cb82a113e | 40 | |
mfiore | 0:a151a6350d7f | 41 | void send_data(std::vector<uint8_t> data); |
mfiore | 0:a151a6350d7f | 42 | |
Matt Briggs | 63:e1efbe3402d9 | 43 | #ifdef MTS_DEBUG |
Matt Briggs | 63:e1efbe3402d9 | 44 | #define logFatal(format, ...) \ |
Matt Briggs | 63:e1efbe3402d9 | 45 | mts::MTSLog::printMessage(mts::MTSLog::FATAL_LEVEL, "%s:%s:%d| [%s] " format "\r\n", __CLASSNAME__, __func__, __LINE__, mts::MTSLog::FATAL_LABEL, ##__VA_ARGS__) |
Matt Briggs | 63:e1efbe3402d9 | 46 | #define logError(format, ...) \ |
Matt Briggs | 63:e1efbe3402d9 | 47 | mts::MTSLog::printMessage(mts::MTSLog::ERROR_LEVEL, "%s:%s:%d| [%s] " format "\r\n", __CLASSNAME__, __func__, __LINE__, mts::MTSLog::ERROR_LABEL, ##__VA_ARGS__) |
Matt Briggs | 63:e1efbe3402d9 | 48 | #define logWarning(format, ...) \ |
Matt Briggs | 63:e1efbe3402d9 | 49 | mts::MTSLog::printMessage(mts::MTSLog::WARNING_LEVEL, "%s:%s:%d| [%s] " format "\r\n", __CLASSNAME__, __func__, __LINE__, mts::MTSLog::WARNING_LABEL, ##__VA_ARGS__) |
Matt Briggs | 63:e1efbe3402d9 | 50 | #define logInfo(format, ...) \ |
Matt Briggs | 63:e1efbe3402d9 | 51 | mts::MTSLog::printMessage(mts::MTSLog::INFO_LEVEL, "%s:%s:%d| [%s] " format "\r\n", __CLASSNAME__, __func__, __LINE__, mts::MTSLog::INFO_LABEL, ##__VA_ARGS__) |
Matt Briggs | 63:e1efbe3402d9 | 52 | #define logDebug(format, ...) \ |
Matt Briggs | 63:e1efbe3402d9 | 53 | mts::MTSLog::printMessage(mts::MTSLog::DEBUG_LEVEL, "%s:%s:%d| [%s] " format "\r\n", __CLASSNAME__, __func__, __LINE__, mts::MTSLog::DEBUG_LABEL, ##__VA_ARGS__) |
Matt Briggs | 63:e1efbe3402d9 | 54 | #define logTrace(format, ...) \ |
Matt Briggs | 63:e1efbe3402d9 | 55 | mts::MTSLog::printMessage(mts::MTSLog::TRACE_LEVEL, "%s:%s:%d| [%s] " format "\r\n", __CLASSNAME__, __func__, __LINE__, mts::MTSLog::TRACE_LABEL, ##__VA_ARGS__) |
Matt Briggs | 63:e1efbe3402d9 | 56 | #else |
Matt Briggs | 63:e1efbe3402d9 | 57 | #define mtsLogFatal(format, ...) \ |
Matt Briggs | 63:e1efbe3402d9 | 58 | mts::MTSLog::printMessage(mts::MTSLog::FATAL_LEVEL, "[%s] " format "\r\n", mts::MTSLog::FATAL_LABEL, ##__VA_ARGS__) |
Matt Briggs | 63:e1efbe3402d9 | 59 | #define mtsLogError(format, ...) \ |
Matt Briggs | 63:e1efbe3402d9 | 60 | mts::MTSLog::printMessage(mts::MTSLog::ERROR_LEVEL, "[%s] " format "\r\n", mts::MTSLog::ERROR_LABEL, ##__VA_ARGS__) |
Matt Briggs | 63:e1efbe3402d9 | 61 | #define mtsLogWarning(format, ...) \ |
Matt Briggs | 63:e1efbe3402d9 | 62 | mts::MTSLog::printMessage(mts::MTSLog::WARNING_LEVEL, "[%s] " format "\r\n", mts::MTSLog::WARNING_LABEL, ##__VA_ARGS__) |
Matt Briggs | 63:e1efbe3402d9 | 63 | #define mtsLogInfo(format, ...) \ |
Matt Briggs | 63:e1efbe3402d9 | 64 | mts::MTSLog::printMessage(mts::MTSLog::INFO_LEVEL, "[%s] " format "\r\n", mts::MTSLog::INFO_LABEL, ##__VA_ARGS__) |
Matt Briggs | 63:e1efbe3402d9 | 65 | #define mtsLogDebug(format, ...) \ |
Matt Briggs | 63:e1efbe3402d9 | 66 | mts::MTSLog::printMessage(mts::MTSLog::DEBUG_LEVEL, "[%s] " format "\r\n", mts::MTSLog::DEBUG_LABEL, ##__VA_ARGS__) |
Matt Briggs | 63:e1efbe3402d9 | 67 | #define mtsLogTrace(format, ...) \ |
Matt Briggs | 63:e1efbe3402d9 | 68 | mts::MTSLog::printMessage(mts::MTSLog::TRACE_LEVEL, "[%s] " format "\r\n", mts::MTSLog::TRACE_LABEL, ##__VA_ARGS__) |
mfiore | 0:a151a6350d7f | 69 | #endif |
Matt Briggs | 63:e1efbe3402d9 | 70 | |
Matt Briggs | 63:e1efbe3402d9 | 71 | #endif |