Reading a Folder/File

Hi All,

We have been using the uALFATwith great success and have it in a number of our products, writing and saving data to a SD Card is working very well. No I want to read the data in the folder we have created and read the data in each text file and send it out via a Bluetooth device.

Currently I am struggling with some of the commands and not sure of a few things, can someone please point me in the right direction?,

Currently I am doing the following:

I U0:
!00
!00
J
!00
$24
!00
!00

K U0:

!00
$000000003D4A8000
!00
!00

@ U0:\GAVIN
!00
!00
N
!00
.$10
$00000000
!00
!00
N
!00

$10
$00000000
!00
!00

N

!00
GAVIN.TXT
$20
$00000005
!00
!00
O nU0>GAVIN.TXT 'Not sure if I have this correct

!02
!00
O nU0:>GAVIN.TXT

!02
!00

  O nM:>GAVIN.TXT   'Not sure if I have this correct

!02
!00
0 nU0:>GAVIN\GAVIN.TXT 'Not sure if I have this correct

!01
!00
O 1R>U0:\GAVIN\GAVIN.TXT

!00
!00
R nU0:000000003D4A8000 'Not sure how to deal with this?

!02
!00
R nU0:3D4A8000 'Not sure how to deal with this?

!02
!00
R nU0:ssssssss 'Not sure how to deal with this?

!02
!00
R 2^>5

!36
!00

@ cyberh0me -

  1. When open a handle, you have to point out the file name (and full path if different directory), and tie it to a handle number. This happens with “O” command.
  2. Once you setup the handle number above, you don’t need to provide the file name (or path), it was tied to the handle at step 1. It happens with “W” (write) or R (read).
  3. The path does not include “>”. This symbol “>” is used to separate the parameters in a command.
    Example:
  • U0:\TEST\TEST1.txt => OK
  • U0:>\TEST\TEST1.txt or U0>TEST\TEST1.txt => Not OK.
  • R 0$>10 => OK, it means Read handle 0, filter is character $, user wants 0x10 bytes. “>” is used to separate betweem “$” and 10. Same for Write command.

@ Dat - Thanks Dat I will try that!

Hi Dat,

Looks like I have it, please see below:

Regards,

Gavin

I U0:

!00
!00

J

!00
$24
!00
!00

K U0:

!00
$00000001DCC30000
!00
!00
@ U0:\TEST

!00
!00
N

!00
.
$10
$00000000
!00
!00
N

!00

$10
$00000000
!00
!00
N

!00
TEST1.TXT
$20
$00000005
!00
!00
N

!00
GAVIN.TXT
$20
$00000005
!00
!00
N

!04
!00

O 0R>U0:\TEST\TEST1.TXT

!00
!00

R 0^>5

!00
TEST1$00000005
!00
!00

O 1R>U0:\TEST\GAVIN.TXT

!00
!00
R 1^>5

!00
HELLO$00000005
!00
!00

@ gavo4444 -

Sweet!!