Read

Description

You can read up to 512 bytes at a time using the Read command. If the num parameter is larger than the number of bytes remaining to be read from the file, then only the remaining bytes are returned. Use the Info command to find the current position. If the Read command is successful, a single «sp» character is sent, followed by the data. If an error occurs, the first character returned is ”E”, followed by an error code. Data is sent verbatim (i.e. raw data) from the file.


Format

R fh [num [addr]]


Parameters

  • fh is a file handle (1 - 4). Use the Free Handle command to get a free file handle.
  • num is the number of bytes to read. Optional. If not specified, up to 512 bytes will be returned.
  • addr is the address at which to start reading. Optional. num must be given for this parameter to be used.

Response Format

«sp»response | Enn

response is preceded by a «sp», indicating a good read. The length of response is variable, and depends on the num parameter, the position of the file handle, and the size of the file.


Example

File handle position = 0, file size = 38 bytes:

R 1

«sp»13:22:02 ADC1=4.9V«cr» 13:22:32 ADC1=4.9V«cr»

A subsequent read:

R 1

E07

Same file, read only 18 bytes (starting at address 0):

R 1 18 0

«sp»13:22:02 ADC1=4.9V

  • Bookmark at
  • Bookmark "Read" at del.icio.us
  • Bookmark "Read" at Digg
  • Bookmark "Read" at Google
  • Bookmark "Read" at StumbleUpon
  • Bookmark "Read" at Technorati
  • Bookmark "Read" at Facebook
  • Bookmark "Read" at Twitter
  • Bookmark "Read" at Slashdot
  • Bookmark "Read" at Yahoo! Bookmarks
  • Bookmark "Read" at Furl
  • Bookmark "Read" at Reddit
  • Bookmark "Read" at Ask
  • Bookmark "Read" at BlinkList
  • Bookmark "Read" at blogmarks
  • Bookmark "Read" at Ma.gnolia
  • Bookmark "Read" at Netscape
  • Bookmark "Read" at ppnow
  • Bookmark "Read" at Rojo
  • Bookmark "Read" at Shadows
  • Bookmark "Read" at Simpy
  • Bookmark "Read" at Socializer
  • Bookmark "Read" at Spurl
  • Bookmark "Read" at Tailrank
  • Bookmark "Read" at Live Bookmarks
  • Bookmark "Read" at Wists
  • Bookmark "Read" at Yahoo! Myweb
  • Bookmark "Read" at BobrDobr
  • Bookmark "Read" at Memori
  • Bookmark "Read" at Faves
  • Bookmark "Read" at Favorites
  • Bookmark "Read" at Newsvine
  • Bookmark "Read" at myAOL
  • Bookmark "Read" at Fark
  • Bookmark "Read" at RawSugar
  • Bookmark "Read" at LinkaGoGo
  • Bookmark "Read" at Mister Wong
  • Bookmark "Read" at Wink
  • Bookmark "Read" at BackFlip
  • Bookmark "Read" at Diigo
  • Bookmark "Read" at Segnalo
  • Bookmark "Read" at Netvouz
  • Bookmark "Read" at DropJack
  • Bookmark "Read" at Feed Me Links
  • Bookmark "Read" at funP
  • Bookmark "Read" at HEMiDEMi
ummc/documentation/command/read.txt · Last modified: 2009/10/27 19:53 by bhagman
Valid CSS Recent changes RSS feed Valid XHTML 1.0