示例#1
0
 public void AddDevice(Device device)
 {
     for(byte i = 0; i < _Devices.Length; i++)
     {
         if(_Devices[i] == null)
         {
             _Devices[i] = device;
             device.Connection = connection;
             AntInternal.ANT_AssignChannel(i, ChannelType.SLAVE, _Network);
             break;
         }
     }
 }
示例#2
0
 // Always an 8 byte array to send
 public void SendBroadcastData(Device device, byte [] data)
 {
     for(byte i = 0; i < _Devices.Length; i++)
     {
         if(_Devices[i] == device) {
             AntInternal.ANT_SendBroadcastData(i, data);
             break;
         }
     }
 }
示例#3
0
 public void RemoveDevice(Device device)
 {
     for(byte i = 0; i < _Devices.Length; i++)
     {
         if(_Devices[i] == device)
         {
             AntInternal.ANT_CloseChannel(i);
             // TODO: Wait for channel to close/unassign before returning
             _Devices[i] = null;
             break;
         }
     }
 }