Communication Protocol
Example 1 Figure
|
| T ra n s fe rin g A F ile |
| |
|
| F ro m R e m o te |
| |
|
| C o n tro lle r to P la ye r |
| |
C o n tro lle r |
|
|
| P la ye r |
|
|
| ||
|
|
|
|
|
F S _ F C R E A T E (N a m e o f F ile , N u m b e r o f b lo c k to tra n s fe r) | ||
S Y S T E M _A C K + S T A T U S | ||
F S _ F W R IT E _ |
|
|
B L O C K + d a ta | ||
S Y S T E M _A C K + S T A | TU S | |
| ||
F S _ |
|
|
F W R IT E _ L A S T |
|
|
_ B L O C K + d a ta | ||
S Y S T E M _A C K + S | T A TU S | |
|
|
P la ye r c re a te s th e
file o n s e le c te d
m e m o ry (in ro o t d ir). N o w w a itin g fo r d a ta .
P la ye r p ro g ra m m s
n o w th e m e m o ry a n d p re p a re N o w w a itin g fo r d a ta .
P la ye r p ro g ra m s th e la s t b lo c k o f d a ta . F ile is c lo s e d . N o n e e d to s e n d th e
F S _ F C L O S E fra m e .
During the file write transfer, after the FS_FCREATE command, no other commands than FS_FWRITE_BLOCK, FS_FWRITE_LAST_BLOCKor FS_FCLOSE are allowed to finish the file transfer because the AT83SND2CMP3 is an optimized transfer mode.
To create the file “wr_test.mp3” (total size 1312 Bytes: 2 block of 512 bytes + last block
288 bytes):
Send FS_FCREATE ( 3 blocks, ‘w’ ‘r’ ‘_’ ‘t’ ‘e’ ‘s’ ‘t’ ‘.’ ‘m’ ‘p’ ‘3’ ‘\0’)
Wait for response SYSTEM_ACK* frame.
Send FS_FWRITE_BLOCK + 1st block of data (512 bytes),
Wait for response SYSTEM_ACK* frame.
Send FS_FWRITE_BLOCK + 2nd block of data (512 bytes)
Wait for response SYSTEM_ACK* frame.
send FS_FWRITE_LASTBLOCK ( 288 bytes ) + last block of data (288 bytes)
Wait for response SYSTEM_ACK* frame. The file is now created.
Note: If Player response is SYSTEM_NACK to any command during this procedure, the Player will return into the IDLE state and the file creation procedure will be aborted.
AT83SND2CMP3 User Guide |