demo project

Dependencies:   AX-12A Dynamixel mbed iothub_client EthernetInterface NTPClient ConfigFile SDFileSystem iothub_amqp_transport mbed-rtos proton-c-mbed wolfSSL

Committer:
henryrawas
Date:
Tue Jan 19 19:50:07 2016 +0000
Revision:
15:4bd10f531cdc
Parent:
13:ffeff9b5e513
Child:
19:2f0ec9ac1238
read all values at once and cache. Other cleanups

Who changed what in which revision?

UserRevisionLine numberNew contents of line
henryrawas 4:36a4eceb1b7f 1 /*
henryrawas 4:36a4eceb1b7f 2 Copyright (c) 2015 Jonathan Pickett & Microsoft. Some appropriate open source license.
henryrawas 4:36a4eceb1b7f 3 */
henryrawas 4:36a4eceb1b7f 4
henryrawas 4:36a4eceb1b7f 5 #ifndef __ROBOT_NODE_H__
henryrawas 4:36a4eceb1b7f 6 #define __ROBOT_NODE_H__
henryrawas 4:36a4eceb1b7f 7
henryrawas 4:36a4eceb1b7f 8 enum NodeMeasure
henryrawas 4:36a4eceb1b7f 9 {
henryrawas 8:d98e2dec0f40 10 NM_Temperature = 0x1,
henryrawas 8:d98e2dec0f40 11 NM_Voltage = 0x2,
henryrawas 8:d98e2dec0f40 12 NM_Degrees = 0x3,
henryrawas 8:d98e2dec0f40 13 NM_Load = 0x4
henryrawas 4:36a4eceb1b7f 14 };
henryrawas 4:36a4eceb1b7f 15
henryrawas 4:36a4eceb1b7f 16 enum NodeAction
henryrawas 4:36a4eceb1b7f 17 {
henryrawas 12:ac6c9d7f8c40 18 NA_Ping = 0x1,
henryrawas 12:ac6c9d7f8c40 19 NA_Init = 0x2,
henryrawas 12:ac6c9d7f8c40 20 NA_Rotate = 0x3,
henryrawas 12:ac6c9d7f8c40 21 NA_ClearError = 0x4
henryrawas 4:36a4eceb1b7f 22 };
henryrawas 4:36a4eceb1b7f 23
henryrawas 4:36a4eceb1b7f 24 enum NodePartType
henryrawas 4:36a4eceb1b7f 25 {
henryrawas 13:ffeff9b5e513 26 NT_AX12 = 0x1,
henryrawas 13:ffeff9b5e513 27 NT_Emul = 0x7f
henryrawas 4:36a4eceb1b7f 28 };
henryrawas 4:36a4eceb1b7f 29
henryrawas 4:36a4eceb1b7f 30
henryrawas 4:36a4eceb1b7f 31 class RobotNode
henryrawas 4:36a4eceb1b7f 32 {
henryrawas 4:36a4eceb1b7f 33 public:
henryrawas 4:36a4eceb1b7f 34 virtual bool HasMeasure(int measureId) = 0;
henryrawas 4:36a4eceb1b7f 35
henryrawas 4:36a4eceb1b7f 36 virtual float GetMeasure(int measureId) = 0;
henryrawas 4:36a4eceb1b7f 37
henryrawas 15:4bd10f531cdc 38 virtual void ClearMeasureCache() = 0;
henryrawas 4:36a4eceb1b7f 39
henryrawas 4:36a4eceb1b7f 40 virtual bool HasAction(int actionId) = 0;
henryrawas 4:36a4eceb1b7f 41
henryrawas 4:36a4eceb1b7f 42 virtual bool DoAction(int actionId, float actionValue) = 0;
henryrawas 4:36a4eceb1b7f 43
henryrawas 7:6723f6887d00 44 virtual int GetLastError() = 0;
henryrawas 4:36a4eceb1b7f 45
henryrawas 9:a0fb6c370dbb 46 virtual bool HasError() = 0;
henryrawas 9:a0fb6c370dbb 47
henryrawas 4:36a4eceb1b7f 48 virtual NodePartType GetNodeType() = 0;
henryrawas 4:36a4eceb1b7f 49 };
henryrawas 4:36a4eceb1b7f 50
henryrawas 4:36a4eceb1b7f 51 #endif