Wyatt  1.0.1
Hardware.cpp
1 #include "Hardware.h"
2 
3 bool operator < (const Hardware &a, const Hardware &b)
4 {
5  return a.address < b.address;
6 };
7 
8 bool operator == (const Hardware &a, const Hardware &b)
9 {
10  return (a.address == b.address) && (a.messageLength == b.messageLength);
11 };
12 
13 const Hardware H_RIGHT_MOTOR = {
14  .address = RIGHT_MOTOR_ADDRESS,
15  .messageLength = sizeof(int),
16 };
17 
18 const Hardware H_LEFT_MOTOR = {
19  .address = LEFT_MOTOR_ADDRESS,
20  .messageLength = sizeof(int),
21 };
22 
23 const Hardware H_RIGHT_ENCODER = {
24  .address = RIGHT_ENCODER_ADDRESS,
25  .messageLength = sizeof(double),
26 };
27 
28 const Hardware H_LEFT_ENCODER = {
29  .address = LEFT_ENCODER_ADDRESS,
30  .messageLength = sizeof(double),
31 };
32 
33 const Hardware HARDWARE_MAP[] = {
34  H_RIGHT_MOTOR,
35  H_LEFT_MOTOR,
36  H_LEFT_ENCODER,
37  H_RIGHT_ENCODER
38 };