27 / 30
iSense Ethernet Gateway User Guide
coalesenses
research to innovate
dd if=/dev/<SD Card reader device name> of=<Path of file
to write card contents to>
EXAMPLE:
Assumed that the name of the SDCard reader device is
/dev/disk1
the following
examples illustrate the above commands.
Reset SD-Card:
dd if=/dev/zero of=/dev/disk1
Save data from SD-Card to file
/home/user/sd_contents.txt
:
dd if=/dev/disk1 of=/home/user/sd_contents.txt
You can send character output to the outside world using the methods
Os::debug
and
Os::fatal
:
//-------------------------------------------------------
** Logs the given string depending on the log mode to a uart or radio.
*/
void
debug(
const
char
*format, ...);
//-------------------------------------------------------
/** Logs the given string depending on the log mode to a uart or radio.
*/
void
fatal(
const
char
*format, ...);
They work similar to the well-known
sprintf
functions in regular C, i.e. integer values etc. can be
printed using the % notation. For example
uint16 i = 128;
os()
.debug(
"value of i is %d, hex=%x"
, i, i);
will output „value of i is 128, hex=0x80“. The destination of the debug output can be set using
Os::set_log_mode
, the corresponding constants can be found in
iSense/src/isense/os.h
.
//-------------------------------------------------------
/** Sets the log mode to the given value, e.g.
* (ISENSE_LOG_MODE_UART0 | ISENSE_LOG_MODE_RADIO)
*/
void
set_log_mode(
uint8
mode ) {
log_mode_
= mode; }
By default, the output destination is set to UART0, i.e. the output is sent to a PC via a connected
iSense Gateway Module.