Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,12 @@ internal class ConnectNewAccessPoint(val ssid: String, val password: String) :
.executeProtobufCommand(
FeatureId.NETWORK_MANAGEMENT,
ActionId.REQUEST_WIFI_CONNECT_NEW,
RequestConnectNew(ssid = ssid, password = password).encodeToByteArray(),
// Hard code bypass_eula_check to True.
// On cameras where it is supported, the connection should succeed regardless of whether
// or not there is internet access.
// On cameras where it is not supported, it should be ignore
RequestConnectNew(ssid = ssid, password = password, bypassEulaCheck = true)
.encodeToByteArray(),
ResponseId.Protobuf(
FeatureId.NETWORK_MANAGEMENT, ActionId.REQUEST_WIFI_CONNECT_NEW_RSP),
GpUuid.CM_NET_MGMT_COMM)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import com.gopro.open_gopro.domain.communicator.bleCommunicator.bleFragment
import com.gopro.open_gopro.entity.communicator.ActionId
import com.gopro.open_gopro.entity.communicator.FeatureId
import com.gopro.open_gopro.entity.network.ble.GpUuid
import com.gopro.open_gopro.gopro.CameraInternalError
import com.gopro.open_gopro.operations.commands.AccessPointGetScanResults
import com.gopro.open_gopro.operations.commands.AccessPointScan
import com.gopro.open_gopro.operations.commands.ConnectNewAccessPoint
Expand Down Expand Up @@ -337,6 +338,7 @@ class TestBleCommands {

// THEN
assertTrue { result.isFailure }
assertTrue { result.exceptionOrNull() is CameraInternalError }
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package fakes

import com.benasher44.uuid.Uuid
import com.gopro.open_gopro.domain.communicator.BleCommunicator
import com.gopro.open_gopro.domain.communicator.bleCommunicator.AccumulatedGpBleResponse
import com.gopro.open_gopro.domain.communicator.bleCommunicator.bleFragment
import com.gopro.open_gopro.domain.network.IBleApi
import com.gopro.open_gopro.entity.network.ble.BleAdvertisement
Expand Down Expand Up @@ -86,6 +87,8 @@ internal class FakeBleApi(

private var messageCounter = 0

private var accumulatingResponse: AccumulatedGpBleResponse? = null

var shouldWriteSucceed = true

suspend fun sendNextMessage() {
Expand Down Expand Up @@ -126,7 +129,17 @@ internal class FakeBleApi(
data: UByteArray
): Result<Unit> {
spies += BleApiSpy.Write(device, uuid, data)
sendNextMessage()
// We need to accumulate potentially partial write payloads here and only send the next BLE
// response on the next message
// For now, we assume there is only ever one concurrent accumulating response
accumulatingResponse =
(accumulatingResponse ?: AccumulatedGpBleResponse(GpUuid.fromUuid(uuid)!!)).apply {
accumulate(data)
}
if (accumulatingResponse?.isReceived == true) {
sendNextMessage()
accumulatingResponse = null
}
return Result.success(Unit)
}

Expand Down
6 changes: 6 additions & 0 deletions demos/python/sdk_wireless_camera_control/docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ All notable changes to this project will be documented in this file.
The format is based on `Keep a Changelog <https://keepachangelog.com/en/1.0.0/>`_,
and this project adheres to `Semantic Versioning <https://semver.org/spec/v2.0.0.html>`_.

0.19.7 (April-28-2025)
----------------------
* Add Reboot Command
* Hardcode bypass_eula_check to True to allow connecting to networks without internet access.
* Add scheduled capture setting (and support for other future quantitative settings)

0.19.6 (April-8-2025)
---------------------
* Update dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,14 @@ async def request_wifi_connect_new(self, *, ssid: str, password: str) -> GoProRe
Returns:
GoProResp[proto.ResponseConnectNew]: Command status of request
"""
# Hard code bypass_eula_check to True.
# On cameras where it is supported, the connection should succeed regardless of whether or not there is internet access.
# On cameras where it is not supported, it should be ignored.
return { # type: ignore
"ssid": ssid,
"password": password,
"bypass_eula_check": True,
}

@ble_proto_command(
uuid=GoProUUID.CQ_COMMAND,
Expand Down