UPDATE:
Mesh.publish() uses CHECK
and CHECK_TRUE
macros (defined in https://github.com/particle-iot/device-os/blob/master/services/inc/check.h), which can return values other than SYSTEM_ERROR_NONE
. Therefore my original message (below) was incorrect.
Original message
It seems at least as of https://github.com/particle-iot/device-os/blob/v1.4.4/wiring/src/spark_wiring_mesh.cpp#L227 that this is still returning success
no matter the actual result.
@rickkas7, think there might be some bandwidth to update the documentation? It looks like there are some hard problems to solve before the function can return meaningful results.
I propose the following replacement
old version–>
Returns: 0 = success, non-zero = system error code)
Note that the return value for Mesh.publish is 0 (SYSTEM_ERROR_NONE) for success, where the return value for Particle.publish is true (1) for success.
new version–>
Returns (int): 0