Coder Social home page Coder Social logo

Comments (5)

nrwiersma avatar nrwiersma commented on July 22, 2024

The problem is the same as last time. When you set a viariable it will not be automatically updated when the config value changes, it takes that value until updated. So when in the start you set zahl it is 0 as it should be. It is then never updated. It might be possible that rssimac1 will be updated as it is a pointer and we use the same memory.

In general it is best to use config.<something> directly in your function rather then making global variables.

from configmanager.

Stargazer32584 avatar Stargazer32584 commented on July 22, 2024

Hi,

thank you for your answer.
So, you said, it is better to put the config.<something> directly in the funktion ?

Is it so right, for example ?

class MyAdvertisedDeviceCallbacks: public BLEAdvertisedDeviceCallbacks
{
void onResult(BLEAdvertisedDevice advertisedDevice) // passiert wenn BLE Device ( beacon ) gefunden wurde
{
char* rssimac1 = config.rssi_werttageins;
int zahl = atoi(rssimac1);
Serial.print("iBeacon gefunden : ");
Serial.print(advertisedDevice.toString().c_str()); // ibeacon Adresse anzeigen
Serial.printf(" RSSI: %d ", advertisedDevice.getRSSI());
Serial.println("---------------------------------");

    if (advertisedDevice.getAddress().equals(*pServerAddress)& advertisedDevice.getRSSI() > zahl)    // ibeacon Adresse Vergleichen
    {
      Serial.println(" Überwachte MAC - Adresse Tag 1 gefunden");         // wenn überwache Adresse gefunden wurde

    }
  }

};

Thank you...

André

from configmanager.

nrwiersma avatar nrwiersma commented on July 22, 2024

Yes, that is correct. This will give you the value at the time it is needed.

from configmanager.

Stargazer32584 avatar Stargazer32584 commented on July 22, 2024

Hi,

you made my day, again :-D !

Thank you very much for your support !!

Best regards and a good evening..

André

from configmanager.

nrwiersma avatar nrwiersma commented on July 22, 2024

No worries. I will close this issue. Feel free to reopen if needed.

from configmanager.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.