From 73eaa8982eecee48e12966bf2563a8b51d49b020 Mon Sep 17 00:00:00 2001 From: user Date: Fri, 11 Oct 2024 21:15:04 +0200 Subject: [PATCH] add mac addres read add struct as commant --- embadet/main/apple.c | 40 +++++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/embadet/main/apple.c b/embadet/main/apple.c index 93411e7..f516dcc 100644 --- a/embadet/main/apple.c +++ b/embadet/main/apple.c @@ -1,14 +1,32 @@ + #include "esp_log.h" #include #include #include #include // Die Header-Datei mit DS18B20-Funktionen #include +#include + +struct appldata; int app_main() { + + + // Variable to store the MAC address + uint8_t baseMac[6]; + + // Get MAC address of the WiFi station interface + esp_read_mac(baseMac, ESP_MAC_WIFI_STA); + printf("Station MAC: "); + for (int i = 0; i < 5; i++) { + printf("%02X:", baseMac[i]); + } + printf("%02X\n", baseMac[5]); + + + // Create variable for handler ds18b20_handler_t sensor; - // Check for any initialization failures if (!ds18b20_init(&sensor, GPIO_NUM_2, TEMP_RES_12_BIT)) { @@ -16,15 +34,7 @@ int app_main() { return 0; // Exit } - float temp = 0; - - - - // If you doesn't convert temperature you may read 85.0 Celsius, - // as it is default temperature set by DS18B20 if convert command wasn't issued. - - // Read temperature printf("hit"); for(int i = 0; i < 30; ++i) { // Initalize conversion @@ -41,5 +51,17 @@ int app_main() { + + + return 0; } + +/* +struct appldata{ + uint8_t uuid; + signed float temp; + unsigned float battaryVoltage; + unsigned long upTime; +} +*/ \ No newline at end of file