Skip to content

[connectivity_plus] Refactor the C++ code#352

Merged
swift-kim merged 1 commit into
flutter-tizen:masterfrom
swift-kim:refactor-connectivity-plus
Apr 15, 2022
Merged

[connectivity_plus] Refactor the C++ code#352
swift-kim merged 1 commit into
flutter-tizen:masterfrom
swift-kim:refactor-connectivity-plus

Conversation

@swift-kim

@swift-kim swift-kim commented Apr 11, 2022

Copy link
Copy Markdown
Member

Part of the code refactoring project. This change is an analogue of #351.

  • Extract the Connection class from ConnectivityPlusTizenPlugin for better separation of the platform channel communication and the device API usage. (I referred to the connectivity_plus_windows implementation.)
    • Create an enum ConnectionType to indicate the current connectivity type or an error status.
    • RegisterObserver/ClearObserverStartListen/StopListen
    • StartListen takes ConnectionTypeCallback as an argument.
    • Create a new method GetType.
    • Remove EnsureConnectionHandle. The connection handle is now created and managed by the Connection class.
  • Create typedefs of long commonly-used types.
  • Create an explicit ConnectivityStreamHandler class. Now the lifecycle of EventSink is solely managed by this class.
  • Minor cleanups.
    • Remove SetupChannels and combine with RegisterWithRegistrar.
    • Style log messages and error codes in a consistent manner.
    • Wrap the non-public implementation with an anonymous namespace.

Additional note: The connectivity type "bluetooth" has been added to the platform interface and will be implemented in a later PR.

Comment thread packages/connectivity_plus/tizen/src/connection.cc
@swift-kim swift-kim force-pushed the refactor-connectivity-plus branch from 983b2a3 to 42244d9 Compare April 14, 2022 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants