Skip to content

Commit 51dbc8b

Browse files
authored
Add telemetry data (#153)
***NO_CI***
1 parent 8e7d297 commit 51dbc8b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

nanoFramework.Azure.Devices.Client/DeviceClient.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,16 @@ public bool Open()
160160
if (!string.IsNullOrEmpty(ModelId))
161161
{
162162
userName += $"&model-id={HttpUtility.UrlEncode(ModelId)}";
163-
164163
}
165164

165+
// compose product info
166+
string productInfo = "nano;";
167+
productInfo += $"azrsdk{ThisAssembly.AssemblyInformationalVersion};";
168+
productInfo += $"{Runtime.Native.SystemInfo.TargetName}";
169+
170+
// add to user name
171+
userName += $"&DeviceClientType={HttpUtility.UrlEncode(productInfo)}";
172+
166173
// Now connect the device
167174
string key = _isCertificate ? _privateKey : Helper.GetSharedAccessSignature(null, _sasKey, $"{_iotHubName}/devices/{_deviceId}", new TimeSpan(24, 0, 0));
168175
_mqttc.Connect(

0 commit comments

Comments
 (0)