Jump to content
View in the app

A better way to browse. Learn more.

Tinkerunity

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

LeonidasFett

Members
  • Benutzer seit

  • Letzter Besuch

  1. Hallo Leute, ich bin noch blutiger Tinkerforge Anfänger und versuche eine WebAPI zu schreiben, die mir die Werte aller Sensoren zurückgibt, die an einem Raspberry PI angeschlossen sind. Dazu habe ich mir die API Bindings für C# angeguckt. Dafür habe ich folgenden Code geschrieben: public class TinkerforgeController : Controller { [HttpGet("GetValues")] public JsonResult GetValues([FromQuery]string ip, [FromQuery]int port) { var service = new TinkerforgeClientService(ip, port); var values = service.GetValues(); return Json(values); } } public class TinkerforgeClientService { private IPConnection _conn; private List<SensorValue> _values = new List<SensorValue>(); private string _ip = string.Empty; private int _port = 0; public TinkerforgeClientService(string ip, int port) { _ip = ip; _port = port; _conn = new IPConnection(); _conn.EnumerateCallback += EnumerateCallBack; _conn.Connect(ip, port); } private void EnumerateCallBack(IPConnection sender, string uid, string connectedUid, char position, short[] hardwareVersion, short[] firmwareVersion, int deviceIdentifier, short enumerationType) { var sensor = SensorFactory.GetSensor(deviceIdentifier, _ip, _port, uid); _values.Add(sensor.GetValue()); } public SensorValue[] GetValues() { _conn.Enumerate(); return _values.ToArray(); } } Mein Problem ist den Code so zu schreiben, dass EnumerateCallBack komplett für alle Sensoren durchläuft, bevor return _values.ToArray(); aufgerufen wird. In der API gibt es die Methoden Wait() und Unwait() allerdings keine Beispiele wie man diese benutzt. Kann mir da jemand weiterhelfen?

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.