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; } } }
// 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; } } }
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; } } }