
ControllerBox directs electromechanical equipment in restaurants to display information.
Dependencies: TextLCD MbedJSONValue libMotiv picojson mbed-rtos mbed
Fork of Mbed_MotiVControllerBox by
library/Device.cpp@1:d54aed10ddf3, 2014-11-15 (annotated)
- Committer:
- TimWoo
- Date:
- Sat Nov 15 13:04:09 2014 +0000
- Revision:
- 1:d54aed10ddf3
- Parent:
- devices/Device.cpp@0:2279181caaa1
Dirty testing stage. Testing ethernet/internet connection
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
TimWoo | 0:2279181caaa1 | 1 | #include "Device.h" |
TimWoo | 1:d54aed10ddf3 | 2 | #include <stdlib.h> |
TimWoo | 1:d54aed10ddf3 | 3 | |
TimWoo | 1:d54aed10ddf3 | 4 | |
TimWoo | 1:d54aed10ddf3 | 5 | |
TimWoo | 1:d54aed10ddf3 | 6 | using namespace std; |
TimWoo | 0:2279181caaa1 | 7 | |
TimWoo | 1:d54aed10ddf3 | 8 | Device::Device() |
TimWoo | 1:d54aed10ddf3 | 9 | :id(0) {} |
TimWoo | 0:2279181caaa1 | 10 | |
TimWoo | 1:d54aed10ddf3 | 11 | Device::Device(int id) |
TimWoo | 1:d54aed10ddf3 | 12 | :id(id) {} |
TimWoo | 1:d54aed10ddf3 | 13 | |
TimWoo | 1:d54aed10ddf3 | 14 | Device::~Device() |
TimWoo | 0:2279181caaa1 | 15 | { |
TimWoo | 0:2279181caaa1 | 16 | |
TimWoo | 0:2279181caaa1 | 17 | } |
TimWoo | 0:2279181caaa1 | 18 | |
TimWoo | 1:d54aed10ddf3 | 19 | Device::Device(const Device& d) |
TimWoo | 0:2279181caaa1 | 20 | { |
TimWoo | 1:d54aed10ddf3 | 21 | id = d.id; |
TimWoo | 1:d54aed10ddf3 | 22 | } |
TimWoo | 1:d54aed10ddf3 | 23 | |
TimWoo | 1:d54aed10ddf3 | 24 | Device& Device::operator=(const Device& d) |
TimWoo | 1:d54aed10ddf3 | 25 | { |
TimWoo | 1:d54aed10ddf3 | 26 | id = d.id; |
TimWoo | 1:d54aed10ddf3 | 27 | return *this; |
TimWoo | 0:2279181caaa1 | 28 | } |
TimWoo | 0:2279181caaa1 | 29 | |
TimWoo | 1:d54aed10ddf3 | 30 | int Device::getId() const |
TimWoo | 1:d54aed10ddf3 | 31 | { |
TimWoo | 1:d54aed10ddf3 | 32 | return id; |
TimWoo | 1:d54aed10ddf3 | 33 | } |
TimWoo | 1:d54aed10ddf3 | 34 | |
TimWoo | 1:d54aed10ddf3 | 35 | Device::mCommand Device::makeCommand(int cmd, int value) |
TimWoo | 0:2279181caaa1 | 36 | { |
TimWoo | 1:d54aed10ddf3 | 37 | mCommand rc; |
TimWoo | 1:d54aed10ddf3 | 38 | rc.id = id; |
TimWoo | 1:d54aed10ddf3 | 39 | rc.cmd = cmd; |
TimWoo | 1:d54aed10ddf3 | 40 | rc.val = value; |
TimWoo | 1:d54aed10ddf3 | 41 | rc.delim = DELIMITER; |
TimWoo | 1:d54aed10ddf3 | 42 | return rc; |
TimWoo | 0:2279181caaa1 | 43 | } |