Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checking creditsAvailable for setLocalData() before sendData() #1

Open
bmwe30is opened this issue Nov 28, 2014 · 0 comments
Open

Checking creditsAvailable for setLocalData() before sendData() #1

bmwe30is opened this issue Nov 28, 2014 · 0 comments

Comments

@bmwe30is
Copy link

Hi guys, thanks for the great documentation!!

I was going through your lighting_with_state.ino sketch and saw that you check for data credits before you call setLocalData. I'm a little confused since per the Nordic docs (page 77 of the nRF8001 product spec), setLocalData doesn't use up any data credits but calling sendData does.

What was the reason you check for available credits before you set the local value?

For reference (lighting_with_state.ino, lines 164 - 176):


  // STATE
  if (nrf->isPipeOpen(BUTTON_STATE_PIPE) && nrf->creditsAvailable()) {
     Serial.println("Setting 1");
     foo = 1;
     nrf->setLocalData(BUTTON_STATE_PIPE, 1, &foo);
  } 

  // TX
  if ( nrf->isPipeOpen(BUTTON_TX_PIPE) ) {
     Serial.println("Sending 1");
     foo = 1;
     nrf->sendData(BUTTON_TX_PIPE, 1, &foo);
  }

Thanks!!

  • Jonathan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant