1 Reply Latest reply on Nov 17, 2015 8:17 AM by DiegoV_Intel

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

    evma

      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?

        • 1. Re: What does mraa.printError() mean if it prints nothing?
          DiegoV_Intel

          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: mraa/mraa.c at 3059c06fa05c4a5536ec82d00bd991891956704d · intel-iot-devkit/mraa · GitHub

           

          mraa_result_t resultConsole Output
          MRAA_SUCCESSMRAA: SUCCESS
          MRAA_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.