Mistake on this page?
Report an issue in GitHub or email us
Static Public Member Functions
HandleTestCommand Class Reference

HandleTestCommand turns all the typed-in/serial commands into function calls sent via a eventqueue to the driver shim/wrapper class. More...

#include <NFCCommands.h>

Static Public Member Functions

static int cmd_get_last_nfc_error (int argc, char *argv[])
 return and clear the last result code. More...
 
static int cmd_set_last_nfc_error (int argc, char *argv[])
 internal function to test getlastnfcerror More...
 
static int cmd_get_conf_nfceeprom (int argc, char *argv[])
 returns compile time flag if NFC EEPROM was compiled More...
 
static int cmd_get_max_ndef (int argc, char *argv[])
 For EEPROM, returns the driver max_ndef value, else returns the app config MBED_CONF_APP_TEST_NDEF_MSG_MAX. More...
 
static int cmd_init_nfc (int argc, char *argv[])
 Init must be called before invoking any other calls, obtains a driver reference and initializes driver. More...
 
static int cmd_set_smartposter (int argc, char *argv[])
 write a smartposter url, 'Sp' NDEF to the target More...
 
static int cmd_erase (int argc, char *argv[])
 erases the EEPROM if present More...
 
static int cmd_get_supported_rf_protocols (int argc, char *argv[])
 Returns a CSV list of protocols supported. More...
 
static int cmd_configure_rf_protocols (int argc, char *argv[])
 Sets the protocols supported (unimplemented) More...
 
static int cmd_start_discovery (int argc, char *argv[])
 starts the NFC discovery loop if controller, has no effect on EEPROM More...
 
static int cmd_stop_discovery (int argc, char *argv[])
 stops the NFC discovery loop if controller More...
 
static int cmd_read_message (int argc, char *argv[])
 read raw EEPROM contents, reads a buffer if a controller is used More...
 
static int cmd_write_long_ndef_message (int argc, char *argv[])
 write a text 'T' NDEF message to the target More...
 

Detailed Description

HandleTestCommand turns all the typed-in/serial commands into function calls sent via a eventqueue to the driver shim/wrapper class.

Methods with cmd_ prefix map to the serial commands, and are building blocks for test cases and scenarios. The first function a test must call is typically the initnfc command. Commands report back a test verdict, and a NFC status code. The test verdict is always success unless the command is not allowed. Tests much check the NFC error code for NFC_OK or zero; this pattern allows us to write negative tests which expect a specific NFC error.

Handlers are statics because the test framework is not supporting C++

Definition at line 57 of file NFCCommands.h.

Member Function Documentation

static int cmd_configure_rf_protocols ( int  argc,
char *  argv[] 
)
static

Sets the protocols supported (unimplemented)

static int cmd_erase ( int  argc,
char *  argv[] 
)
static

erases the EEPROM if present

static int cmd_get_conf_nfceeprom ( int  argc,
char *  argv[] 
)
static

returns compile time flag if NFC EEPROM was compiled

static int cmd_get_last_nfc_error ( int  argc,
char *  argv[] 
)
static

return and clear the last result code.

Type "help getlastnfcerror" for a list of error codes

static int cmd_get_max_ndef ( int  argc,
char *  argv[] 
)
static

For EEPROM, returns the driver max_ndef value, else returns the app config MBED_CONF_APP_TEST_NDEF_MSG_MAX.

static int cmd_get_supported_rf_protocols ( int  argc,
char *  argv[] 
)
static

Returns a CSV list of protocols supported.

static int cmd_init_nfc ( int  argc,
char *  argv[] 
)
static

Init must be called before invoking any other calls, obtains a driver reference and initializes driver.

static int cmd_read_message ( int  argc,
char *  argv[] 
)
static

read raw EEPROM contents, reads a buffer if a controller is used

static int cmd_set_last_nfc_error ( int  argc,
char *  argv[] 
)
static

internal function to test getlastnfcerror

static int cmd_set_smartposter ( int  argc,
char *  argv[] 
)
static

write a smartposter url, 'Sp' NDEF to the target

static int cmd_start_discovery ( int  argc,
char *  argv[] 
)
static

starts the NFC discovery loop if controller, has no effect on EEPROM

static int cmd_stop_discovery ( int  argc,
char *  argv[] 
)
static

stops the NFC discovery loop if controller

static int cmd_write_long_ndef_message ( int  argc,
char *  argv[] 
)
static

write a text 'T' NDEF message to the target

Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.