Skip to content

Commit 0953281

Browse files
committed
Remove magic numbers
1 parent ff60be8 commit 0953281

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

examples/OpenChannel/OpenChannel.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void setup()
5151

5252
ac = AssignChannel();
5353
ac.setChannel(0);
54-
ac.setChannelType(0);
54+
ac.setChannelType(CHANNEL_TYPE_BIDIRECTIONAL_RECIEVE);
5555
ac.setChannelNetwork(0);
5656
ant.send(ac);
5757
parseMessage();

examples/TxCounter/TxCounter.ino

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
* network key and transmits data
66
* increments in value every second
77
*
8+
* NOTE: THIS EXAMPLE IS INCOMPLETE
9+
*
810
* Author Curtis Malainey
911
************************************/
1012

@@ -46,7 +48,7 @@ void setup()
4648

4749
ac = AssignChannel();
4850
ac.setChannel(0);
49-
ac.setChannelType(0);
51+
ac.setChannelType(CHANNEL_TYPE_BIDIRECTIONAL_TRANSMIT);
5052
ac.setChannelNetwork(0);
5153
ant.send(ac);
5254
parseMessage();

src/ANT.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,16 @@
115115
// #define EXTENDED_ACKNOWLEDGED_DATA 0x5E
116116
// #define EXTENDED_BURST_DATA 0x5F
117117

118+
/**
119+
* Channel Type Codes
120+
*/
121+
#define CHANNEL_TYPE_BIDIRECTIONAL_RECIEVE 0x00
122+
#define CHANNEL_TYPE_BIDIRECTIONAL_TRANSMIT 0x10
123+
#define CHANNEL_TYPE_UNIDIRECTIONAL_RECIEVE 0x50
124+
#define CHANNEL_TYPE_UNIDIRECTIONAL_TRANSMIT 0x40
125+
#define CHANNEL_TYPE_SHARED_RECIEVE 0x20
126+
#define CHANNEL_TYPE_SHARED_TRANSMIT 0x30
127+
118128
/**
119129
* Channel Response Message Codes
120130
*/

0 commit comments

Comments
 (0)