Skip to content

Latest commit

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

vconsole

Switch console between multiple communication devices (eg. serial / CAN bus / Ethernet).

Functions

  • Create console device(s).
  • Switch console device(s).

How to use

/* callback function */staticrt_size_toutfunction(rt_device_tdevice, rt_uint8_t*buff, rt_size_tsize)
{
/* communication device should send the buff's data in this function */
}
/* create a console */dev=vconsole_create("vc0", outfunction);
/* switch the console and return the old device */old_dev=vconsole_switch(dev);
/* switch back to the old device */vconsole_switch(old_dev);
/* delete the console */vconsole_delete(dev);

API

rt_device_t vconsole_create(const char *name, vc_output_t out)

Create a console device object.

parameterdescription
namedevice's name
outthe callback function of data output
returndescription
rt_device_tdevice object

rt_err_t vconsole_delete(rt_device_t device)

Delete console device object.

parameterdescription
devicedevice object
returndescription
rt_err_tRT_EOK

Only unused devices which are created by vconsole_create() function can be deleted

rt_device_t vconsole_switch(rt_device_t device)

Switch console between different communication devices.

parameterdescription
devicedevice object
returndescription
rt_device_told device object

rt_size_t vconsole_input(rt_device_t device, const rt_uint8_t *buff, rt_size_t size)

Output data to the device object which are only created by vconsole_create() .

parameterdescription
devicedevice object
buffdata pointer
sizedata size
returndescription
rt_size_tdata size in actual

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages