Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: af_utils/af_attriburtes.cpp
- Revision:
- 12:4c0bd7fce2fd
- Parent:
- 9:f958fa2cdc74
- Child:
- 13:88ee926c56ae
diff -r 99eb6741ada4 -r 4c0bd7fce2fd af_utils/af_attriburtes.cpp
--- a/af_utils/af_attriburtes.cpp Mon Dec 11 05:52:25 2017 +0000
+++ b/af_utils/af_attriburtes.cpp Tue Dec 12 02:28:51 2017 +0000
@@ -77,6 +77,9 @@
{ ATTR_GAS_ENABLE, "Gas Pressure Enable", ATTRIBUTE_TYPE_BOOLEAN, 1 },
{ ATTR_GAS_INTERVAL, "Gas Pressure Interval", ATTRIBUTE_TYPE_SINT16, 2 },
{ ATTR_GAS_VALUE, "Gas Pressure Value", ATTRIBUTE_TYPE_FIXED_15_16, 4},
+ { ATTR_GAS_THR_MODE, "Gas Press Threshold Mode", ATTRIBUTE_TYPE_SINT8, 1 },
+ { ATTR_GAS_THR_HIGH, "Gas Press High Thresh", ATTRIBUTE_TYPE_SINT16, 2 },
+ { ATTR_GAS_THR_LOW, "Gas Press Low Thresh", ATTRIBUTE_TYPE_SINT16, 2 },
/* Software Reset Request */
{ ATTR_SOFTWARE_RESET, "Software Reset", ATTRIBUTE_TYPE_BOOLEAN, 1 },
@@ -485,6 +488,24 @@
afero->setAttributeComplete(requestId, attributeId, valueLen, value) ;
}
break ;
+ case ATTR_GAS_THR_MODE:
+ if (sensor[4]) {
+ ((edge_pressure*)sensor[4])->set_thr_mode(value[0]) ;
+ afero->setAttributeComplete(requestId, attributeId, valueLen, value) ;
+ }
+ break ;
+ case ATTR_GAS_THR_HIGH:
+ if (sensor[4]) {
+ ((edge_pressure*)sensor[4])->set_thr_high((value[1] << 8) | value[0]) ;
+ afero->setAttributeComplete(requestId, attributeId, valueLen, value) ;
+ }
+ break ;
+ case ATTR_GAS_THR_LOW:
+ if (sensor[4]) {
+ ((edge_pressure*)sensor[4])->set_thr_low((value[1] << 8) | value[0]) ;
+ afero->setAttributeComplete(requestId, attributeId, valueLen, value) ;
+ }
+ break ;
default:
break ;
}