Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/connectivity_plus/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 1.1.1

* Update connectivity_plus to 2.3.0.
* Update connectivity_plus_platform_interface to 1.2.0.
* Support bluetooth as connectivity result.
* Code refactoring.

## 1.1.0

* Update connectivity_plus to 2.1.0.
Expand Down
4 changes: 2 additions & 2 deletions packages/connectivity_plus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ This package is not an _endorsed_ implementation of `connectivity_plus`. Therefo

```yaml
dependencies:
connectivity_plus: ^2.1.0
connectivity_plus_tizen: ^1.1.0
connectivity_plus: ^2.3.0
connectivity_plus_tizen: ^1.1.1
```

Then you can import `connectivity_plus` in your Dart code:
Expand Down
2 changes: 1 addition & 1 deletion packages/connectivity_plus/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Demonstrates how to use the connectivity_plus_tizen plugin.
publish_to: "none"

dependencies:
connectivity_plus: ^2.1.0
connectivity_plus: ^2.3.0
connectivity_plus_tizen:
path: ../
flutter:
Expand Down
4 changes: 2 additions & 2 deletions packages/connectivity_plus/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: connectivity_plus_tizen
description: Tizen implementation of the connectivity_plus plugin.
homepage: https://github.com/flutter-tizen/plugins
repository: https://github.com/flutter-tizen/plugins/tree/master/packages/connectivity_plus
version: 1.1.0
version: 1.1.1

flutter:
plugin:
Expand All @@ -12,7 +12,7 @@ flutter:
fileName: connectivity_plus_tizen_plugin.h

dependencies:
connectivity_plus_platform_interface: ^1.1.1
connectivity_plus_platform_interface: ^1.2.0
flutter:
sdk: flutter

Expand Down
2 changes: 2 additions & 0 deletions packages/connectivity_plus/tizen/src/connection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ static ConnectionType ToConnectionType(connection_type_e type) {
return ConnectionType::kMobile;
case CONNECTION_TYPE_ETHERNET:
return ConnectionType::kEthernet;
case CONNECTION_TYPE_BT:
return ConnectionType::kBluetooth;

@swift-kim swift-kim Apr 16, 2022

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this function return ConnectionType::kBluetooth if the system reported network type is CONNECTION_TYPE_NET_PROXY? As far as I understand the proxy type means that the wearable device is using the bluetooth-connected phone's connection.

I just tested on my watch and found out that the device reports the current network type as CONNECTION_TYPE_ETHERNET when it's connected to a phone via bluetooth (even if the watch is connected to Wi-Fi simultaneously). I don't really understand why the Connection API works in this way.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Relax! 😄
Perhaps it is a gimmick that was entered because of a some scenario in the past.

case CONNECTION_TYPE_DISCONNECTED:
default:
return ConnectionType::kNone;
Expand Down
9 changes: 8 additions & 1 deletion packages/connectivity_plus/tizen/src/connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,14 @@
#include <functional>
#include <string>

enum class ConnectionType { kNone, kEthernet, kWiFi, kMobile, kError };
enum class ConnectionType {
kNone,
kEthernet,
kWiFi,
kMobile,
kBluetooth,
kError
};

typedef std::function<void(ConnectionType)> ConnectionTypeCallback;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ std::string ConnectionTypeToString(ConnectionType type) {
return "wifi";
case ConnectionType::kMobile:
return "mobile";
case ConnectionType::kBluetooth:
return "bluetooth";
case ConnectionType::kNone:
default:
return "none";
Expand Down