Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: Modules/InterPlatformComms/ZigbeeConnector.cpp
- ===================================================================
- --- Modules/InterPlatformComms/ZigbeeConnector.cpp (revision 4433)
- +++ Modules/InterPlatformComms/ZigbeeConnector.cpp (working copy)
- @@ -61,6 +61,7 @@
- ipc::ZigbeeConnector::ZigbeeConnector(VDK::IOID p_device, const ipc::NetworkAddress &p_address, VDK::ThreadID ipcThread)
- : m_open(true),
- + m_device(p_device),
- m_uart( static_cast<VDK::DeviceDescriptor>(UINT_MAX) ),
- m_bucket(128),
- m_tftpport( htons(69) ),
- @@ -73,8 +74,7 @@
- // reset Zigbee
- *pPORTHIO_CLEAR = PH6;
- - char flags = O_FLOWDIS;
- - m_uart = VDK::OpenDevice(p_device, &flags);
- + Resume_Impl();
- VDK::Sleep(ZIGBEE_RESET_TOUT);
- *pPORTHIO_SET = PH6;
- }
- @@ -338,6 +338,18 @@
- return !m_output.empty();
- }
- +void ipc::ZigbeeConnector::Pause_Impl()
- +{
- + VDK::CloseDevice(m_uart);
- + m_uart = static_cast<VDK::DeviceDescriptor>(UINT_MAX);
- +}
- +
- +void ipc::ZigbeeConnector::Resume_Impl()
- +{
- + char flags = O_FLOWDIS;
- + m_uart = VDK::OpenDevice(m_device, &flags);
- +}
- +
- void ipc::ZigbeeConnector::DoWrite_Impl()
- {
- utils::ScopedLock lock(m_mutex);
- Index: Modules/InterPlatformComms/ZigbeeConnector.hpp
- ===================================================================
- --- Modules/InterPlatformComms/ZigbeeConnector.hpp (revision 4433)
- +++ Modules/InterPlatformComms/ZigbeeConnector.hpp (working copy)
- @@ -103,6 +103,11 @@
- virtual void Close_Impl();
- + virtual void Pause_Impl();
- +
- + virtual void Resume_Impl();
- +
- + VDK::IOID m_device;
- ipc::Session::Socket m_uart;
- bool m_open;
- uint32_t m_bucket;
- Index: Modules/InterPlatformComms/Reactor.hpp
- ===================================================================
- --- Modules/InterPlatformComms/Reactor.hpp (revision 4433)
- +++ Modules/InterPlatformComms/Reactor.hpp (working copy)
- @@ -111,6 +111,7 @@
- void Pause()
- {
- m_paused = true;
- + Pause_Impl();
- assert(ShouldWrite() == false);
- assert(ShouldRead() == false);
- }
- @@ -118,6 +119,7 @@
- void Resume()
- {
- m_paused = false;
- + Resume_Impl();
- }
- virtual ~Session()
- @@ -154,6 +156,8 @@
- virtual void DoWrite_Impl() = 0;
- virtual bool IsOpen_Impl() const = 0;
- virtual void Close_Impl() = 0;
- + virtual void Pause_Impl() { };
- + virtual void Resume_Impl() { };
- ipc::Reactor *m_reactor; ///< parent reactor
- };
Add Comment
Please, Sign In to add comment