Skip to content

Commit 1324707

Browse files
authored
SDKs: Always bypass eula check on connecting WiFi (#737)
1 parent f15c015 commit 1324707

File tree

5 files changed

+36
-2
lines changed

5 files changed

+36
-2
lines changed

demos/kotlin/kmp_sdk/wsdk/src/commonMain/kotlin/com/gopro/open_gopro/operation/commands/AccessPointConnect.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,12 @@ internal class ConnectNewAccessPoint(val ssid: String, val password: String) :
7979
.executeProtobufCommand(
8080
FeatureId.NETWORK_MANAGEMENT,
8181
ActionId.REQUEST_WIFI_CONNECT_NEW,
82-
RequestConnectNew(ssid = ssid, password = password).encodeToByteArray(),
82+
// Hard code bypass_eula_check to True.
83+
// On cameras where it is supported, the connection should succeed regardless of whether
84+
// or not there is internet access.
85+
// On cameras where it is not supported, it should be ignore
86+
RequestConnectNew(ssid = ssid, password = password, bypassEulaCheck = true)
87+
.encodeToByteArray(),
8388
ResponseId.Protobuf(
8489
FeatureId.NETWORK_MANAGEMENT, ActionId.REQUEST_WIFI_CONNECT_NEW_RSP),
8590
GpUuid.CM_NET_MGMT_COMM)

demos/kotlin/kmp_sdk/wsdk/src/commonTest/kotlin/com/gopro/open_gopro/operation/BleCommands.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import com.gopro.open_gopro.domain.communicator.bleCommunicator.bleFragment
1010
import com.gopro.open_gopro.entity.communicator.ActionId
1111
import com.gopro.open_gopro.entity.communicator.FeatureId
1212
import com.gopro.open_gopro.entity.network.ble.GpUuid
13+
import com.gopro.open_gopro.gopro.CameraInternalError
1314
import com.gopro.open_gopro.operations.commands.AccessPointGetScanResults
1415
import com.gopro.open_gopro.operations.commands.AccessPointScan
1516
import com.gopro.open_gopro.operations.commands.ConnectNewAccessPoint
@@ -337,6 +338,7 @@ class TestBleCommands {
337338

338339
// THEN
339340
assertTrue { result.isFailure }
341+
assertTrue { result.exceptionOrNull() is CameraInternalError }
340342
}
341343

342344
@Test

demos/kotlin/kmp_sdk/wsdk/src/commonTest/kotlin/fakes/FakeBleApi.kt

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ package fakes
77

88
import com.benasher44.uuid.Uuid
99
import com.gopro.open_gopro.domain.communicator.BleCommunicator
10+
import com.gopro.open_gopro.domain.communicator.bleCommunicator.AccumulatedGpBleResponse
1011
import com.gopro.open_gopro.domain.communicator.bleCommunicator.bleFragment
1112
import com.gopro.open_gopro.domain.network.IBleApi
1213
import com.gopro.open_gopro.entity.network.ble.BleAdvertisement
@@ -86,6 +87,8 @@ internal class FakeBleApi(
8687

8788
private var messageCounter = 0
8889

90+
private var accumulatingResponse: AccumulatedGpBleResponse? = null
91+
8992
var shouldWriteSucceed = true
9093

9194
suspend fun sendNextMessage() {
@@ -126,7 +129,17 @@ internal class FakeBleApi(
126129
data: UByteArray
127130
): Result<Unit> {
128131
spies += BleApiSpy.Write(device, uuid, data)
129-
sendNextMessage()
132+
// We need to accumulate potentially partial write payloads here and only send the next BLE
133+
// response on the next message
134+
// For now, we assume there is only ever one concurrent accumulating response
135+
accumulatingResponse =
136+
(accumulatingResponse ?: AccumulatedGpBleResponse(GpUuid.fromUuid(uuid)!!)).apply {
137+
accumulate(data)
138+
}
139+
if (accumulatingResponse?.isReceived == true) {
140+
sendNextMessage()
141+
accumulatingResponse = null
142+
}
130143
return Result.success(Unit)
131144
}
132145

demos/python/sdk_wireless_camera_control/docs/changelog.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ All notable changes to this project will be documented in this file.
99
The format is based on `Keep a Changelog <https://keepachangelog.com/en/1.0.0/>`_,
1010
and this project adheres to `Semantic Versioning <https://semver.org/spec/v2.0.0.html>`_.
1111

12+
0.19.7 (April-28-2025)
13+
----------------------
14+
* Add Reboot Command
15+
* Hardcode bypass_eula_check to True to allow connecting to networks without internet access.
16+
* Add scheduled capture setting (and support for other future quantitative settings)
17+
1218
0.19.6 (April-8-2025)
1319
---------------------
1420
* Update dependencies

demos/python/sdk_wireless_camera_control/open_gopro/api/ble_commands.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,14 @@ async def request_wifi_connect_new(self, *, ssid: str, password: str) -> GoProRe
659659
Returns:
660660
GoProResp[proto.ResponseConnectNew]: Command status of request
661661
"""
662+
# Hard code bypass_eula_check to True.
663+
# On cameras where it is supported, the connection should succeed regardless of whether or not there is internet access.
664+
# On cameras where it is not supported, it should be ignored.
665+
return { # type: ignore
666+
"ssid": ssid,
667+
"password": password,
668+
"bypass_eula_check": True,
669+
}
662670

663671
@ble_proto_command(
664672
uuid=GoProUUID.CQ_COMMAND,

0 commit comments

Comments
 (0)