particleDevice.getFunctions() is not returning any functions

Here is a link to the repo containing the software that is programmed to my particle photon:

When I run this in android studio:
mDevice = sparkCloud.getDevice(“xxxxxxxxxxxxxxxxxxxxxxx”);
System.out.println("Device is connected: " + mDevice.isConnected());
System.out.println("Device has functions: " + mDevice.getFunctions());

I get:
Device is connected: true
Device has functions: []

Shouldn’t I be seeing a list of the functions programmed to my Photon?

Only functions that are registered via Particle.function() will show up in the cloud.
On top of that, in order for a function to be exposable it needs to have exactly this signature

int fn(String)

You may want to read the docs about Particle.function()

BTW, in a project only one .ino file is allowed and this is the one that needs to contain void setup() and void loop(). Any extra implementation files need to be .cpp

1 Like