sigfox
Fork of Sigfox by
Revision 8:b10abac6a42e, committed 2017-06-04
- Comitter:
- Raffaello
- Date:
- Sun Jun 04 16:06:45 2017 +0000
- Parent:
- 7:48396d48ae12
- Child:
- 9:7b18b2817eba
- Commit message:
- Added temperature method
Changed in this revision
| Sigfox.cpp | Show annotated file Show diff for this revision Revisions of this file |
| Sigfox.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/Sigfox.cpp Tue May 30 21:32:57 2017 +0000
+++ b/Sigfox.cpp Sun Jun 04 16:06:45 2017 +0000
@@ -76,6 +76,14 @@
return &PAC[0];
}
+float Sigfox::getTemperature() {
+ char buff[6];
+ _at->send("AT$T?");
+ _at->read(buff, 6);
+ buff[5] = 0;
+ return ((double)atoi(buff))/10;
+}
+
sigfoxvoltage_t Sigfox::getVoltages() {
sigfoxvoltage_t volt;
char buff[12];
--- a/Sigfox.h Tue May 30 21:32:57 2017 +0000
+++ b/Sigfox.h Sun Jun 04 16:06:45 2017 +0000
@@ -60,6 +60,8 @@
char *getPAC();
sigfoxvoltage_t getVoltages();
+
+ float getTemperature();
};
#endif /* SIGFOX_H */
\ No newline at end of file
