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.
Dependents: OneWireTest mbed_blinky Affich_Lum_Moist Projetv0 ... more
Diff: OneWireDevice.cpp
- Revision:
- 2:07da4deb7135
- Child:
- 3:7bd102cb73e0
diff -r 74dcd0c7d5d4 -r 07da4deb7135 OneWireDevice.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/OneWireDevice.cpp Tue Dec 18 11:40:28 2012 +0000
@@ -0,0 +1,18 @@
+#include "OneWireDevice.h"
+
+OneWireDevice::OneWireDevice(OneWire* ow, DeviceAddress devAddr)
+{
+ owBus = ow;
+ for (uint8_t i = 0; i < 8; i++)
+ address[i] = devAddr[i];
+}
+
+void OneWireDevice::generateId(char* id)
+{
+ sprintf(id, "%02X%02X%02X%02X%02X%02X%02X%02X", address[0], address[1],address[2],address[3],address[4],address[5],address[6],address[7]);
+}
+
+uint8_t OneWireDevice::getFamily()
+{
+ return address[0];
+}