| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Fietsclient
- {
- public class AppGlobal
- {
- private static AppGlobal _instance;
- public static AppGlobal Instance
- {
- get { return _instance ?? (_instance = new AppGlobal()); }
- }
- private KettlerBikeComm _bikeComm;
- private AppGlobal()
- {
- _bikeComm = new KettlerBikeComm();
- KettlerBikeComm.IncomingDataEvent += HandleBikeData; //initialize event
- }
- public void startComPort()
- {
- startComPort("COM5");
- }
- public void startComPort(string portname)
- {
- _bikeComm.initComm(portname);
- }
- //event handler
- private void HandleBikeData(string[] data)
- {
- //doe iets ermee...
- }
- }
- }
|