Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose docs for websocket Matter/Thread functions #3579

Merged
merged 1 commit into from
Jun 19, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,38 @@ interface WebSocketRepository {
suspend fun getTemplateUpdates(template: String): Flow<TemplateUpdatedEvent>?
suspend fun getNotifications(): Flow<Map<String, Any>>?
suspend fun ackNotification(confirmId: String): Boolean

/**
* Request the server to add a Matter device to the network and commission it.
* @return [MatterCommissionResponse] detailing the server's response, or `null` if the server
* did not return a response.
*/
suspend fun commissionMatterDevice(code: String): MatterCommissionResponse?

/**
* Request the server to commission a Matter device that is already on the network.
* @return [MatterCommissionResponse] detailing the server's response, or `null` if the server
* did not return a response.
*/
suspend fun commissionMatterDeviceOnNetwork(pin: Long): MatterCommissionResponse?

/**
* Return a list of all Thread datasets known to the server.
* @return List with [ThreadDatasetResponse]s, or `null` if not an admin or no response.
*/
suspend fun getThreadDatasets(): List<ThreadDatasetResponse>?

/**
* Return the TLV value for a dataset.
* @return [ThreadDatasetTlvResponse] for the Thread dataset, or `null` if not found, not an
* admin or no response.
*/
suspend fun getThreadDatasetTlv(datasetId: String): ThreadDatasetTlvResponse?

/**
* Add a new set of Thread network credentials to the server.
* @return `true` if the server indicated success
*/
suspend fun addThreadDataset(tlv: ByteArray): Boolean

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,11 +370,6 @@ class WebSocketRepositoryImpl @AssistedInject constructor(
return response?.success == true
}

/**
* Request the server to add a Matter device to the network and commission it
* @return [MatterCommissionResponse] detailing the server's response, or `null` if the server
* did not return a response
*/
override suspend fun commissionMatterDevice(code: String): MatterCommissionResponse? {
val response = sendMessage(
WebSocketRequest(
Expand All @@ -400,11 +395,6 @@ class WebSocketRepositoryImpl @AssistedInject constructor(
}
}

/**
* Request the server to commission a Matter device that is already on the network
* @return [MatterCommissionResponse] detailing the server's response, or `null` if the server
* did not return a response
*/
override suspend fun commissionMatterDeviceOnNetwork(pin: Long): MatterCommissionResponse? {
val response = sendMessage(
WebSocketRequest(
Expand All @@ -430,10 +420,6 @@ class WebSocketRepositoryImpl @AssistedInject constructor(
}
}

/**
* Return a list of all Thread datasets known to the server.
* @return List with [ThreadDatasetResponse]s, or `null` if not an admin or no response.
*/
override suspend fun getThreadDatasets(): List<ThreadDatasetResponse>? {
val response = sendMessage(
mapOf(
Expand All @@ -447,11 +433,6 @@ class WebSocketRepositoryImpl @AssistedInject constructor(
}
}

/**
* Return the TLV value for a dataset.
* @return [ThreadDatasetTlvResponse] for the Thread dataset, or `null` if not found, not an
* admin or no response.
*/
override suspend fun getThreadDatasetTlv(datasetId: String): ThreadDatasetTlvResponse? {
val response = sendMessage(
mapOf(
Expand All @@ -463,10 +444,6 @@ class WebSocketRepositoryImpl @AssistedInject constructor(
return mapResponse(response)
}

/**
* Add a new set of Thread network credentials to the server.
* @return `true` if the server indicated success
*/
override suspend fun addThreadDataset(tlv: ByteArray): Boolean {
val response = sendMessage(
mapOf(
Expand Down