[Tinyos-contrib-commits]
CVS: tinyos-1.x/contrib/rincon/apps/Blackbook5/apps/BlackbookFullConnect
Makefile, 1.2, 1.3 blackbookconnect_readme.txt, 1.1, 1.2
dmm
rincon at users.sourceforge.net
Wed Jun 7 12:34:20 PDT 2006
Update of /cvsroot/tinyos/tinyos-1.x/contrib/rincon/apps/Blackbook5/apps/BlackbookFullConnect
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv1867/contrib/rincon/apps/Blackbook5/apps/BlackbookFullConnect
Modified Files:
Makefile blackbookconnect_readme.txt
Log Message:
Uploaded Mark's fixes
Index: Makefile
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/rincon/apps/Blackbook5/apps/BlackbookFullConnect/Makefile,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Makefile 6 Jun 2006 16:50:31 -0000 1.2
--- Makefile 7 Jun 2006 19:34:17 -0000 1.3
***************
*** 1,15 ****
COMPONENT=BlackbookFullConnectC
! # Choose one:
#CFLAGS += -I../../media/AT45DB
CFLAGS += -I../../media/STM25P
CFLAGS += -I../../ -I../../core -I../../interfaces -I../../boot
CFLAGS += -I../FlashBridgeViewer
! CFLAGS += -Os
! CFLAGS += -I../../../../tos/lib/State -I../../../../tos/lib/Transceiver
! include $(TOSROOT)/apps/Makerules
--- 1,24 ----
COMPONENT=BlackbookFullConnectC
! # Choose a flash type:
#CFLAGS += -I../../media/AT45DB
CFLAGS += -I../../media/STM25P
+ # Standard include directories:
CFLAGS += -I../../ -I../../core -I../../interfaces -I../../boot
CFLAGS += -I../FlashBridgeViewer
! CFLAGS += -I../../../../tos/lib/State
! # If you use Boomerang, comment out this line:
! CFLAGS += -I../../../../tos/lib/Transceiver
+ # If you use Boomerang, uncomment the following lines
+ # and comment out the above Transceiver line
+ #CFLAGS += -DSTM25P_BOOMERANG_VERSION
+ #CFLAGS += -I../../../../tos/lib/sptransceiver
+ # Compiler optimizer flag:
+ CFLAGS += -Os
+
+ include $(MAKERULES)
Index: blackbookconnect_readme.txt
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/rincon/apps/Blackbook5/apps/BlackbookFullConnect/blackbookconnect_readme.txt,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** blackbookconnect_readme.txt 18 May 2006 22:34:20 -0000 1.1
--- blackbookconnect_readme.txt 7 Jun 2006 19:34:17 -0000 1.2
***************
*** 69,112 ****
-append <written data>
-getRemaining
!
! $ blackbook BFileWrite -open testfile 0x1000
! BFileWrite opened SUCCESS: testfile
! 65512 bytes
! That 65512 bytes is a sector length (65535 bytes) minus the metadata overhead.
! Now let's append some data:
$ blackbook bfilewrite -append writing_to_my_file
BFileWrite append SUCCESS: 18 bytes
!
! You can save the file, and if a catastrophic failure occurs, the
! data from the file will be recovered up to the point where you hit save:
!
$ blackbook bfilewrite -save
BFileWrite save SUCCESS
!
! Closing the file does the same thing as save, so don't save and then
! close because it wastes space in the checkpoint file.
!
! We can find out how many bytes we have left to write:
!
! $ blackbook bfilewrite -getremaining
! 65494 bytes available for writing
!
! Note that at the same time, the BFileDir interface can also provide information
! about the file you currently have open for writing.
!
! Continue to append:
!
$ blackbook bfilewrite -append 1234567890
BFileWrite append SUCCESS: 10 bytes
! Now let's close the file:
$ blackbook bfilewrite -close
Closed SUCCESS
--- 69,111 ----
-append <written data>
-getRemaining
!
! Open a file for writing with 0x1000 bytes:
! $ blackbook bfilewrite -open testfile 0x1000
! BFileWrite opened SUCCESS:
! 4328 bytes
+ Note the 4328 bytes allocated is a bit larger than 0x1000 (4096 bytes).
+ This is because there is some overhead in writing a file -
+ If you want to get technical: the metadata, filename, etc.
+ gets written to flash and then the actual data portion (17 pages worth)
+ of the node is extended to the next page boundary. If you immediately close
+ the file now, the actual size of that node on flash will still be
+ 17 pages long, which is kind of a waste flash space. So be careful
+ with opening files too big and then closing them too soon.
! How much space do we have available for writing again?
! $ blackbook bfilewrite -getremaining
! 4328 bytes available for writing
!
! Now let's append some data. The command line just acts as an example:
$ blackbook bfilewrite -append writing_to_my_file
BFileWrite append SUCCESS: 18 bytes
! Save the file incase a catastrophic failure occurs:
$ blackbook bfilewrite -save
BFileWrite save SUCCESS
! Continue appending data:
$ blackbook bfilewrite -append 1234567890
BFileWrite append SUCCESS: 10 bytes
! Now how many bytes do we have available?
! $ blackbook bfilewrite -getremaining
! 4300 bytes available for writing
+ Close the file. You do not need to save the file immediately before closing.
$ blackbook bfilewrite -close
Closed SUCCESS
More information about the Tinyos-contrib-commits
mailing list