Community
cancel
Showing results for 
Search instead for 
Did you mean: 
EMass1
Beginner
989 Views

What does mraa.printError() mean if it prints nothing?

Jump to solution

var mraa = require('mraa');

var button = new mraa.Gpio(36); // button hooked up to digi pin 14

button.dir(mraa.DIR_IN);

var t = button.isr(mraa.EDGE_FALLING, function () {

console.log("pressed");

});

printError(t);

When I run this I get no output from this in the console. Does that mean it succeeded or is something else wrong?

Tags (1)
1 Solution
Diego_V_Intel
Employee
73 Views

Hello evma,

I've just run your code and I got an error. You have to change the last line of your code by this one:

mraa.printError(t);

Then I ran it again and I got the message "MRAA: SUCCESS".

Anyhow, you should always get an output from the printError() method. I've summarized all the possible outputs you could get in the table below. I hope you find it useful. Additional details can be found in the MRAA source code: https://github.com/intel-iot-devkit/mraa/blob/3059c06fa05c4a5536ec82d00bd991891956704d/src/mraa.c# L211 mraa/mraa.c at 3059c06fa05c4a5536ec82d00bd991891956704d · intel-iot-devkit/mraa · GitHub

mraa_result_t resultConsole OutputMRAA_SUCCESSMRAA: SUCCESSMRAA_ERROR_FEATURE_NOT_IMPLEMENTEDMRAA: Feature not implemented.MRAA_ERROR_FEATURE_NOT_SUPPORTEDMRAA: Feature not supported by Hardware.MRAA_ERROR_INVALID_VERBOSITY_LEVELMRAA: Invalid verbosity level.MRAA_ERROR_INVALID_PARAMETERMRAA: Invalid parameter.MRAA_ERROR_INVALID_HANDLEMRAA: Invalid Handle.MRAA_ERROR_NO_RESOURCESMRAA: No resources.MRAA_ERROR_INVALID_RESOURCEMRAA: Invalid resource.MRAA_ERROR_INVALID_QUEUE_TYPEMRAA: Invalid Queue Type.MRAA_ERROR_NO_DATA_AVAILABLEMRAA: No Data available.MRAA_ERROR_INVALID_PLATFORMMRAA: Platform not recognised.MRAA_ERROR_PLATFORM_NOT_INITIALISEDMRAA: Platform not initialised.MRAA_ERROR_PLATFORM_ALREADY_INITIALISEDMRAA: Platform already initialised.MRAA_ERROR_UNSPECIFIEDMRAA: Unspecified Error.DEFAULT CASEMRAA: Unrecognised error.

Regards,

Diego.

View solution in original post

1 Reply
Diego_V_Intel
Employee
74 Views

Hello evma,

I've just run your code and I got an error. You have to change the last line of your code by this one:

mraa.printError(t);

Then I ran it again and I got the message "MRAA: SUCCESS".

Anyhow, you should always get an output from the printError() method. I've summarized all the possible outputs you could get in the table below. I hope you find it useful. Additional details can be found in the MRAA source code: https://github.com/intel-iot-devkit/mraa/blob/3059c06fa05c4a5536ec82d00bd991891956704d/src/mraa.c# L211 mraa/mraa.c at 3059c06fa05c4a5536ec82d00bd991891956704d · intel-iot-devkit/mraa · GitHub

mraa_result_t resultConsole OutputMRAA_SUCCESSMRAA: SUCCESSMRAA_ERROR_FEATURE_NOT_IMPLEMENTEDMRAA: Feature not implemented.MRAA_ERROR_FEATURE_NOT_SUPPORTEDMRAA: Feature not supported by Hardware.MRAA_ERROR_INVALID_VERBOSITY_LEVELMRAA: Invalid verbosity level.MRAA_ERROR_INVALID_PARAMETERMRAA: Invalid parameter.MRAA_ERROR_INVALID_HANDLEMRAA: Invalid Handle.MRAA_ERROR_NO_RESOURCESMRAA: No resources.MRAA_ERROR_INVALID_RESOURCEMRAA: Invalid resource.MRAA_ERROR_INVALID_QUEUE_TYPEMRAA: Invalid Queue Type.MRAA_ERROR_NO_DATA_AVAILABLEMRAA: No Data available.MRAA_ERROR_INVALID_PLATFORMMRAA: Platform not recognised.MRAA_ERROR_PLATFORM_NOT_INITIALISEDMRAA: Platform not initialised.MRAA_ERROR_PLATFORM_ALREADY_INITIALISEDMRAA: Platform already initialised.MRAA_ERROR_UNSPECIFIEDMRAA: Unspecified Error.DEFAULT CASEMRAA: Unrecognised error.

Regards,

Diego.

View solution in original post

Reply