File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,16 @@ uint8_t AntPlusRouter::getMaxChannels() {
9090 return _maxChannels;
9191}
9292
93+ uint8_t AntPlusRouter::addProfileToNextChannel (BaseProfile* profile) {
94+ for (uint8_t i = 0 ; i < _maxChannels; i++) {
95+ if (!_profiles[i]) {
96+ setProfile (i, profile);
97+ return i;
98+ }
99+ }
100+ return 255 ; // TODO change this to a define
101+ }
102+
93103void AntPlusRouter::loop () {
94104 _ant->loop ();
95105}
Original file line number Diff line number Diff line change @@ -28,6 +28,12 @@ class AntPlusRouter {
2828 * Associates a profile with a channel
2929 */
3030 void setProfile (uint8_t channel, BaseProfile* profile);
31+ /* *
32+ * Associates a profile with the next lowest available channel
33+ * returns associated channel, if all channels full then it
34+ * returns TODO
35+ */
36+ uint8_t addProfileToNextChannel (BaseProfile* profile);
3137 /* *
3238 * Stops a provile at the given channel
3339 * Unassigns channel
You can’t perform that action at this time.
0 commit comments