Skip to content

Commit ea0e306

Browse files
authored
Merge pull request #477 from tekka007/StaticENUMS
Define static enums in MyMessage
2 parents 258037c + c6125a4 commit ea0e306

File tree

1 file changed

+149
-158
lines changed

1 file changed

+149
-158
lines changed

libraries/MySensors/core/MyMessage.h

Lines changed: 149 additions & 158 deletions
Original file line numberDiff line numberDiff line change
@@ -43,186 +43,177 @@
4343

4444
/// @brief The command field (message-type) defines the overall properties of a message
4545
typedef enum {
46-
C_PRESENTATION = 0, //!< Sent by a node when they present attached sensors. This is usually done in presentation() at startup.
47-
C_SET = 1, //!< This message is sent from or to a sensor when a sensor value should be updated.
48-
C_REQ = 2, //!< Requests a variable value (usually from an actuator destined for controller).
49-
C_INTERNAL = 3, //!< Internal MySensors messages (also include common messages provided/generated by the library).
50-
C_STREAM = 4 //!< For firmware and other larger chunks of data that need to be divided into pieces.
46+
C_PRESENTATION = 0, //!< Sent by a node when they present attached sensors. This is usually done in presentation() at startup.
47+
C_SET = 1, //!< This message is sent from or to a sensor when a sensor value should be updated.
48+
C_REQ = 2, //!< Requests a variable value (usually from an actuator destined for controller).
49+
C_INTERNAL = 3, //!< Internal MySensors messages (also include common messages provided/generated by the library).
50+
C_STREAM = 4 //!< For firmware and other larger chunks of data that need to be divided into pieces.
5151
} mysensor_command;
5252

5353
/// @brief Type of sensor (used when presenting sensors)
5454
typedef enum {
55-
S_DOOR, // Door sensor, V_TRIPPED, V_ARMED
56-
S_MOTION, // Motion sensor, V_TRIPPED, V_ARMED
57-
S_SMOKE, // Smoke sensor, V_TRIPPED, V_ARMED
58-
S_LIGHT, // Binary light or relay, V_STATUS (or V_LIGHT), V_WATT
59-
S_BINARY=3, // Binary light or relay, V_STATUS (or V_LIGHT), V_WATT (same as S_LIGHT)
60-
S_DIMMER, // Dimmable light or fan device, V_STATUS (on/off), V_DIMMER (dimmer level 0-100), V_WATT
61-
S_COVER, // Blinds or window cover, V_UP, V_DOWN, V_STOP, V_DIMMER (open/close to a percentage)
62-
S_TEMP, // Temperature sensor, V_TEMP
63-
S_HUM, // Humidity sensor, V_HUM
64-
S_BARO, // Barometer sensor, V_PRESSURE, V_FORECAST
65-
S_WIND, // Wind sensor, V_WIND, V_GUST
66-
S_RAIN, // Rain sensor, V_RAIN, V_RAINRATE
67-
S_UV, // Uv sensor, V_UV
68-
S_WEIGHT, // Personal scale sensor, V_WEIGHT, V_IMPEDANCE
69-
S_POWER, // Power meter, V_WATT, V_KWH, V_VAR, V_VA, V_POWER_FACTOR
70-
S_HEATER, // Header device, V_HVAC_SETPOINT_HEAT, V_HVAC_FLOW_STATE, V_TEMP
71-
S_DISTANCE, // Distance sensor, V_DISTANCE
72-
S_LIGHT_LEVEL, // Light level sensor, V_LIGHT_LEVEL (uncalibrated in percentage), V_LEVEL (light level in lux)
73-
S_ARDUINO_NODE, // Used (internally) for presenting a non-repeating Arduino node
74-
S_ARDUINO_REPEATER_NODE, // Used (internally) for presenting a repeating Arduino node
75-
S_LOCK, // Lock device, V_LOCK_STATUS
76-
S_IR, // Ir device, V_IR_SEND, V_IR_RECEIVE
77-
S_WATER, // Water meter, V_FLOW, V_VOLUME
78-
S_AIR_QUALITY, // Air quality sensor, V_LEVEL
79-
S_CUSTOM, // Custom sensor
80-
S_DUST, // Dust sensor, V_LEVEL
81-
S_SCENE_CONTROLLER, // Scene controller device, V_SCENE_ON, V_SCENE_OFF.
82-
S_RGB_LIGHT, // RGB light. Send color component data using V_RGB. Also supports V_WATT
83-
S_RGBW_LIGHT, // RGB light with an additional White component. Send data using V_RGBW. Also supports V_WATT
84-
S_COLOR_SENSOR, // Color sensor, send color information using V_RGB
85-
S_HVAC, // Thermostat/HVAC device. V_HVAC_SETPOINT_HEAT, V_HVAC_SETPOINT_COLD, V_HVAC_FLOW_STATE, V_HVAC_FLOW_MODE, V_TEMP
86-
S_MULTIMETER, // Multimeter device, V_VOLTAGE, V_CURRENT, V_IMPEDANCE
87-
S_SPRINKLER, // Sprinkler, V_STATUS (turn on/off), V_TRIPPED (if fire detecting device)
88-
S_WATER_LEAK, // Water leak sensor, V_TRIPPED, V_ARMED
89-
S_SOUND, // Sound sensor, V_TRIPPED, V_ARMED, V_LEVEL (sound level in dB)
90-
S_VIBRATION, // Vibration sensor, V_TRIPPED, V_ARMED, V_LEVEL (vibration in Hz)
91-
S_MOISTURE, // Moisture sensor, V_TRIPPED, V_ARMED, V_LEVEL (water content or moisture in percentage?)
92-
S_INFO, // LCD text device / Simple information device on controller, V_TEXT
93-
S_GAS, // Gas meter, V_FLOW, V_VOLUME
94-
S_GPS, // GPS Sensor, V_POSITION
95-
S_WATER_QUALITY,// V_TEMP, V_PH, V_ORP, V_EC, V_STATUS
55+
S_DOOR = 0, //!< Door sensor, V_TRIPPED, V_ARMED
56+
S_MOTION = 1, //!< Motion sensor, V_TRIPPED, V_ARMED
57+
S_SMOKE = 2, //!< Smoke sensor, V_TRIPPED, V_ARMED
58+
S_BINARY = 3, //!< Binary light or relay, V_STATUS, V_WATT
59+
S_LIGHT = 3, //!< \deprecated Same as S_BINARY, **** DEPRECATED, DO NOT USE ****
60+
S_DIMMER = 4, //!< Dimmable light or fan device, V_STATUS (on/off), V_PERCENTAGE (dimmer level 0-100), V_WATT
61+
S_COVER = 5, //!< Blinds or window cover, V_UP, V_DOWN, V_STOP, V_PERCENTAGE (open/close to a percentage)
62+
S_TEMP = 6, //!< Temperature sensor, V_TEMP
63+
S_HUM = 7, //!< Humidity sensor, V_HUM
64+
S_BARO = 8, //!< Barometer sensor, V_PRESSURE, V_FORECAST
65+
S_WIND = 9, //!< Wind sensor, V_WIND, V_GUST
66+
S_RAIN = 10, //!< Rain sensor, V_RAIN, V_RAINRATE
67+
S_UV = 11, //!< Uv sensor, V_UV
68+
S_WEIGHT = 12, //!< Personal scale sensor, V_WEIGHT, V_IMPEDANCE
69+
S_POWER = 13, //!< Power meter, V_WATT, V_KWH, V_VAR, V_VA, V_POWER_FACTOR
70+
S_HEATER = 14, //!< Header device, V_HVAC_SETPOINT_HEAT, V_HVAC_FLOW_STATE, V_TEMP
71+
S_DISTANCE = 15, //!< Distance sensor, V_DISTANCE
72+
S_LIGHT_LEVEL = 16, //!< Light level sensor, V_LIGHT_LEVEL (uncalibrated in percentage), V_LEVEL (light level in lux)
73+
S_ARDUINO_NODE = 17, //!< Used (internally) for presenting a non-repeating Arduino node
74+
S_ARDUINO_REPEATER_NODE = 18, //!< Used (internally) for presenting a repeating Arduino node
75+
S_LOCK = 19, //!< Lock device, V_LOCK_STATUS
76+
S_IR = 20, //!< IR device, V_IR_SEND, V_IR_RECEIVE
77+
S_WATER = 21, //!< Water meter, V_FLOW, V_VOLUME
78+
S_AIR_QUALITY = 22, //!< Air quality sensor, V_LEVEL
79+
S_CUSTOM = 23, //!< Custom sensor
80+
S_DUST = 24, //!< Dust sensor, V_LEVEL
81+
S_SCENE_CONTROLLER = 25, //!< Scene controller device, V_SCENE_ON, V_SCENE_OFF.
82+
S_RGB_LIGHT = 26, //!< RGB light. Send color component data using V_RGB. Also supports V_WATT
83+
S_RGBW_LIGHT = 27, //!< RGB light with an additional White component. Send data using V_RGBW. Also supports V_WATT
84+
S_COLOR_SENSOR = 28, //!< Color sensor, send color information using V_RGB
85+
S_HVAC = 29, //!< Thermostat/HVAC device. V_HVAC_SETPOINT_HEAT, V_HVAC_SETPOINT_COLD, V_HVAC_FLOW_STATE, V_HVAC_FLOW_MODE, V_TEMP
86+
S_MULTIMETER = 30, //!< Multimeter device, V_VOLTAGE, V_CURRENT, V_IMPEDANCE
87+
S_SPRINKLER = 31, //!< Sprinkler, V_STATUS (turn on/off), V_TRIPPED (if fire detecting device)
88+
S_WATER_LEAK = 32, //!< Water leak sensor, V_TRIPPED, V_ARMED
89+
S_SOUND = 33, //!< Sound sensor, V_TRIPPED, V_ARMED, V_LEVEL (sound level in dB)
90+
S_VIBRATION = 34, //!< Vibration sensor, V_TRIPPED, V_ARMED, V_LEVEL (vibration in Hz)
91+
S_MOISTURE = 35, //!< Moisture sensor, V_TRIPPED, V_ARMED, V_LEVEL (water content or moisture in percentage?)
92+
S_INFO = 36, //!< LCD text device / Simple information device on controller, V_TEXT
93+
S_GAS = 37, //!< Gas meter, V_FLOW, V_VOLUME
94+
S_GPS = 38, //!< GPS Sensor, V_POSITION
95+
S_WATER_QUALITY = 39 //!< V_TEMP, V_PH, V_ORP, V_EC, V_STATUS
9696
} mysensor_sensor;
9797

9898
/// @brief Type of sensor data (for set/req/ack messages)
9999
typedef enum {
100-
V_TEMP, // S_TEMP. Temperature S_TEMP, S_HEATER, S_HVAC
101-
V_HUM, // S_HUM. Humidity
102-
V_STATUS, // S_LIGHT, S_DIMMER, S_SPRINKLER, S_HVAC, S_HEATER. Used for setting/reporting binary (on/off) status. 1=on, 0=off
103-
V_LIGHT=2, // Same as V_STATUS
104-
V_PERCENTAGE, // S_DIMMER. Used for sending a percentage value 0-100 (%).
105-
V_DIMMER=3, // S_DIMMER. Same as V_PERCENTAGE.
106-
V_PRESSURE, // S_BARO. Atmospheric Pressure
107-
V_FORECAST, // S_BARO. Whether forecast. string of "stable", "sunny", "cloudy", "unstable", "thunderstorm" or "unknown"
108-
V_RAIN, // S_RAIN. Amount of rain
109-
V_RAINRATE, // S_RAIN. Rate of rain
110-
V_WIND, // S_WIND. Wind speed
111-
V_GUST, // S_WIND. Gust
112-
V_DIRECTION, // S_WIND. Wind direction 0-360 (degrees)
113-
V_UV, // S_UV. UV light level
114-
V_WEIGHT, // S_WEIGHT. Weight(for scales etc)
115-
V_DISTANCE, // S_DISTANCE. Distance
116-
V_IMPEDANCE, // S_MULTIMETER, S_WEIGHT. Impedance value
117-
V_ARMED, // S_DOOR, S_MOTION, S_SMOKE, S_SPRINKLER. Armed status of a security sensor. 1 = Armed, 0 = Bypassed
118-
V_TRIPPED, // S_DOOR, S_MOTION, S_SMOKE, S_SPRINKLER, S_WATER_LEAK, S_SOUND, S_VIBRATION, S_MOISTURE. Tripped status of a security sensor. 1 = Tripped, 0
119-
V_WATT, // S_POWER, S_LIGHT, S_DIMMER, S_RGB_LIGHT, S_RGBW_LIGHT. Watt value for power meters
120-
V_KWH, // S_POWER. Accumulated number of KWH for a power meter
121-
V_SCENE_ON, // S_SCENE_CONTROLLER. Turn on a scene
122-
V_SCENE_OFF, // S_SCENE_CONTROLLER. Turn of a scene
123-
V_HEATER, // Deprecated. Use V_HVAC_FLOW_STATE instead.
124-
V_HVAC_FLOW_STATE=21, // S_HEATER, S_HVAC. HVAC flow state ("Off", "HeatOn", "CoolOn", or "AutoChangeOver")
125-
V_HVAC_SPEED, // S_HVAC, S_HEATER. HVAC/Heater fan speed ("Min", "Normal", "Max", "Auto")
126-
V_LIGHT_LEVEL, // S_LIGHT_LEVEL. Uncalibrated light level. 0-100%. Use V_LEVEL for light level in lux
127-
V_VAR1,
128-
V_VAR2,
129-
V_VAR3,
130-
V_VAR4,
131-
V_VAR5,
132-
V_UP, // S_COVER. Window covering. Up
133-
V_DOWN, // S_COVER. Window covering. Down
134-
V_STOP, // S_COVER. Window covering. Stop
135-
V_IR_SEND, // S_IR. Send out an IR-command
136-
V_IR_RECEIVE, // S_IR. This message contains a received IR-command
137-
V_FLOW, // S_WATER. Flow of water (in meter)
138-
V_VOLUME, // S_WATER. Water volume
139-
V_LOCK_STATUS, // S_LOCK. Set or get lock status. 1=Locked, 0=Unlocked
140-
V_LEVEL, // S_DUST, S_AIR_QUALITY, S_SOUND (dB), S_VIBRATION (hz), S_LIGHT_LEVEL (lux)
141-
V_VOLTAGE, // S_MULTIMETER
142-
V_CURRENT, // S_MULTIMETER
143-
V_RGB, // S_RGB_LIGHT, S_COLOR_SENSOR.
144-
// Used for sending color information for multi color LED lighting or color sensors.
145-
// Sent as ASCII hex: RRGGBB (RR=red, GG=green, BB=blue component)
146-
V_RGBW, // S_RGBW_LIGHT
147-
// Used for sending color information to multi color LED lighting.
148-
// Sent as ASCII hex: RRGGBBWW (WW=white component)
149-
V_ID, // S_TEMP
150-
// Used for sending in sensors hardware ids (i.e. OneWire DS1820b).
151-
V_UNIT_PREFIX, // S_DUST, S_AIR_QUALITY
152-
// Allows sensors to send in a string representing the
153-
// unit prefix to be displayed in GUI, not parsed by controller! E.g. cm, m, km, inch.
154-
// Can be used for S_DISTANCE or gas concentration
155-
V_HVAC_SETPOINT_COOL, // S_HVAC. HVAC cool setpoint (Integer between 0-100)
156-
V_HVAC_SETPOINT_HEAT, // S_HEATER, S_HVAC. HVAC/Heater setpoint (Integer between 0-100)
157-
V_HVAC_FLOW_MODE, // S_HVAC. Flow mode for HVAC ("Auto", "ContinuousOn", "PeriodicOn")
158-
V_TEXT, // S_INFO. Text message to display on LCD or controller device
159-
V_CUSTOM, // Custom messages used for controller/inter node specific commands, preferably using S_CUSTOM device type.
160-
V_POSITION, // GPS position and altitude. Payload: latitude;longitude;altitude(m). E.g. "55.722526;13.017972;18"
161-
V_IR_RECORD, // Record IR codes S_IR for playback
162-
V_PH, // S_WATER_QUALITY, water PH
163-
V_ORP, // S_WATER_QUALITY, water ORP : redox potential in mV
164-
V_EC, // S_WATER_QUALITY, water electric conductivity μS/cm (microSiemens/cm)
165-
V_VAR, // S_POWER, Reactive power: volt-ampere reactive (var)
166-
V_VA, // S_POWER, Apparent power: volt-ampere (VA)
167-
V_POWER_FACTOR // S_POWER, Ratio of real power to apparent power: floating point value in the range [-1,..,1]
100+
V_TEMP = 0, //!< S_TEMP. Temperature S_TEMP, S_HEATER, S_HVAC
101+
V_HUM = 1, //!< S_HUM. Humidity
102+
V_STATUS = 2, //!< S_BINARY, S_DIMMER, S_SPRINKLER, S_HVAC, S_HEATER. Used for setting/reporting binary (on/off) status. 1=on, 0=off
103+
V_LIGHT = 2, //!< \deprecated Same as V_STATUS, **** DEPRECATED, DO NOT USE ****
104+
V_PERCENTAGE = 3, //!< S_DIMMER. Used for sending a percentage value 0-100 (%).
105+
V_DIMMER = 3, //!< \deprecated Same as V_PERCENTAGE, **** DEPRECATED, DO NOT USE ****
106+
V_PRESSURE = 4, //!< S_BARO. Atmospheric Pressure
107+
V_FORECAST = 5, //!< S_BARO. Whether forecast. string of "stable", "sunny", "cloudy", "unstable", "thunderstorm" or "unknown"
108+
V_RAIN = 6, //!< S_RAIN. Amount of rain
109+
V_RAINRATE = 7, //!< S_RAIN. Rate of rain
110+
V_WIND = 8, //!< S_WIND. Wind speed
111+
V_GUST = 9, //!< S_WIND. Gust
112+
V_DIRECTION = 10, //!< S_WIND. Wind direction 0-360 (degrees)
113+
V_UV = 11, //!< S_UV. UV light level
114+
V_WEIGHT = 12, //!< S_WEIGHT. Weight(for scales etc)
115+
V_DISTANCE = 13, //!< S_DISTANCE. Distance
116+
V_IMPEDANCE = 14, //!< S_MULTIMETER, S_WEIGHT. Impedance value
117+
V_ARMED = 15, //!< S_DOOR, S_MOTION, S_SMOKE, S_SPRINKLER. Armed status of a security sensor. 1 = Armed, 0 = Bypassed
118+
V_TRIPPED = 16, //!< S_DOOR, S_MOTION, S_SMOKE, S_SPRINKLER, S_WATER_LEAK, S_SOUND, S_VIBRATION, S_MOISTURE. Tripped status of a security sensor. 1 = Tripped, 0
119+
V_WATT = 17, //!< S_POWER, S_BINARY, S_DIMMER, S_RGB_LIGHT, S_RGBW_LIGHT. Watt value for power meters
120+
V_KWH = 18, //!< S_POWER. Accumulated number of KWH for a power meter
121+
V_SCENE_ON = 19, //!< S_SCENE_CONTROLLER. Turn on a scene
122+
V_SCENE_OFF = 20, //!< S_SCENE_CONTROLLER. Turn of a scene
123+
V_HVAC_FLOW_STATE = 21, //!< S_HEATER, S_HVAC. HVAC flow state ("Off", "HeatOn", "CoolOn", or "AutoChangeOver")
124+
V_HEATER = 21, //!< \deprecated Same as V_HVAC_FLOW_STATE, **** DEPRECATED, DO NOT USE ****
125+
V_HVAC_SPEED = 22, //!< S_HVAC, S_HEATER. HVAC/Heater fan speed ("Min", "Normal", "Max", "Auto")
126+
V_LIGHT_LEVEL = 23, //!< S_LIGHT_LEVEL. Uncalibrated light level. 0-100%. Use V_LEVEL for light level in lux
127+
V_VAR1 = 24, //!< VAR1
128+
V_VAR2 = 25, //!< VAR2
129+
V_VAR3 = 26, //!< VAR3
130+
V_VAR4 = 27, //!< VAR4
131+
V_VAR5 = 28, //!< VAR5
132+
V_UP = 29, //!< S_COVER. Window covering. Up
133+
V_DOWN = 30, //!< S_COVER. Window covering. Down
134+
V_STOP = 31, //!< S_COVER. Window covering. Stop
135+
V_IR_SEND = 32, //!< S_IR. Send out an IR-command
136+
V_IR_RECEIVE = 33, //!< S_IR. This message contains a received IR-command
137+
V_FLOW = 34, //!< S_WATER. Flow of water (in meter)
138+
V_VOLUME = 35, //!< S_WATER. Water volume
139+
V_LOCK_STATUS = 36, //!< S_LOCK. Set or get lock status. 1=Locked, 0=Unlocked
140+
V_LEVEL = 37, //!< S_DUST, S_AIR_QUALITY, S_SOUND (dB), S_VIBRATION (hz), S_LIGHT_LEVEL (lux)
141+
V_VOLTAGE = 38, //!< S_MULTIMETER
142+
V_CURRENT = 39, //!< S_MULTIMETER
143+
V_RGB = 40, //!< S_RGB_LIGHT, S_COLOR_SENSOR. Sent as ASCII hex: RRGGBB (RR=red, GG=green, BB=blue component)
144+
V_RGBW = 41, //!< S_RGBW_LIGHT. Sent as ASCII hex: RRGGBBWW (WW=white component)
145+
V_ID = 42, //!< Used for sending in sensors hardware ids (i.e. OneWire DS1820b).
146+
V_UNIT_PREFIX = 43, //!< Allows sensors to send in a string representing the unit prefix to be displayed in GUI, not parsed by controller! E.g. cm, m, km, inch.
147+
V_HVAC_SETPOINT_COOL = 44, //!< S_HVAC. HVAC cool setpoint (Integer between 0-100)
148+
V_HVAC_SETPOINT_HEAT = 45, //!< S_HEATER, S_HVAC. HVAC/Heater setpoint (Integer between 0-100)
149+
V_HVAC_FLOW_MODE = 46, //!< S_HVAC. Flow mode for HVAC ("Auto", "ContinuousOn", "PeriodicOn")
150+
V_TEXT = 47, //!< S_INFO. Text message to display on LCD or controller device
151+
V_CUSTOM = 48, //!< Custom messages used for controller/inter node specific commands, preferably using S_CUSTOM device type.
152+
V_POSITION = 49, //!< GPS position and altitude. Payload: latitude;longitude;altitude(m). E.g. "55.722526;13.017972;18"
153+
V_IR_RECORD = 50, //!< Record IR codes S_IR for playback
154+
V_PH = 51, //!< S_WATER_QUALITY, water PH
155+
V_ORP = 52, //!< S_WATER_QUALITY, water ORP : redox potential in mV
156+
V_EC = 53, //!< S_WATER_QUALITY, water electric conductivity μS/cm (microSiemens/cm)
157+
V_VAR = 54, //!< S_POWER, Reactive power: volt-ampere reactive (var)
158+
V_VA = 55, //!< S_POWER, Apparent power: volt-ampere (VA)
159+
V_POWER_FACTOR = 56, //!< S_POWER, Ratio of real power to apparent power: floating point value in the range [-1,..,1]
168160
} mysensor_data;
169161

170162

171163
/// @brief Type of internal messages (for internal messages)
172164
typedef enum {
173-
I_BATTERY_LEVEL,
174-
I_TIME,
175-
I_VERSION,
176-
I_ID_REQUEST,
177-
I_ID_RESPONSE,
178-
I_INCLUSION_MODE,
179-
I_CONFIG,
180-
I_FIND_PARENT,
181-
I_FIND_PARENT_RESPONSE,
182-
I_LOG_MESSAGE,
183-
I_CHILDREN,
184-
I_SKETCH_NAME,
185-
I_SKETCH_VERSION,
186-
I_REBOOT,
187-
I_GATEWAY_READY,
188-
I_SIGNING_PRESENTATION, //!< Provides signing related preferences (first byte is preference version)
189-
I_NONCE_REQUEST, //!< Request for a nonce
190-
I_NONCE_RESPONSE, //!< Payload is nonce data
191-
I_HEARTBEAT,
192-
I_PRESENTATION,
193-
I_DISCOVER,
194-
I_DISCOVER_RESPONSE,
195-
I_HEARTBEAT_RESPONSE,
196-
I_LOCKED, //!< Node is locked (reason in string-payload)
197-
I_PING, //!< ping sent to node, payload incremental hop counter
198-
I_PONG, //!< in return to ping, sent back to sender, payload incremental hop counter
199-
I_REGISTER_REQUEST, //!< register request to GW
200-
I_REGISTER_RESPONSE, //!< register response from GW
201-
I_DEBUG //!< debug message
202-
165+
I_BATTERY_LEVEL = 0, //!< Battery level
166+
I_TIME = 1, //!< Time
167+
I_VERSION = 2, //!< Version
168+
I_ID_REQUEST = 3, //!< ID request
169+
I_ID_RESPONSE = 4, //!< ID response
170+
I_INCLUSION_MODE = 5, //!< Inclusion mode
171+
I_CONFIG = 6, //!< Config
172+
I_FIND_PARENT = 7, //!< Find parent
173+
I_FIND_PARENT_RESPONSE = 8, //!< Find parent response
174+
I_LOG_MESSAGE = 9, //!< Log message
175+
I_CHILDREN = 10, //!< Children
176+
I_SKETCH_NAME = 11, //!< Sketch name
177+
I_SKETCH_VERSION = 12, //!< Sketch version
178+
I_REBOOT = 13, //!< Reboot request
179+
I_GATEWAY_READY = 14, //!< Gateway ready
180+
I_SIGNING_PRESENTATION = 15, //!< Provides signing related preferences (first byte is preference version)
181+
I_NONCE_REQUEST = 16, //!< Request for a nonce
182+
I_NONCE_RESPONSE = 17, //!< Payload is nonce data
183+
I_HEARTBEAT = 18, //!< Heartbeat request
184+
I_PRESENTATION = 19, //!< Presentation message
185+
I_DISCOVER = 20, //!< Discover request
186+
I_DISCOVER_RESPONSE = 21, //!< Discover response
187+
I_HEARTBEAT_RESPONSE = 22, //!< Heartbeat response
188+
I_LOCKED = 23, //!< Node is locked (reason in string-payload)
189+
I_PING = 24, //!< Ping sent to node, payload incremental hop counter
190+
I_PONG = 25, //!< In return to ping, sent back to sender, payload incremental hop counter
191+
I_REGISTER_REQUEST = 26, //!< Register request to GW
192+
I_REGISTER_RESPONSE = 27, //!< Register response from GW
193+
I_DEBUG = 28 //!< Debug message
203194
} mysensor_internal;
204195

205196

206197
/// @brief Type of data stream (for streamed message)
207198
typedef enum {
208-
ST_FIRMWARE_CONFIG_REQUEST,
209-
ST_FIRMWARE_CONFIG_RESPONSE,
210-
ST_FIRMWARE_REQUEST,
211-
ST_FIRMWARE_RESPONSE,
212-
ST_SOUND,
213-
ST_IMAGE
199+
ST_FIRMWARE_CONFIG_REQUEST = 0, //!< Request new FW, payload contains current FW details
200+
ST_FIRMWARE_CONFIG_RESPONSE = 1, //!< New FW details to initiate OTA FW update
201+
ST_FIRMWARE_REQUEST = 2, //!< Request FW block
202+
ST_FIRMWARE_RESPONSE = 3, //!< Response FW block
203+
ST_SOUND = 4, //!< Sound
204+
ST_IMAGE = 5 //!< Image
214205
} mysensor_stream;
215206

216207
/// @brief Type of payload
217208
typedef enum {
218-
P_STRING,
219-
P_BYTE,
220-
P_INT16,
221-
P_UINT16,
222-
P_LONG32,
223-
P_ULONG32,
224-
P_CUSTOM,
225-
P_FLOAT32
209+
P_STRING = 0, //!< Payload type is string
210+
P_BYTE = 1, //!< Payload type is byte
211+
P_INT16 = 2, //!< Payload type is INT16
212+
P_UINT16 = 3, //!< Payload type is UINT16
213+
P_LONG32 = 4, //!< Payload type is INT32
214+
P_ULONG32 = 5, //!< Payload type is UINT32
215+
P_CUSTOM = 6, //!< Payload type is binary
216+
P_FLOAT32 = 7 //!< Payload type is float32
226217
} mysensor_payload;
227218

228219

0 commit comments

Comments
 (0)