ControllerBox directs electromechanical equipment in restaurants to display information.
Dependencies: EthernetInterface HTTPClient_KVplus MbedJSONValue SDFileSystem TextLCD mbed-rtos mbed picojson
Diff: libMotiv/Device.h
- Revision:
- 3:21c8adb97c8f
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libMotiv/Device.h Thu Dec 04 22:26:30 2014 +0000 @@ -0,0 +1,64 @@ +#ifndef MOTIV_DEVICE_H +#define MOTIV_DEVICE_H + +#include <string> + +#define DELIMITER ';' + +//a default constructor that takes no arguments +//a copy constructor ex: book(const &book b); +//an overloaded assignment operato + +class MCommand +{ + public: + + MCommand(); + MCommand(char id, char cmd, char val); + ~MCommand(); + + MCommand& operator=(const MCommand& mc); + + char getId(), getCmd(), getVal(); + void print(); + + private: + char id, cmd, val; +}; + + + +class Device +{ +public: + Device(); + Device(int id); + ~Device(); + + Device(const Device& d); + Device& operator=(const Device& d); + + int getId() const; + +//private: +// struct mCommand { //3 chars to be sent to the hardware +// char id; //device id +// char cmd; //command number +// char val; //command specific value +// char delim; //delimiter +// }; + /** + mCommand buildCommand(int,int); + */ + MCommand buildCommand(char cmd, char value); + +protected: + + int id; + +private: + + +}; + +#endif \ No newline at end of file