We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi, can you add the support to change the network settings of a device?
At the moment I use this snipped to set a IPv4 configuration, but it would be nice to have this feature in the wrapper.
`HttpClient client = new HttpClient(); // client.BaseAddress = new System.Uri(DevicePortalAddress, UriKind.RelativeOrAbsolute); // client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue( "Basic", Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes( string.Format("{0}:{1}", .DevicePortalUsername, DevicePortalPassword))) ); var newConfig = new NetworkConfiguration() { AdapterName = AdapterName, IPAddress = IPAddress, SubnetMask = SubnetMask, DefaultGateway = DefaultGateway, PrimaryDNS = PrimaryDNS, SecondryDNS = SecondryDNS }; // string json = JsonConvert.SerializeObject(newConfig); // HttpContent content = new StringContent(json); // await client.PutAsync("api/networking/ipv4config", content);
internal class NetworkConfiguration {
public string AdapterName { get; set; } public string IPAddress { get; set; } public string SubnetMask { get; set; } public string DefaultGateway { get; set; } public string PrimaryDNS { get; set; } public string SecondryDNS { get; set; } }
`
Thanks
lg
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
can you add the support to change the network settings of a device?
At the moment I use this snipped to set a IPv4 configuration, but it would be nice to have this feature in the wrapper.
`HttpClient client = new HttpClient();
//
client.BaseAddress = new System.Uri(DevicePortalAddress, UriKind.RelativeOrAbsolute);
//
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(
"Basic", Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes(
string.Format("{0}:{1}", .DevicePortalUsername, DevicePortalPassword)))
);
var newConfig = new NetworkConfiguration() {
AdapterName = AdapterName,
IPAddress = IPAddress,
SubnetMask = SubnetMask,
DefaultGateway = DefaultGateway,
PrimaryDNS = PrimaryDNS,
SecondryDNS = SecondryDNS
};
//
string json = JsonConvert.SerializeObject(newConfig);
//
HttpContent content = new StringContent(json);
//
await client.PutAsync("api/networking/ipv4config", content);
internal class NetworkConfiguration {
`
Thanks
lg
The text was updated successfully, but these errors were encountered: