Overview | Project | Class | Tree | Deprecated | Index

Nestopia Core API

FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD

## api
Class Nes::Api::BarcodeReader

    Base
       |
       +--Nes::Api::BarcodeReader

class Nes::Api::BarcodeReader
extends Base

Bar code reader interface.

Constructor Summary
`BarcodeReader( T& instance )` Interface constructor.

Method Summary
`bool` | `CanTransfer() const` Checks if the reader is ready to scan.
`bool` | `IsConnected() const` Checks if a reader is connected.
`bool` | `IsDigitsSupported( uint length ) const` Checks if the number of bar code digits is supported.
`uint` | `Randomize( char(& string )[ MAX_DIGITS+ 1] ) const` Generates a randomized bar code.
`Result` | `Transfer( const char* string, uint length )` Transfers a bar code to the reader.

Constructor Detail

### BarcodeReader

    public BarcodeReader( T& instance );

  Interface constructor.

Parameters:
  `instance` - emulator instance

Method Detail

### CanTransfer

    public bool CanTransfer() const throw();

  Checks if the reader is ready to scan.

Returns:
  true if ready

### IsConnected

    public bool IsConnected() const;

  Checks if a reader is connected.

Returns:
  true if connected

### IsDigitsSupported

    public bool IsDigitsSupported( uint length ) const throw();

  Checks if the number of bar code digits is supported.

Parameters:
  `length` - number of digits in the range 8 to 13
Returns:
  true if supported

### Randomize

    public uint Randomize( char(& string )[ MAX_DIGITS+ 1] ) const throw();

  Generates a randomized bar code.

Parameters:
  `string` - string to be filled
Returns:
  length of randomized bar code, 0 if reader is disconnected

### Transfer

    public Result Transfer( const char* string, uint length ) throw();

  Transfers a bar code to the reader.

Parameters:
  `string` - bar code string
  `length` - string length
Returns:
  result code

Overview | Project | Class | Tree | Deprecated | Index

Nestopia Core API

FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD