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

Conversation

@m-mcgowan
Copy link
Contributor

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

This comment has been minimized.

Copy link
Contributor Author

commented Apr 13, 2016

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

This comment has been minimized.

Copy link
Member

commented Apr 14, 2016

@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

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@monkbroc monkbroc removed the in progress label Apr 14, 2016

@m-mcgowan m-mcgowan deleted the feature/fix_variable_template branch Sep 27, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.