nm_write()


Writing data to the designated NM(Non-volatile Memory)

Description

int nm_write(int $nm_id, int $offset, int/string $wbuf [, int $wlen = MAX_STRING_LEN])

Parameters

Return Value

On success, number of bytes to have been written. On fail, 0

Example

<?php
include "/lib/sd_340.php";
$wbuf = "abcde";
$rbuf = "";
nm_write(0, 0, $wbuf, 5);  // Writing 5 bytes of data to the address 0 of the NM0
nm_read(0, 0, $rbuf, 5);   // Reading 5 bytes of data from the address 0 of the NM0
hexdump($rbuf);            // Outputting the data
?>

See also