KIOSK

GUIDE
top

B2BBarCode API

To use Samsung B2B API, 

<script type="text/javascript" src="$B2BAPIS/b2bapis/b2bapis.js"></script>

Should be loaded in index.html

'B2BBarCode::B2BBarCodeManagerObject' interface

Public Attributes

readonly attribute B2BBarCodeManager b2bbarcode

Details in English

Namespace forB2BBarCode API.

Returns

B2BBarCode API의 네임스페이스.

Privilege Level

Public

Privilege

http://developer.samsung.com/privilege/b2bbarcode

Version

1.0

Since

4.0

Product

B2B

SDK Support

N

'B2BBarCode::B2BBarCodeManager' interface

Public Methods

DOMString getVersion ( )
This interface provides methods to get b2bbarcode module version. More...
void setScanTimeOut ( unsigned long scanTimeOut )
Interface to set timeout of scan barcode. More...
void startScanBarcode ( B2BBarCodeListener onlistener )
Interface to set callback for reading barcode data. More...
void stopScanBarcode ( )
This method remove the async event listener to the module for Barcode callback. More...

Public Methods

DOMString getVersion()

   This interface provides methods to get b2bbarcode module version.

Details in English

get b2bbarcode module version.

Returns

DOMString b2bbarcode plug-in's version.

Exceptions

B2bAPIException
   with error type SecurityError, if the application does not have the privilege to call this method.
B2bAPIException
   with error type UnknownError in any other error case.
var Version = null;
try {
Version = b2bapis.b2bbarcode.getVersion();
} catch (e) {
console.log("[getVersion] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
}
if(null !== Version){
console.log("[getVersion] call syncFunction type: " + Version);
}

Privilege Level

Public

Privilege

http://developer.samsung.com/privilege/b2bbarcode

Product

B2B_LFD

Version

1.0

Since

4.0

SDK Support

N

void setScanTimeOut(unsigned long scanTimeOut)

   Interface to set timeout of scan barcode.

Details in English

This interface provides methods to set timeout of scan timming.

Parameters

scanTimeOut
   amount time of scan waiting Default is 30secs The time range is 5 to 90 seconds.

Returns

Success string is returned when api is pass or Unable to set timeout message is returned when api is fail.

Exceptions

B2bAPIException
   with error type SecurityError, if the application does not have the privilege to call this method.
B2bAPIException
   with error type TypeMismatchError, Invalid parameter type passed for input parameter.
var scanTimeOut = 90;
try
{
b2bapis.b2bbarcode.setScanTimeOut(scanTimeOut);
}
catch(e)
{
console.log("[setScanTimeOut] call syncFunction exception " + e.code + " " + e.errorName + " " + e.errorMessage);
}

Privilege Level

Public

Privilege

http://developer.samsung.com/privilege/b2bbarcode

Version

1.0

Since

4.0

Product

B2B_LFD

SDK Support

N

void startScanBarcode( B2BBarCodeListener onlistener)

   Interface to set callback for reading barcode data.

Details in English

This interface provides methods to add the async event listener to read sanned barcode data.

Parameters

onlistener
   Cllback function to listen the barcode data.

Returns

Success string is returned when api is pass or Unable to start barcode message is returned when api is fail.

Exceptions

B2bAPIException
   with error type SecurityError, if the application does not have the privilege to call this method.
B2bAPIException
   with error type TypeMismatchError, Invalid parameter type passed for input parameter.
B2bAPIException
   with error type Service not available error, if the API fail to register callback successfully.
function onlistener(barCodeData)
{
console.log("Barcode data is " + barCodeData.data);
}
try
{
b2bapis.b2bbarcode.startScanBarcode(onlistener);
}
catch(e)
{
console.log("[startScanBarcode] call syncFunction exception " + e.code + " " + e.errorName + " " + e.errorMessage);
}

Privilege Level

Public

Privilege

http://developer.samsung.com/privilege/b2bbarcode

Version

1.0

Since

4.0

Product

B2B_LFD

SDK Support

N

void stopScanBarcode()

   This method remove the async event listener to the module for Barcode callback.

Details in English

This interface provide method to deactivate the barcode data listner callback.

Returns

Success string is returned when api has no error. Error string is returned when api is fail.

Exceptions

B2bAPIException
   with error type SecurityError, if the application does not have the privilege to call this method.
function stopScanBarcode() {
try {
b2bapis.b2bbarcode.stopScanBarcode();
} catch (e) {
console.log("stopScanBarcode exception [" + e.code + "] name: " + e.name + " message: " + e.message);
}
}

Privilege Level

Public

Privilege

http://developer.samsung.com/privilege/b2bbarcode

Product

B2B_LFD

Version

1.0

Since

4.0

SDK Support

N

'B2BBarCode::B2BBarCodeListener' interface

Public Methods

void onlistener ( b2bResult data )
Interface to set callback for reading barcode data. More...

Public Methods

void onlistener( b2bResult data)

   Interface to set callback for reading barcode data.

Details in English

This method is callback parameter.

Parameters

data
   Provide barcode message whenever data is scanned.

Returns

N/A

Exceptions

N/A
   
function onlistener(barCodeData)
{
console.log("Barcode data is " + barCodeData.data);
}
try
{
b2bapis.b2bbarcode.startScanBarcode(onlistener);
}
catch(e)
{
console.log("[startScanBarcode] call syncFunction exception " + e.code + " " + e.errorName + " " + e.errorMessage);
}

Version

1.0

Since

4.0

Privilege Level

Public

Privilege

http://developer.samsung.com/privilege/b2bbarcode

Product

B2B

SDK Support

N

위로가기