Skip to content

Commit b11a477

Browse files
committed
Broadcast example and example bug fixes
1 parent 7e0728e commit b11a477

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

examples/OpenChannel/OpenChannel.ino

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ void setup()
3030
ChannelRfFrequency crf;
3131
OpenChannel oc;
3232

33-
Serial1.begin(9600);
33+
Serial1.begin(BAUD_RATE);
3434
// this will be moved into the driver eventually
3535
#if defined(CORE_TEENSY)
3636
Serial1.attachCts(20);
@@ -89,7 +89,6 @@ void loop()
8989

9090
void parseMessage() {
9191
ant.readPacket();
92-
Serial.println("");
9392
if (ant.getResponse().isAvailable()) {
9493
uint8_t msgId = ant.getResponse().getMsgId();
9594
switch (msgId) {

src/ANT.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,12 @@ BroadcastData::BroadcastData() : AntRxDataResponse() {
123123
}
124124

125125
uint8_t BroadcastData::getChannelNumber() {
126-
return getData(0);
126+
return AntRxDataResponse::getData(0);
127127
}
128128

129129
uint8_t BroadcastData::getData(uint8_t index) {
130130
// skip channel byte
131-
return getData(index + 1);
131+
return AntRxDataResponse::getData(index + 1);
132132
}
133133

134134
uint8_t BroadcastData::getExtendedDataLength() {
@@ -181,11 +181,11 @@ AntRxDataResponse::AntRxDataResponse() : AntResponse() {
181181
}
182182

183183
uint8_t AntRxDataResponse::getData(int index) {
184-
return getFrameData()[getDataOffset() + index];
184+
return getFrameData()[index];
185185
}
186186

187187
uint8_t* AntRxDataResponse::getData() {
188-
return getFrameData() + getDataOffset();
188+
return getFrameData();
189189
}
190190

191191
uint8_t AntRxDataResponse::getDataOffset() {

0 commit comments

Comments
 (0)