Baseline for testing

Committer:
foxbrianr
Date:
Thu Sep 12 11:28:05 2019 +0000
Revision:
1:a2073f60d3a6
Parent:
0:e24f6400a8c8
Child:
2:180c90fb759c
beta1

Who changed what in which revision?

UserRevisionLine numberNew contents of line
foxbrianr 1:a2073f60d3a6 1 #ifndef _ADDRESS_MAP_
foxbrianr 1:a2073f60d3a6 2 #define _ADDRESS_MAP_
foxbrianr 0:e24f6400a8c8 3
foxbrianr 0:e24f6400a8c8 4 #include "mbed.h"
foxbrianr 0:e24f6400a8c8 5
foxbrianr 1:a2073f60d3a6 6 #define MAX_ADDR_LENGTH 20
foxbrianr 0:e24f6400a8c8 7 #define MAX_ADDRESSES 100
foxbrianr 0:e24f6400a8c8 8
foxbrianr 0:e24f6400a8c8 9 class Address
foxbrianr 0:e24f6400a8c8 10 {
foxbrianr 0:e24f6400a8c8 11 public:
foxbrianr 0:e24f6400a8c8 12
foxbrianr 0:e24f6400a8c8 13 int address;
foxbrianr 0:e24f6400a8c8 14 char description[MAX_ADDR_LENGTH];
foxbrianr 1:a2073f60d3a6 15
foxbrianr 1:a2073f60d3a6 16 Address () {
foxbrianr 1:a2073f60d3a6 17 }
foxbrianr 1:a2073f60d3a6 18
foxbrianr 1:a2073f60d3a6 19 Address (const Address &obj) {
foxbrianr 1:a2073f60d3a6 20 // body of constructor
foxbrianr 1:a2073f60d3a6 21 address = obj.address;
foxbrianr 1:a2073f60d3a6 22 strcpy(description, obj.description);
foxbrianr 1:a2073f60d3a6 23 }
foxbrianr 1:a2073f60d3a6 24
foxbrianr 1:a2073f60d3a6 25 Address operator=(const Address& b) {
foxbrianr 1:a2073f60d3a6 26 Address a (b);
foxbrianr 1:a2073f60d3a6 27 return a;
foxbrianr 1:a2073f60d3a6 28 }
foxbrianr 0:e24f6400a8c8 29
foxbrianr 0:e24f6400a8c8 30 };
foxbrianr 0:e24f6400a8c8 31
foxbrianr 0:e24f6400a8c8 32 class AddressMap
foxbrianr 0:e24f6400a8c8 33 {
foxbrianr 0:e24f6400a8c8 34
foxbrianr 0:e24f6400a8c8 35 public:
foxbrianr 0:e24f6400a8c8 36
foxbrianr 0:e24f6400a8c8 37 Address addresses[MAX_ADDRESSES];
foxbrianr 0:e24f6400a8c8 38
foxbrianr 1:a2073f60d3a6 39 int reset();
foxbrianr 1:a2073f60d3a6 40 int init();
foxbrianr 0:e24f6400a8c8 41 int load();
foxbrianr 1:a2073f60d3a6 42 int save();
foxbrianr 1:a2073f60d3a6 43
foxbrianr 0:e24f6400a8c8 44 void display(Serial *pc);
foxbrianr 0:e24f6400a8c8 45 //void add(int event, char* timeStamp);
foxbrianr 0:e24f6400a8c8 46 //void clear();
foxbrianr 1:a2073f60d3a6 47 char* getDescription(unsigned char idx );
foxbrianr 0:e24f6400a8c8 48
foxbrianr 0:e24f6400a8c8 49 void play(Serial *pc, int address);
foxbrianr 1:a2073f60d3a6 50 };
foxbrianr 1:a2073f60d3a6 51
foxbrianr 1:a2073f60d3a6 52 #endif