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

variable template fix #952

Merged
merged 1 commit into from
Apr 14, 2016
Merged

variable template fix #952

merged 1 commit into from
Apr 14, 2016

Conversation

m-mcgowan
Copy link
Contributor

@m-mcgowan m-mcgowan commented Apr 10, 2016

fixes issue #947. Use explicit references to avoid creation of temporaries. Thanks @sergeuz!

A test should comprise an app with variables and functions registered using all the available syntaxes.


Doneness:

  • Contributor has signed CLA
  • Problem and Solution clearly stated
  • Code peer reviewed
  • API tests compiled
  • Run unit/integration/application tests on device
  • Add documentation
  • Add to CHANGELOG.md after merging (add links to docs and issues)

@m-mcgowan m-mcgowan added this to the 0.5.x milestone Apr 10, 2016
@m-mcgowan
Copy link
Contributor Author

Tested with this app:

#include "Particle.h"

String s1 = "A String";
const char* s2 = "a C string";
int i = 42;
bool b = true;
double d = 3.14159;


void setup()
{
   Particle.variable("s1", s1);
   Particle.variable("s2", s2);
   Particle.variable("i", i);
   Particle.variable("b", b);
   Particle.variable("d", d);
}

(Also tested with current 0.5.0-rc.1 and the values are garbage.)

Here's the results:

photon4 [3e0040000e47343432313031] (Photon) is online
  Variables:
    s1 (string)
    s2 (string)
    i (int32)
    b (bool)
    d (double)
photon6 [33002f001147343339383037] (Photon) is offline
pigtail [220038000947333531303339] (Core) is offline
sparkfun_p1 [410035000f47343337373737] (P1) is offline
test [50ff6f065067545646140387] (Core) is offline
Scream:variables mat1$ particle get photon4 s1
A String
Scream:variables mat1$ particle get photon4 s2
a C string
Scream:variables mat1$ particle get photon4 i
42
Scream:variables mat1$ particle get photon4 b
true
Scream:variables mat1$ particle get photon4 d
3.14159

@technobly technobly self-assigned this Apr 14, 2016
@technobly
Copy link
Member

@m-mcgowan looks good! Tested your app on a Photon, wiring/no_fixture tests pass for Photon/Electron U260.

@technobly technobly removed their assignment Apr 14, 2016
@technobly technobly merged commit 7bc3782 into develop Apr 14, 2016
@m-mcgowan m-mcgowan deleted the feature/fix_variable_template branch September 27, 2016 16:45
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

Successfully merging this pull request may close these issues.

3 participants