Cuss2Service

Core service for managing CUSS2 platform connection and component lifecycle.

connect(clientId: string, clientSecret: string, url?: string): Observable<boolean>

Establishes connection to CUSS2 platform with OAuth authentication.

this.cuss2Service.connect(
  'your-client-id',
  'your-client-secret',
  'wss://platform.airline.com/cuss2' // Optional custom URL
).subscribe(connected => {
  if (connected) {
    console.log('Connected to CUSS2 platform');
  }
});

connected$: Observable<boolean>

Observable that emits connection status changes.

this.cuss2Service.connected$.subscribe(connected => {
  if (connected) {
    this.enableKioskFeatures();
  } else {
    this.showOfflineMode();
  }
});

components$: Observable<ComponentInfo[]>

Observable of available CUSS2 components and their status.

this.cuss2Service.components$.subscribe(components => {
  const barcodeReader = components.find(c => c.deviceType === 'BARCODE_READER');
  if (barcodeReader?.enabled) {
    this.showScanOption();
  }
});

BarcodeReaderService

Service for barcode and QR code scanning with real-time data streams.

data$: Observable<PlatformData>

Observable stream of barcode scan events.

this.barcodeReader.data$.pipe(
  filter(data => data?.meta?.messageCode === MessageCodes.DATA_PRESENT)
).subscribe(data => {
  const barcodes = data.payload.dataRecords.map(dr => dr.data);
  console.log('Scanned barcodes:', barcodes);
});

read(ms?: number): Observable<string[]>

Initiate a barcode read operation with optional timeout (default: 30 seconds).

Parameters:
  • ms (optional): Timeout in milliseconds
this.barcodeReader.read(10000).subscribe({
  next: (barcodes) => console.log('Read barcodes:', barcodes),
  error: (err) => console.error('Read timeout:', err)
});

enable(): Observable<PlatformData>

Enable the barcode reader component.

this.barcodeReader.enable().subscribe(() => {
  console.log('Barcode reader enabled');
});

disable(): Observable<PlatformData>

Disable the barcode reader component.

query(): Observable<PlatformData>

Query the current status of the barcode reader component.

CardReaderService

Service for magnetic stripe card reading with payment support.

data$: Observable<PlatformData>

Observable stream of card read events.

read(ms?: number): Observable<string[]>

Read card tracks with optional timeout.

this.cardReader.read(15000).subscribe({
  next: (tracks) => {
    console.log('Card tracks:', tracks);
    this.processCardData(tracks);
  },
  error: (err) => console.error('Card read failed:', err)
});

enablePayment(enabled: boolean): Observable<void>

Enable or disable payment mode for processing payment cards.

Parameters:
  • enabled: True to enable payment mode, false to disable
this.cardReader.enablePayment(true).subscribe(() => {
  console.log('Payment mode enabled');
});

readPayment(ms?: number): Observable<void>

Perform a complete payment card read operation.

this.cardReader.readPayment(30000).subscribe(() => {
  console.log('Payment card read initiated');
});

DocumentReaderService

Service for passport and ID document scanning with MRZ processing.

data$: Observable<PlatformData>

Observable stream of document scan events.

this.documentReader.data$.pipe(
  filter(data => data?.meta?.messageCode === MessageCodes.DATA_PRESENT)
).subscribe(data => {
  const documentLines = data.payload.dataRecords.map(dr => dr.data);
  const mrzLines = documentLines.filter(line => this.isMRZLine(line));
  this.processMRZ(mrzLines);
});

read(ms?: number): Observable<string[]>

Read document data with optional timeout (default: 30 seconds).

this.documentReader.read(45000).subscribe({
  next: (lines) => {
    const passportData = this.extractPassportData(lines);
    this.updatePassengerInfo(passportData);
  },
  error: (err) => console.error('Document read failed:', err)
});

CameraService

Service for camera operations including image capture, video recording, and live preview for passenger assistance and documentation.

data$: Observable<DataRecord[]>

Observable stream of camera data events including image and video data.

this.camera.data$.pipe(
  filter(data => data?.meta?.messageCode === MessageCodes.DATA_PRESENT)
).subscribe(data => {
  const imageData = data.payload.imageData;
  console.log('Camera data received:', imageData);
  this.displayImage(imageData);
});

onRead$: Observable<(string | null)[]>

Observable that emits camera capture results when data is ready.

this.camera.onRead$.subscribe(photos => {
  if (photos && photos.length > 0) {
    console.log('Photos captured:', photos);
    this.processPhotos(photos);
  }
});

onReady$: Observable<boolean>

Observable that emits camera ready status changes.

this.camera.onReady$.subscribe(ready => {
  if (ready) {
    console.log('Camera is ready for capture');
    this.enableCameraControls();
  }
});

read(ms?: number): Observable<DataRecord[]>

Capture photo with optional timeout (default: 30 seconds). Automatically enables the camera, waits for data, then disables it.

Parameters:
  • ms (optional): Timeout in milliseconds
this.camera.read(10000).subscribe({
  next: (photos) => {
    console.log('Photos captured:', photos);
    this.savePhotos(photos);
  },
  error: (err) => console.error('Capture timeout:', err)
});

enable(): Observable<PlatformData>

Enable the camera component.

this.camera.enable().subscribe(() => {
  console.log('Camera enabled');
});

disable(): Observable<PlatformData>

Disable the camera component.

query(): Observable<PlatformData>

Query the current status of the camera component.

component$: Observable<ComponentInfo | undefined>

Observable of the current camera component information and status.

BiometricService

Service for biometric operations including fingerprint scanning, face recognition, and iris scanning for passenger identification and security.

data$: Observable<PlatformData>

Observable stream of biometric capture events.

this.biometric.data$.pipe(
  filter(data => data?.meta?.messageCode === MessageCodes.DATA_PRESENT)
).subscribe(data => {
  const biometricData = data.payload.biometricData;
  console.log('Biometric captured:', biometricData);
  this.verifyPassenger(biometricData);
});

onRead$: Observable<(string | null)[] | undefined>

Observable that emits biometric read results when data is captured.

this.biometric.onRead$.subscribe(biometricData => {
  if (biometricData && biometricData.length > 0) {
    console.log('Biometric data captured:', biometricData);
    this.matchWithDatabase(biometricData);
  }
});

onReady$: Observable<boolean>

Observable that emits biometric device ready status changes.

this.biometric.onReady$.subscribe(ready => {
  if (ready) {
    console.log('Biometric device is ready');
    this.startBiometricCapture();
  }
});

read(ms?: number): Observable<string[]>

Read biometric data with optional timeout (default: 30 seconds). Automatically enables the device, waits for data, then disables it.

Parameters:
  • ms (optional): Timeout in milliseconds
this.biometric.read(15000).subscribe({
  next: (biometricData) => {
    console.log('Biometric data:', biometricData);
    this.performVerification(biometricData);
  },
  error: (err) => console.error('Capture failed:', err)
});

enable(): Observable<PlatformData>

Enable the biometric component.

this.biometric.enable().subscribe(() => {
  console.log('Biometric device enabled');
});

disable(): Observable<PlatformData>

Disable the biometric component.

query(): Observable<PlatformData>

Query the current status of the biometric component.

component$: Observable<ComponentInfo | undefined>

Observable of the current biometric component information and status.

BoardingPassPrinterService

Service for boarding pass printing with ITPS format support.

setup(assets: string[]): Observable<PlatformData>

Load printer assets in PT## format (logos, templates).

Parameters:
  • assets: Array of asset strings in PT## format
this.printer.setup([
  'PT01AIRLINE_LOGO.png',
  'PT02Boarding Pass Template',
  'PT03Terms and Conditions'
]).subscribe(() => {
  console.log('Printer assets loaded');
});

print(coupon: string[]): Observable<PlatformData>

Print boarding pass with passenger data in CP# format.

Parameters:
  • coupon: Array of coupon data strings in CP# format
this.printer.print([
  'CP#A#01S#CP#C01#02@@01#03M1THIS IS A BARCODE#04THIS IS A BOARDING PASS#'
]).subscribe(() => {
  console.log('Boarding pass printed');
});

BagTagPrinterService

Service for baggage tag printing with automatic asset parsing.

setup(assets: string[]): Observable<PlatformData>

Load bag tag assets with automatic line splitting.

const companyLogo = 'LT0146940A020101000000001D01630064006400000000000000000000' +
'000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF...';
const assets = 'BTT0801~J 500262=#01C0M5493450304#02C0M5493450304#03B1MA020250541=06' +
'#04B1MK200464141=06#05L0 A258250000#\n' + companyLogo;

this.printer.setup([assets]).subscribe(() => {
  console.log('Bag tag assets loaded');
});

print(coupon: string[]): Observable<PlatformData>

Print bag tag with passenger and baggage information.

this.printer.print([
  'BTP080101#01THIS IS A#02BAG TAG#03123#04456#0501#'
]).subscribe(() => {
  console.log('Bag tag printed');
});

KeypadService

Service for navigation keypad with structured KeypadData events.

keypadData$: Observable<KeypadData>

Observable stream of structured keypad navigation data.

this.keypad.keypadData$.subscribe((keypad: KeypadData) => {
  if (keypad.UP) this.navigateUp();
  if (keypad.DOWN) this.navigateDown();
  if (keypad.ENTER) this.selectCurrent();
  if (keypad.HOME) this.goToMainMenu();
});

data$: Observable<PlatformData>

Observable stream of raw keypad platform data.

ScaleService

Service for luggage weighing with real-time monitoring.

data$: Observable<PlatformData>

Observable stream of weight measurement data.

this.scale.data$.pipe(
  filter(data => data?.meta?.messageCode === MessageCodes.DATA_PRESENT),
  map(data => {
    const weights = data.payload.dataRecords.map(dr => dr.data);
    return weights.length > 0 ? parseFloat(weights[0]) : 0;
  })
).subscribe(weight => {
  console.log('Current weight:', weight, 'kg');
  this.updateWeightDisplay(weight);
});

read(ms?: number): Observable<string[]>

Read weight measurement with optional timeout.

this.scale.read(15000).subscribe({
  next: (weights) => {
    const weight = weights.length > 0 ? parseFloat(weights[0]) : 0;
    if (weight > 50) {
      this.showOverweightAlert(weight);
    }
  },
  error: () => console.log('No weight detected')
});

HeadsetService

Service for audio headset management and accessibility support.

data$: Observable<PlatformData>

Observable stream of headset status and connection events.

events$: Observable<Cuss2Event>

Observable stream of headset-specific events (connect/disconnect).

this.headset.events$.subscribe(event => {
  switch (event.type) {
    case 'connected':
      this.enableAccessibilityMode();
      break;
    case 'disconnected':
      this.disableAccessibilityMode();
      break;
  }
});

AnnouncementService

Service for text-to-speech announcements and SSML playback.

say(text: string, lang?: string): Observable<PlatformData>

Convert text to speech with optional language specification.

Parameters:
  • text: Text to be spoken
  • lang (optional): Language code (e.g., 'en-US', 'es-ES')
this.announcement.say('Welcome to check-in', 'en-US').subscribe(() => {
  console.log('Announcement completed');
});

play(ssml: string): Observable<PlatformData>

Play SSML (Speech Synthesis Markup Language) formatted content.

const ssml = `
  
    Attention
    
    Flight UA123 is boarding
  
`;
this.announcement.play(ssml).subscribe();

stop(): Observable<PlatformData>

Stop current announcement playback.

pause(): Observable<PlatformData>

Pause current announcement playback.

resume(): Observable<PlatformData>

Resume paused announcement playback.

KeypadData Interface

Interface for structured keypad navigation data with boolean flags.

export interface KeypadData {
  UP: boolean;           // Up arrow key pressed
  DOWN: boolean;         // Down arrow key pressed
  PREVIOUS: boolean;     // Previous navigation key pressed
  NEXT: boolean;         // Next navigation key pressed
  ENTER: boolean;        // Enter/Select key pressed
  HOME: boolean;         // Home key pressed
  END: boolean;          // End key pressed
  HELP: boolean;         // Help key pressed
  VOLUMEUP: boolean;     // Volume up key pressed
  VOLUMEDOWN: boolean;   // Volume down key pressed
}

Usage Example:

this.keypadService.keypadData$.subscribe((keypad: KeypadData) => {
  // Navigation
  if (keypad.UP) this.moveSelectionUp();
  if (keypad.DOWN) this.moveSelectionDown();
  if (keypad.ENTER) this.confirmSelection();
  
  // Volume control
  if (keypad.VOLUMEUP) this.increaseVolume();
  if (keypad.VOLUMEDOWN) this.decreaseVolume();
  
  // Help and navigation
  if (keypad.HELP) this.showHelpDialog();
  if (keypad.HOME) this.navigateToHome();
});

*cuss2Ready Directive

Structural directive for conditional rendering based on CUSS2 connection status.

Basic Usage:

<div *cuss2Ready="let connected">
  <div *ngIf="connected; else connecting">
    <h2>CUSS2 Platform Connected</h2>
    <!-- Your kiosk interface here -->
  </div>
  <ng-template #connecting>
    <p>Connecting to CUSS2 platform...</p>
  </ng-template>
</div>

Advanced Usage with Component Access:

<div *cuss2Ready="let connected; let components = components">
  <div *ngIf="connected">
    <div *ngFor="let component of components">
      <p>{{ component.deviceType }}: {{ component.enabled ? 'Ready' : 'Disabled' }}</p>
    </div>
  </div>
</div>