Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeEnglishEspañolContact

The text of a manual · part 8 of 12

Spectrum One Serial Access Bridge (SAB) II Programmer's Reference Guide: Chapter 3 BAR Reference, pages 53 to 62

Pages 53 to 62 of 94, from Spectrum One Serial Access Bridge (SAB) II Programmer's Reference Guide

The original document is the PDF (1.8 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.

Filed in the catalog under the Symbol SAB-Lite

Page 53

BAR Reference

Write Binary Data to File Requests host write a data block to a previously opened file in the host file system. The file handle returned from the CREATE FILE command identifies the file. Table 3-14. Write Binary Data to File Command Packet

Byte Value 0 VAR

Description flags

1 2 3 4-7 command code data length data length file handle

0x05 VAR VAR XXX

Details bit 0 = 1 command packet bit 1 reserved BAR_WRITEDATA LSB MSB

The file must be opened in a binary mode with no conversions by the host. The data field contains data written to the file. Data length can be 512 bytes maximum. Table 3-15. Write Binary Data to File Response Packet

Byte Value 0 VAR

Description flags

1 2 3 4-7 return code data length data length file handle

VAR 0x00 0x00 XXX

Details bit 0= 0 response packet bit 1 reserved Refer to Table 3-16

No data field returns with this reply.

3-11

Page 54

SAB II - Programmer’s Reference Guide Table 3-16. Write Binary Data to File Return Codes

Value 0x00 0x01 0x04 0x05 0x06

3-12

Name Description BAR_RTN_OK good return BARERR_BADPAK invalid packet BARERR_BADFILHAN invalid file handle given BARERR_OPERATIO host operation error occurred N BARERR_UNKNOWN unimplemented BAR error

Page 55

BAR Reference

Seek Bits Requests host seek to a random position within a previously opened file in the host file system. The file handle returned from the OPEN FILE or CREATE FILE commands identifies the file. Table 3-17. Seek Bits Command Packet

Byte Value 0 VAR

Description flags

1 2 3 4-7 command code data length data length file handle

0x06 VAR VAR XXX

Details bit 0= 1command packet bit 1 reserved bits 5,6 seek start position: 00 = from start of file 01 = from current position 10 = from end of file BAR_SEEKFILE LSB MSB

The data field contains the seek offset, from the position specified by flag bits 5 and 6, for this request. This long integer data is represented as an ASCII numeric, NULL-terminated string.

3-13

Page 56

SAB II - Programmer’s Reference Guide Table 3-18. Seek Bits Response Packet

Byte Value 0 VAR

Description flags

1 2 3 4 return code data length data length file handle

VAR 0x00 0x00 XXX

Details bit 0= 0 response packet bit 1-3 reserved bit 4 1 = text file, 0 = binary file bits 5,6 seek start position: 00 = from start of file 01 = from current position 10 = from end of file Refer to Table 3-19

No data field returns with this reply. Table 3-19. Seek Bits Return Codes

Value 0x00 0x01 0x04 0x05 0x06

3-14

Name Description BAR_RTN_OK good return BARERR_BADPAK invalid packet BARERR_BADFILHAN invalid file handle given BARERR_OPERATIO host operation error occurred N BARERR_UNKNOWN unimplemented BAR error

Page 57

BAR Reference

Read Text Line From File Requests host read a single text line from a host text file. A text line is defined as ASCII printable data, terminated by a linefeed (LF) and a NULL character. The file handle returned from the OPEN FILE command identifies the file. The file must have been opened in text mode. The conversion to and from the text line format must be provided on the host. Table 3-20. Read Text Line From File Command Packet

Byte Value 0 VAR

Description flags

1 2 3 4-7 command code data length data length file handle

0x07 VAR VAR XXX

Details bit 0= 1 command packet bit 1 reserved BAR_GETLINE LSB MSB

The data field contains the maximum read length for this request. The integer data is represented as an ASCII numeric, NULL-terminated string. Table 3-21. Read Text Line From File Response Packet

Byte Value 0 VAR

Description flags

1 2 3 4-7 return code data length data length file handle

VAR 0x00 0x00 XXX

Details bit 0 = 0 response packet bit 1 reserved Refer to Table 3-22 LSB MSB

3-15

Page 58

SAB II - Programmer’s Reference Guide

The data length header field (bytes 2 and 3) gives the actual length of data read from the host file, up to and including the terminating NULL character. The data field contains the file data read, up to the maximum requested. The data is terminated with a linefeed and NULL characters. Table 3-22. Read Text Line From File Return Codes

Value 0x00 0x01 0x04 0x05 0x06

3-16

Name Description BAR_RTN_OK good return BARERR_BADPAK invalid packet BARERR_BADFILHAN invalid file handle given BARERR_OPERATIO host operation error occurred N BARERR_UNKNOWN unimplemented BAR error

Page 59

BAR Reference

Write Text Line To File Requests host write a text line to a previously opened text file in the host file system. A text line is defined as ASCII printable data, terminated by a linefeed (LF) and Null character. The file handle returned from the CREATE FILE command identifies the file. The file must have been opened in text mode. The conversion to and from the text line format must be provided on the host. Table 3-23. Write Text Line To File Command Packet

Byte Value 0 VAR

Description flags

1 2 3 4-7 command code data length data length file handle

0x08 VAR VAR XXX

Details bit 0= 1 command packet bit 1 reserved BAR_PUTLINE LSB MSB

The data field contains the data written to the file. Data length is a maximum of 512 bytes up to and including the terminating NULL character. Table 3-24. Write Text Line To File Response Packet

Byte Value 0 VAR

Description flags

1 2 3 4-7 return code data length data length file handle

VAR 0x00 0x00 XXX

Details bit 0= 0 response packet bit 1 reserved Refer to Table 3-25

3-17

Page 60

SAB II - Programmer’s Reference Guide

No data field returns with this reply. Table 3-25. Write Text Line To File Return Codes

Value 0x00 0x01 0x04 0x05 0x06

3-18

Name Description BAR_RTN_OK good return BARERR_BADPAK invalid packet BARERR_BADFILHAN invalid file handle given BARERR_OPERATIO host operation error occurred N BARERR_UNKNOWN unimplemented BAR error

Page 61

BAR Reference

Send Message Requests host accept a message in a text stream form. Flags are used by SAB to classify message into one of 16 groups. In general, text string informs host of SAB status or errors. Table 3-26. Send Message Command Packet

Byte Value 0 VAR

Description flags

1 2 3 4-7 command code data length data length unused

0x09 VAR VAR XXX

Details bit 0 = 1 response packet bit 1 reserved bits 4-7 message type 0000 = informational 0001 = SAB fatal error 0011 = log message BAR_BRIDGEMSG LSB MSB

The data field contains the text of the delivered message, represented as a NULL-terminated ASCII string. No response message is generated for this command.

3-19

Page 62

SAB II - Programmer’s Reference Guide

Get Host Date and Time Requests host return date, time and day, as three ASCII NULL-terminated strings in the response packet data field. Table 3-27. Get Host Date and Time Command Packet

Byte Value 0 VAR

Description flags

1 2 3 4-7 command code data length data length unused

0x0A 0x00 0x00 XXX

Details bit 0 = 1 command packet bit 1 reserved BAR_GETTIME

The data length fields (bytes 2 and 3) are set to a value of zero. No data field is attached to this packet. Table 3-28. Get Host Date and Time Response Packet

3-20

Byte Value 0 VAR

Description flags

1 2 3 4-7 return code data length data length unused

VAR 0x00 0x14 XXX

Details bit 0 = 0 response packet bit 1 reserved Refer to Table 3-29 LSB MSB