Expose docs for websocket Matter/Thread functions (#3579)

This commit is contained in:
Joris Pelgröm 2023-06-19 20:10:00 +02:00 committed by GitHub
parent 5d1801cb01
commit 4c7549080b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 23 deletions

View file

@ -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
/**

View file

@ -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(
@ -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(
@ -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(
@ -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(
@ -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(