Mbed with some light patches
.github | 5 years ago | ||
TESTS | 5 years ago | ||
TEST_APPS | 6 years ago | ||
UNITTESTS | 5 years ago | ||
cmsis | 5 years ago | ||
drivers | 5 years ago | ||
events | 5 years ago | ||
features | 6 years ago | ||
hal | 5 years ago | ||
mbed-client-cli | 6 years ago | ||
platform | 5 years ago | ||
rtos | 5 years ago | ||
source | 6 years ago | ||
targets | 5 years ago | ||
test | 6 years ago | ||
tools | 6 years ago | ||
.astyleignore | 5 years ago | ||
.astylerc | 5 years ago | ||
.coveragerc | 6 years ago | ||
.gitattributes | 10 years ago | ||
.gitignore | 6 years ago | ||
.mbedignore | 6 years ago | ||
.pylintrc | 7 years ago | ||
.travis.yml | 5 years ago | ||
.yotta_ignore | 4 years ago | ||
CONTRIBUTING.md | 6 years ago | ||
DOXYGEN_FRONTPAGE.md | 7 years ago | ||
Jenkinsfile | 5 years ago | ||
LICENSE | 10 years ago | ||
Makefile | 6 years ago | ||
README.md | 6 years ago | ||
doxyfile_options | 5 years ago | ||
doxygen_options.json | 5 years ago | ||
logo.png | 6 years ago | ||
mbed.h | 5 years ago | ||
module.json | 6 years ago | ||
requirements.txt | 5 years ago | ||
target.json | 4 years ago | ||
test_suite.json | 6 years ago |
Arm Mbed OS is an open source embedded operating system designed specifically for the "things" in the Internet of Things. It includes all the features you need to develop a connected product based on an Arm Cortex-M microcontroller, including security, connectivity, an RTOS and drivers for sensors and I/O devices.
Mbed OS provides a platform that includes:
The release notes detail the current release. You can also find information about previous versions.
We have a developer website for asking questions, engaging with others, finding information on boards and components, using an online IDE and compiler, reading the documentation and learning about what's new and what's coming next in Mbed OS.
This is the Command Line Library for a CLI application. This library provides methods for:
Command Line Library API is described in the snipplet below:
// if thread safety for CLI terminal output is needed // configure output mutex wait cb before initialization so it's available immediately cmd_set_mutex_wait_func( (func)(void) ); // configure output mutex release cb before initialization so it's available immediately cmd_set_mutex_wait_func( (func)(void) ); // initialize cmdline with print function cmd_init( (func)(const char* fmt, va_list ap) ); // configure ready cb cmd_set_ready_cb( (func)(int retcode) ); // register command for library cmd_add( <command>, (int func)(int argc, char *argv[]), <help>, <man>); //execute some existing commands cmd_exe( <command> );
Command Line Library has trace messages, which are disabled by default. "MBED_CLIENT_CLI_TRACE_ENABLE" flag if defined, enables all the trace prints for debugging.
Adding new commands to the Command Line Library and executing the commands:
//example print function void myprint(const char* fmt, va_list ap){ vprintf(fmt, ap); } // ready cb, calls next command to be executed void cmd_ready_cb(int retcode) { cmd_next( retcode ); } // dummy command with some option int cmd_dummy(int argc, char *argv[]){ if( cmd_has_option(argc, argv, "o") ) { cmd_printf("This is o option"); } else { return CMDLINE_RETCODE_INVALID_PARAMETERS; } return CMDLINE_RETCODE_SUCCESS; } // timer cb (pseudo-timer-code) void timer_ready_cb(void) { cmd_ready(CMDLINE_RETCODE_SUCCESS); } // long command, that needs for example some events to complete the command execution int cmd_long(int argc, char *argv[] ) { timer_start( 5000, timer_ready_cb ); //pseudo timer code return CMDLINE_RETCODE_EXCUTING_CONTINUE; } void main(void) { cmd_init( &myprint ); // initialize cmdline with print function cmd_set_ready_cb( cmd_ready_cb ); // configure ready cb cmd_add("dummy", cmd_dummy, 0, 0); // add one dummy command cmd_add("long", cmd_long, 0, 0); // add one dummy command //execute dummy and long commands cmd_exe( "dummy;long" ); }
The CLI library is not thread safe, but the CLI terminal output can be locked against other output streams, for example if both traces and CLI output are using serial out.
static Mutex MyMutex; // mutex wait cb, acquires the mutex, waiting if necessary static void mutex_wait(void) { MyMutex.lock(); } // mutex release cb, releases the mutex static void my_mutex_release(void) { MyMutex.unlock(); } void main(void) { cmd_mutex_wait_func( my_mutex_wait ); // configure mutex wait function before initializing cmd_mutex_release_func( my_mutex_release ); // configure mutex release function before initializing cmd_init( &myprint ); // initialize cmdline with print function cmd_set_ready_cb( cmd_ready_cb ); // configure ready cb. //CLI terminal output now locks against MyMutex }