Skip to content

Commit

Permalink
Merge pull request #330 from microsoft/jsonext
Browse files Browse the repository at this point in the history
Add netremote-server JSON schema and example file.
  • Loading branch information
abeltrano authored Jul 30, 2024
2 parents bf81dee + 5bd4426 commit a2d07ad
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
32 changes: 32 additions & 0 deletions config/netremote-server-config-schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/microsoft/netremote/tree/develop/config/netremote-server-config-schema.json",
"$title": "NetRemote Server",
"description": "NetRemote Server Configuration Schema",
"type": "object",
"additionalProperties": false,
"properties": {
"$schema": {
"type": "string",
"description": "The schema version"
},
"WifiAccessPointAttributes": {
"type": "object",
"description": "Wifi Access Point Attributes",
"additionalProperties": false,
"properties": {
"Properties": {
"type": "object",
"description": "Unstructured (string) Wifi Access Point Properties",
"additionalProperties": {
"type": "object",
"additionalProperties": {
"type": "string",
"description": "Additional properties"
}
}
}
}
}
}
}
1 change: 1 addition & 0 deletions src/common/net/wifi/apmanager/AccessPointManager.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ AccessPointManager::GetAllAccessPoints() const
std::optional<AccessPointAttributes>
AccessPointManager::GetAccessPointAttributes(const std::string& interfaceName) const
{
// Note: no locks are used here because m_accessPointAttributes cannot be modified after construction.
auto accessPointAttributesIterator = m_accessPointAttributes.find(interfaceName);
if (accessPointAttributesIterator == std::cend(m_accessPointAttributes)) {
return std::nullopt;
Expand Down
16 changes: 16 additions & 0 deletions src/common/server/config/netremote-server-config-example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "../../../../config/netremote-server-config-schema.json",
"WifiAccessPointAttributes": {
"Properties": {
"wlan0": {
"MacAddress": "00:11:22:33:44:55",
"RfAttenuatorChannelsAttached": "1,3"
},
"wlp0s3": {
"MacAddress": "AA:BB:CC:DD:EE:FF",
"RfAttenuatorChannelsAttached": "2,4,6",
"Another": "String value"
}
}
}
}

0 comments on commit a2d07ad

Please sign in to comment.