### createApi Function Source: https://sdk.jabra.com/javascript/docs/jabra-js/4.4.1/functions/createApi Initializes the Jabra SDK without starting device discovery, enabling setup of infrastructure before calling IApi.start. ```APIDOC ## createApi ### Description Create the Jabra SDK without starting device discovery. This allows for setting up infrastructure depending on the SDK before starting device discovery by calling IApi.start. ### Method ```javascript createApi(config?: IConfig): Promise ``` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```javascript // Example usage: import { createApi } from "@gnaudio/jabra-js"; async function initializeSDK() { try { const api = await createApi(); // Or with configuration: createApi({ /* config options */ }) console.log("Jabra SDK initialized successfully."); // Now you can call api.start() to begin device discovery } catch (error) { console.error("Failed to initialize Jabra SDK:", error); } } initializeSDK(); ``` ### Response #### Success Response (200) - **IApi** (object) - The initialized SDK object, which can be used to control Jabra hardware. #### Response Example ```json { // Represents the IApi object, methods for controlling Jabra devices would be available here "deviceDiscovery": { /* ... */ }, "start": "function", "stop": "function" // ... other methods and properties } ``` #### Throws - If the underlying transport object (console-app or Chrome extension) fails to connect for some reason, e.g. when it's not installed on the system. ``` -------------------------------- ### Initialize and Start Jabra SDK Source: https://sdk.jabra.com/javascript/docs/jabra-js/4.4.1/interfaces/IApi Starts the Jabra SDK device discovery process. This method should be called after the SDK is initialized. It returns a Promise that resolves when discovery begins. ```javascript import { Jabra } from "@gnaudio/jabra-js"; async function initializeAndStartSDK() { try { const api = await Jabra.init(); await api.start(); console.log("Jabra SDK started successfully."); } catch (error) { console.error("Error initializing or starting Jabra SDK:", error); } } ``` -------------------------------- ### start Source: https://sdk.jabra.com/javascript/docs/jabra-js/4.4.1/interfaces/IApi Initiates the device discovery process for Jabra devices. ```APIDOC ## POST /api/jabra/start ### Description Start device discovery. ### Method POST ### Endpoint /api/jabra/start ### Parameters None ### Request Example None ### Response #### Success Response (200) - **message** (string) - Indicates that device discovery has started successfully. #### Response Example ```json { "message": "Device discovery started." } ``` ``` -------------------------------- ### Initialize Jabra SDK Source: https://sdk.jabra.com/javascript/docs/jabra-js/4.4.1/functions/init Initializes the Jabra SDK and starts device discovery. This is the entry point for controlling Jabra hardware. ```APIDOC ## Function init ### Description Initializes the Jabra SDK and starts device discovery. Entry point to being able to control Jabra hardware. ### Method POST ### Endpoint /init ### Parameters #### Request Body - **config** (IConfig | undefined) - Optional - Optional configuration settings. See IConfig for more details. ### Request Example ```json { "config": { "url": "http://localhost:8080", "appId": "your-app-id" } } ``` ### Response #### Success Response (200) - **api** (IApi) - The initialized SDK object, which can be used to control Jabra hardware. #### Response Example ```json { "api": { "// ... SDK methods ...": "// ..." } } ``` ### Throws If the underlying transport object (console-app or Chrome extension) fails to connect for some reason, e.g. when it's not installed on the system. ``` -------------------------------- ### Subcommand Static Factory Methods - JavaScript Source: https://sdk.jabra.com/javascript/docs/jabra-js/4.4.1/classes/Subcommand Illustrates how to use the static factory methods `empty` and `get` to create instances of the Subcommand class. The `empty` method creates a default subcommand for a given command ID, while `get` creates a subcommand with specific command and subcommand IDs. ```javascript import { Subcommand } from "@gnaudio/jabra-js"; // Create an empty subcommand for command ID 5 const emptySubcommand = Subcommand.empty(5); console.log(emptySubcommand.commandId); // 5 console.log(emptySubcommand.subcommandIndex); // undefined // Create a specific subcommand with command ID 10 and subcommand ID 3 const specificSubcommand = Subcommand.get(10, 3); console.log(specificSubcommand.commandId); // 10 console.log(specificSubcommand.subcommandIndex); // 3 ``` -------------------------------- ### Initialize Jabra API without Auto-Discovery (JavaScript) Source: https://sdk.jabra.com/javascript/docs/jabra-js/4.4.1/index Creates an API instance for the Jabra SDK without automatically starting device discovery. This allows for setting up subscriptions before discovery begins. Device discovery is initiated manually by calling the `start()` method on the API instance. ```javascript import { createApi } from "@gnaudio/jabra-js"; async function initializeApi() { const api = await createApi(); // Setup subscriptions here await api.start(); console.log("Jabra API initialized and discovery started."); } initializeApi(); ``` -------------------------------- ### Starting a Call (TypeScript) Source: https://sdk.jabra.com/javascript/docs/jabra-js/4.4.1/interfaces/IEasyCallControlBase Shows how to initiate a call using the `startCall` method. This method sets the device into a call state and returns a Promise. It may throw an error if the device is already in use by another softphone. ```typescript // Assuming 'callControl' is an instance of IEasyCallControlBase callControl.startCall() .then(() => { console.log('Call started successfully.'); }) .catch((error) => { console.error('Failed to start call:', error); }); ``` -------------------------------- ### Starting an Outgoing Call - TypeScript Source: https://sdk.jabra.com/javascript/docs/jabra-js/4.4.1/interfaces/IMultiCallControl Illustrates how to initiate an outgoing call using the `startCall` method. This action sets the device into a call state. ```typescript // Example of starting an outgoing call multiCallControl.startCall().catch(error => { console.error('Failed to start call:', error); }); ``` -------------------------------- ### tryGetChannel Method Example (TypeScript) Source: https://sdk.jabra.com/javascript/docs/jabra-js/4.4.1/interfaces/IConnection Illustrates how to safely attempt to retrieve a communication channel. Unlike getChannel, tryGetChannel returns undefined if the channel does not exist, making it a safer option when the presence of a channel is uncertain. ```typescript // Assuming 'connection' is an instance of IConnection const audioChannel = connection.tryGetChannel('audio'); if (audioChannel) { // Use the audio channel } else { console.log('Audio channel not found.'); } ``` -------------------------------- ### getChromehostVersion Source: https://sdk.jabra.com/javascript/docs/jabra-js/4.4.1/interfaces/IApi Retrieves the version of the Jabra Device Connector (formerly Chromehost). Returns null in Node.js environments or if the connector is not installed in the browser. ```APIDOC ## GET /api/jabra/chromehost-version ### Description Get the version of the Jabra Device Connector, previously known as Chromehost. The Jabra Device Connector is the native console application communicating with the USB-layer. In node context, the Jabra Device Connector will be embedded in the jabra-js stack, and not something to be concerned with as an SDK-user. In browser context, the Jabra Device Connector is a required application that needs to be installed separately from this npm-package - unless the library is configured to use WebHID-transport, see IConfig.transport. ### Method GET ### Endpoint /api/jabra/chromehost-version ### Parameters None ### Request Example None ### Response #### Success Response (200) - **version** (string | null) - The version number or null if not installed. #### Response Example ```json { "version": "4.5.6" } ``` ``` -------------------------------- ### PacketHeader Constructor and Methods Source: https://sdk.jabra.com/javascript/docs/jabra-js/4.4.1/classes/PacketHeader Demonstrates the constructor for PacketHeader and various methods to create and manipulate packet headers, including creating reply, event, read, and write packet headers. It also includes methods to get packet ID, check if empty, and create an empty packet. ```typescript import { Address, PacketType, Subcommand } from "@gnaudio/jabra-js"; // Example usage of constructor and methods const destinationAddress: Address = { ip: "192.168.1.1", port: 1234 }; const sourceAddress: Address = { ip: "192.168.1.2", port: 5678 }; const packetId = 1; const packetType: PacketType = 1; const subcommand: Subcommand = 1; const dataLength = 10; // Constructor const header = new PacketHeader(destinationAddress, sourceAddress, packetId, packetType, subcommand, dataLength); // Methods const replyHeader = PacketHeader.createReplyHeader(dataLength); const packetIdValue = header.getPacketId(); const isEmpty = header.isEmpty(); const eventHeader = PacketHeader.createEventPacketHeader(subcommand, destinationAddress, dataLength); const readHeader = PacketHeader.createReadPacketHeader(subcommand, destinationAddress, dataLength); const writeHeader = PacketHeader.createWritePacketHeader(subcommand, destinationAddress, dataLength); const emptyPacketHeader = PacketHeader.emptyPacket(destinationAddress, sourceAddress, packetId, packetType, subcommand); ``` -------------------------------- ### getChromeExtensionVersion Source: https://sdk.jabra.com/javascript/docs/jabra-js/4.4.1/interfaces/IApi Retrieves the version of the Jabra Chrome Extension. Returns null in Node.js environments or if the extension is not installed in the browser. ```APIDOC ## GET /api/jabra/chrome-extension-version ### Description Get the Jabra Chrome Extension version. In node context, the Chrome Extension is unnecessary and will always return null. In browser context, the Chrome Extension is a required component that needs to be installed separately from this npm-package - unless the library is configured to use WebHID-transport, see IConfig.transport. ### Method GET ### Endpoint /api/jabra/chrome-extension-version ### Parameters None ### Request Example None ### Response #### Success Response (200) - **version** (string | null) - The version number or null if not installed. #### Response Example ```json { "version": "1.2.3" } ``` ``` -------------------------------- ### getCurrentDevices Source: https://sdk.jabra.com/javascript/docs/jabra-js/4.4.1/interfaces/IApi Gets a collection of all currently connected Jabra devices. ```APIDOC ## GET /api/jabra/devices/current ### Description Get a collection of the currently available Jabra devices. ### Method GET ### Endpoint /api/jabra/devices/current ### Parameters None ### Request Example None ### Response #### Success Response (200) - **devices** (IDevice[]) - An array of currently connected Jabra devices. #### Response Example ```json [ { "deviceId": "Jabra Evolve 30 II", "deviceName": "Jabra Evolve 30 II", "deviceState": "connected" } ] ``` ``` -------------------------------- ### getChannel Method Example (TypeScript) Source: https://sdk.jabra.com/javascript/docs/jabra-js/4.4.1/interfaces/IConnection Demonstrates how to retrieve a specific communication channel from an IConnection object. This method is useful when you need to interact with a particular type of channel, such as an audio or HID channel. An error is thrown if the channel does not exist. ```typescript // Assuming 'connection' is an instance of IConnection const hidChannel = connection.getChannel('hid'); // Now you can use hidChannel to communicate with the device ``` -------------------------------- ### hasChannel Method Example (TypeScript) Source: https://sdk.jabra.com/javascript/docs/jabra-js/4.4.1/interfaces/IConnection Shows how to check if a specific communication channel type is available within an IConnection. This is useful for ensuring that a required channel exists before attempting to retrieve it, preventing potential errors. ```typescript // Assuming 'connection' is an instance of IConnection if (connection.hasChannel('audio')) { console.log('Audio channel is available.'); } ``` -------------------------------- ### File Management Commands in JavaScript Source: https://sdk.jabra.com/javascript/docs/jabra-js/4.4.1/classes/Subcommand Enables file operations on the device, including deleting files, accessing diagnostic information, retrieving directory listings, getting file sizes, and reading from or writing to files. These are essential for data management and logging. ```javascript const fileCommands = { delete: 'Subcommand', diagnostic: 'Subcommand', getDetailedDir: 'Subcommand', getDir: 'Subcommand', getSize: 'Subcommand', read: 'Subcommand', write: 'Subcommand' }; ``` -------------------------------- ### Get Jabra SDK Version Source: https://sdk.jabra.com/javascript/docs/jabra-js/4.4.1/interfaces/IApi Retrieves the version of the Jabra SDK. This is a synchronous operation and returns a string representing the SDK version. ```javascript import { Jabra } from "@gnaudio/jabra-js"; function getSDKVersion() { const version = Jabra.version; console.log(`Jabra SDK Version: ${version}`); return version; } ``` -------------------------------- ### Start Call with ISingleCallControl Source: https://sdk.jabra.com/javascript/docs/jabra-js/4.4.1/interfaces/ISingleCallControl Implements the startCall method for the ISingleCallControl interface. This function initiates a new call and sets the Jabra device into a call state. It returns a Promise that resolves upon successful call initiation and throws an error if the device is already in use by another softphone. ```typescript startCall(): Promise ``` -------------------------------- ### Command Class Documentation Source: https://sdk.jabra.com/javascript/docs/jabra-js/4.4.1/classes/Command Details about the Command class, including its constructor, methods, and properties. ```APIDOC ## Class Command Represents a GNP command. ### Methods #### equals Compares this Command object with another Command object for equality. - **Method**: Instance Method - **Parameters**: - `other` (Command) - The other Command object to compare with. - **Returns**: boolean - True if the commands are equal, false otherwise. #### get Retrieves a Command object by its ID. - **Method**: Static Method - **Parameters**: - `id` (number) - The unique identifier of the command. - **Returns**: Command - The Command object associated with the given ID. ### Properties All properties are read-only unless otherwise specified. - **id** (number): The unique identifier of the command. - **name** (string): The name of the command. - **ack** (Command): Static property representing the acknowledgment command. - **config** (Command): Static property representing the configuration command. - **device** (Command): Static property representing the device command. - **dfu** (Command): Static property representing the device firmware update command. - **echo** (Command): Static property representing the echo command. - **file** (Command): Static property representing the file command. - **fwu** (Command): Static property representing the firmware update command. - **hsu** (Command): Static property representing the headset update command. - **ident** (Command): Static property representing the identification command. - **log** (Command): Static property representing the log command. - **mmi** (Command): Static property representing the multimedia interface command. - **msteams** (Command): Static property representing the Microsoft Teams command. - **nack** (Command): Static property representing the negative acknowledgment command. - **remoteMmi** (Command): Static property representing the remote multimedia interface command. - **status** (Command): Static property representing the status command. - **video** (Command): Static property representing the video command. ``` -------------------------------- ### StringData Class Documentation Source: https://sdk.jabra.com/javascript/docs/jabra-js/4.4.1/classes/StringData Detailed documentation for the StringData class, including its hierarchy, constructors, methods, and properties. ```APIDOC ## Class StringData String GNP packet payload #### Hierarchy (View Summary) * PacketData * StringData ##### Index ### Constructors constructor ### Methods deserialize get getBytes length parse serialize toString from parseString ### Properties value empty maxSize ## Constructors ### constructor * new StringData(value: string, options?: StringOptions): StringData #### Parameters * value: string * options: StringOptions = StringOptions.default #### Returns StringData ## Methods ### deserialize * deserialize(deserializer: (data: PacketData) => T): T #### Type Parameters * T #### Parameters * deserializer: (data: PacketData) => T #### Returns T ### get * get(i: number): number #### Parameters * i: number #### Returns number ### getBytes * getBytes(): Uint8Array #### Returns Uint8Array ### length * length(): number #### Returns number ### parse * parse(deserializer: (data: Uint8Array) => T): T #### Type Parameters * T #### Parameters * deserializer: (data: Uint8Array) => T #### Returns T ### `Protected`serialize * serialize(): Uint8Array #### Returns Uint8Array ### toString * toString(): string #### Returns string ### `Static`from * from(data: PacketData, options?: StringOptions): StringData #### Parameters * data: PacketData * options: StringOptions = StringOptions.default #### Returns StringData ### `Static`parseString * parseString(data: PacketData, options?: StringOptions): string #### Parameters * data: PacketData * options: StringOptions = StringOptions.default #### Returns string ## Properties ### `Readonly`value value: string ### `Static` `Readonly`empty empty: PacketData = ... ### `Static` `Readonly`maxSize maxSize: 57 Max GNP packet data in bytes ``` -------------------------------- ### Methods Source: https://sdk.jabra.com/javascript/docs/jabra-js/4.4.1/interfaces/ICallControl Detailed documentation for each method available in the ICallControl interface. ```APIDOC ## Methods ### hold * hold(shouldHold: boolean): void Tells the device whether an active call was put on hold or a held up call was resumed. #### Parameters * shouldHold: boolean `true` when a call gets put on hold, `false` when it is resumed. #### Returns void #### Throws If a call lock was not acquired prior to execution. See ICallControl.takeCallLock for more details. ### mute * mute(shouldMute: boolean): void Mutes or unmutes the microphone of the Jabra device. #### Parameters * shouldMute: boolean `true` to mute the device, `false` to unmute it. #### Returns void #### Remarks Should only be used during a call. #### Throws If a call lock was not acquired prior to execution. See ICallControl.takeCallLock for more details. ### offHook * offHook(isOffHook: boolean): void Informs the Jabra device that there's a change in the call status. #### Parameters * isOffHook: boolean The new offHook status of the device. Use `true` when a call becomes active, regardless of call type (outgoing or incoming). Use `false` when a call has ended and the device is no longer used. #### Returns void #### Remarks This controls if the device considers itself in an active call. When offHook is true, a call is ongoing, otherwise there is no active call. #### Throws If a call lock was not acquired prior to execution. See ICallControl.takeCallLock for more details. ### releaseCallLock * releaseCallLock(): void Releases a previously acquired call lock. Releasing the call lock is the last step in performing call control operations so remember to execute it once you are done with the Jabra device. #### Returns void #### Throws If there is no active call lock imposed on the device by your softphone. ### ring * ring(shouldRing: boolean): void Starts or ends the "ring" effect on the Jabra device. Used to indicate an incoming call. #### Parameters * shouldRing: boolean `true` to start the "ring" effect, `false` to stop it. #### Returns void #### Throws If a call lock was not acquired prior to execution. See ICallControl.takeCallLock for more details. ### takeCallLock * takeCallLock(): Promise Tries to acquire a call lock. The call lock is a unique, per-device lock, and is required to change the device state. Acquiring a call lock must be the first step in performing call control operations. #### Returns Promise A Promise that resolves with `true` if the call lock is successfully acquired, `false` otherwise. #### Remarks Acquiring a call lock can fail. This can happen for the following reasons: * The device is call locked by another softphone using the Jabra SDK, resulting in `false` being returned. * The device is call locked by another instance of your softphone implementation. This results in `false` being returned. * You've already call locked the device (and therefore can proceed with any other functionality that requires the call lock). This results in an Exception being thrown #### Throws If you have already call locked the device. ``` -------------------------------- ### Get Current Jabra Devices Source: https://sdk.jabra.com/javascript/docs/jabra-js/4.4.1/interfaces/IApi Retrieves a list of currently connected Jabra devices. This method returns an array of IDevice objects. ```javascript import { Jabra } from "@gnaudio/jabra-js"; function getCurrentDevices() { try { const api = Jabra.instance(); // Assumes Jabra.init() has been called previously const devices = api.getCurrentDevices(); console.log("Currently connected devices:", devices); return devices; } catch (error) { console.error("Error getting current devices:", error); return []; } } ``` -------------------------------- ### Packet Class Constructor and Methods Source: https://sdk.jabra.com/javascript/docs/jabra-js/4.4.1/classes/Packet Demonstrates the instantiation of the Packet class and the usage of its core methods for packet manipulation. This includes creating reply packets, ensuring packet IDs, retrieving packet bytes, and accessing packet metadata. ```javascript import { Packet, PacketHeader, PacketData } from "@gnaudio/jabra-js"; // Example of creating a new Packet instance const header: PacketHeader = { /* ... your header object ... */ }; const data: PacketData = PacketData.empty; const packet = new Packet(header, data); // Example of creating a reply packet const replyPacket = Packet.createReply(data); // Example of ensuring packet ID packet.ensurePacketId(); // Example of getting packet bytes const packetBytes: Uint8Array = packet.getBytes(); // Example of getting header size const headerSize: number = packet.headerSize(); // Example of getting packet ID const packetId: number = packet.packetId(); // Example of converting packet to string const packetString: string = packet.toString(); ``` -------------------------------- ### Ring Effect Control (TypeScript) Source: https://sdk.jabra.com/javascript/docs/jabra-js/4.4.1/interfaces/ICallControl Starts or stops the ring effect on the Jabra device, typically used to signal an incoming call. This functionality requires an acquired call lock. ```typescript /** * Starts or ends the "ring" effect on the Jabra device. Used to indicate an incoming call. * @param shouldRing `true` to start the "ring" effect, `false` to stop it. */ ring(shouldRing: boolean): void; ``` -------------------------------- ### createCallControl Source: https://sdk.jabra.com/javascript/docs/jabra-js/4.4.1/classes/CallControlFactory Creates an ICallControl instance for a given device, enabling call control functionality. ```APIDOC ## createCallControl(device: IDevice): Promise ### Description Creates an ICallControl instance for a given device, enabling call control functionality. ### Method POST ### Endpoint /callcontrol ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **device** (IDevice) - Required - The device you wish to execute call control functionality on. ### Request Example ```json { "device": { "deviceId": "some-device-id", "deviceName": "Jabra Evolve 20" } } ``` ### Response #### Success Response (200) - **ICallControl** (object) - An object representing the call control interface for the device. #### Response Example ```json { "callControl": "ICallControl instance" } ``` ``` -------------------------------- ### Muting and Unmuting Microphone - TypeScript Source: https://sdk.jabra.com/javascript/docs/jabra-js/4.4.1/interfaces/IMultiCallControl Provides examples for muting and unmuting the device's microphone using the `mute` and `unmute` methods. Note the overloaded `mute` method with different return types. ```typescript // Example of muting the device (returns Promise) multiCallControl.mute().catch(error => { console.error('Failed to mute device:', error); }); // Example of unmute the device multiCallControl.unmute(); ``` -------------------------------- ### Get Chrome Extension Version Source: https://sdk.jabra.com/javascript/docs/jabra-js/4.4.1/interfaces/IApi Retrieves the version of the Jabra Chrome Extension. Returns a Promise resolving to the version string or null. In Node.js environments, it always returns null as the extension is not applicable. ```javascript import { Jabra } from "@gnaudio/jabra-js"; async function getChromeExtensionVersion() { try { const api = await Jabra.init(); const version = await api.getChromeExtensionVersion(); if (version) { console.log(`Jabra Chrome Extension Version: ${version}`); } else { console.log("Jabra Chrome Extension is not installed or not applicable in this context."); } return version; } catch (error) { console.error("Error getting Chrome Extension version:", error); return null; } } ``` -------------------------------- ### Static Packet Creation Methods Source: https://sdk.jabra.com/javascript/docs/jabra-js/4.4.1/classes/Packet Illustrates the static methods available on the Packet class for creating different types of GN Protocol packets. These methods simplify the process of generating event, read, and write packets with specified parameters. ```javascript import { Packet, Subcommand, Address, PacketData } from "@gnaudio/jabra-js"; const subcommand: Subcommand = { /* ... your subcommand object ... */ }; const destination: Address = { /* ... your address object ... */ }; const data: PacketData = PacketData.empty; // Example of creating an event packet const eventPacket = Packet.createEventPacket(subcommand, destination, data); // Example of creating a read packet const readPacket = Packet.createReadPacket(subcommand, destination, data); // Example of creating a write packet const writePacket = Packet.createWritePacket(subcommand, destination, data); ``` -------------------------------- ### Get Jabra Device Connector Version Source: https://sdk.jabra.com/javascript/docs/jabra-js/4.4.1/interfaces/IApi Retrieves the version of the Jabra Device Connector (formerly Chromehost). Returns a Promise resolving to the version string or null. In Node.js, this is embedded and not directly queryable by the user. ```javascript import { Jabra } from "@gnaudio/jabra-js"; async function getDeviceConnectorVersion() { try { const api = await Jabra.init(); const version = await api.getChromehostVersion(); if (version) { console.log(`Jabra Device Connector Version: ${version}`); } else { console.log("Jabra Device Connector is not installed or not applicable in this context."); } return version; } catch (error) { console.error("Error getting Jabra Device Connector version:", error); return null; } } ``` -------------------------------- ### Device Commands in JavaScript Source: https://sdk.jabra.com/javascript/docs/jabra-js/4.4.1/classes/Subcommand Provides a comprehensive list of subcommands for interacting with Jabra devices. These commands cover device events, pairing, audio streaming, configuration, and status updates. No external dependencies are required beyond the Jabra SDK. ```javascript const deviceCommands = { attachEvent: 'Subcommand', attachReq: 'Subcommand', audioStreamStart: 'Subcommand', audioStreamStop: 'Subcommand', autoAudioDetection: 'Subcommand', cancelPairing: 'Subcommand', cancelPlayTone: 'Subcommand', cancelSealingTest: 'Subcommand', cancelUserAcceptance: 'Subcommand', certificateMakeRequest: 'Subcommand', chargePause: 'Subcommand', checkDockedHeadset: 'Subcommand', clearPairing: 'Subcommand', connectAddr: 'Subcommand', connectReq: 'Subcommand', dbRecordChanged: 'Subcommand', deleteDbRecord: 'Subcommand', detachEvent: 'Subcommand', disconnectAddr: 'Subcommand', disconnected: 'Subcommand', disconnectReq: 'Subcommand', endConfigMode: 'Subcommand', endFuotaMode: 'Subcommand', events: 'Subcommand', factoryDefault: 'Subcommand', factoryDefaultNoBoot: 'Subcommand', featureMask: 'Subcommand', freeSpace: 'Subcommand', gattData: 'Subcommand', gattDiscoverCharDescResult: 'Subcommand', gattDiscoverCharResult: 'Subcommand', gattDiscoverPrimaryResult: 'Subcommand', gattReadCharResult: 'Subcommand', gattWriteCharResult: 'Subcommand', getActualProfile: 'Subcommand', getConfigModePermission: 'Subcommand', getDbName: 'Subcommand', getDbRecord: 'Subcommand', getEchoSuppressor: 'Subcommand', getFuotaModePermission: 'Subcommand', getPairingStatus: 'Subcommand', getProfileSupport: 'Subcommand', getSidetoneCapability: 'Subcommand', getSoftButton: 'Subcommand', getSoftButtonFunctions: 'Subcommand', getWbs: 'Subcommand', networkIp4Parameters: 'Subcommand', nfcTouched: 'Subcommand', pairAddr: 'Subcommand', pairSecure: 'Subcommand', pairSecureKey: 'Subcommand', performSealingTest: 'Subcommand', playFeedbackTone: 'Subcommand', playRingtone: 'Subcommand', playTargetRingtone: 'Subcommand', playTone: 'Subcommand', playToneMode: 'Subcommand', playTune: 'Subcommand', prepareRestart: 'Subcommand', queryAddress: 'Subcommand', recordToMemory: 'Subcommand', sealingTestResult: 'Subcommand', searchComplete: 'Subcommand', searchDisable: 'Subcommand', searchEnable: 'Subcommand', searchResult: 'Subcommand', searchResultMeetingRoom: 'Subcommand', searchResultName: 'Subcommand', securityUnlockKey: 'Subcommand', setActualProfile: 'Subcommand', setEchoSuppressor: 'Subcommand', setPairingCommand: 'Subcommand', setSoftButton: 'Subcommand', setWbs: 'Subcommand', sleepModeTrigger: 'Subcommand', startPlayRingtone: 'Subcommand', startPlayRingtoneOrientation: 'Subcommand', status: 'Subcommand', stopPlayRingtone: 'Subcommand', symmetricCommand: 'Subcommand', symmetricInitConfiguration: 'Subcommand', temperature: 'Subcommand', usbEnumerationControl: 'Subcommand', voiceAssistant: 'Subcommand', wlanConnectionInfo: 'Subcommand', wlanScanning: 'Subcommand' }; ``` -------------------------------- ### Include RxJS UMD Dependency for Jabra SDK (HTML) Source: https://sdk.jabra.com/javascript/docs/jabra-js/4.4.1/index Demonstrates how to include the RxJS UMD (Universal Module Definition) bundle when using the Jabra SDK, as newer versions no longer bundle all dependencies. This ensures that RxJS is available for the SDK to use. ```html ``` -------------------------------- ### DFU Commands Source: https://sdk.jabra.com/javascript/docs/jabra-js/4.4.1/classes/Subcommand Commands related to Device Firmware Update (DFU) operations. ```APIDOC ## DFU Commands API ### Description Allows for managing firmware updates on Jabra devices, including initiating updates and managing device partitions. ### Method Various (typically POST) ### Endpoint `/websites/sdk_jabra_javascript_jabra-js_4_4_1/dfu` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body **Example: `firmwareUpdateFromFile`** ```json { "command": "dfu.firmwareUpdateFromFile", "data": { "filePath": "/path/to/firmware.bin", "deviceAddress": "XX:XX:XX:XX:XX:XX" } } ``` **Example: `swapPartition`** ```json { "command": "dfu.swapPartition", "data": { "deviceAddress": "XX:XX:XX:XX:XX:XX" } } ``` ### Request Example ```json { "command": "dfu.activePartition", "data": { "deviceAddress": "XX:XX:XX:XX:XX:XX" } } ``` ### Response #### Success Response (200) ```json { "status": "success", "data": { ... } } ``` **Example: `activePartition` response** ```json { "status": "success", "data": { "partition": "A" } } ``` #### Error Response ```json { "status": "error", "message": "Specific error message" } ``` ``` -------------------------------- ### Subcommand Class Methods - JavaScript Source: https://sdk.jabra.com/javascript/docs/jabra-js/4.4.1/classes/Subcommand Demonstrates the usage of various methods within the Subcommand class, including checking for equality with another subcommand, determining if a subcommand is empty, and converting a subcommand to its string representation. ```javascript import { Subcommand } from "@gnaudio/jabra-js"; // Example usage of equals const subcommand1 = Subcommand.empty(1); const subcommand2 = Subcommand.get(1, 2); console.log(subcommand1.equals(subcommand2)); // false // Example usage of isEmpty console.log(subcommand1.isEmpty()); // true console.log(subcommand2.isEmpty()); // false // Example usage of toString console.log(subcommand2.toString()); // "1-2" ``` -------------------------------- ### connect() Method - ITransport Interface (TypeScript) Source: https://sdk.jabra.com/javascript/docs/jabra-js/4.4.1/interfaces/ITransport Implements the connect() method within the ITransport interface. This method returns a Promise that resolves upon successful connection to the console app or Chrome extension. It throws an error if the connection fails, typically due to missing installations. ```typescript connect(): Promise ``` -------------------------------- ### Various Device Settings in JavaScript Source: https://sdk.jabra.com/javascript/docs/jabra-js/4.4.1/classes/Subcommand A collection of subcommands for configuring various device settings. This includes sidetone levels, mute, call handling, sleep modes, sound modes, spatial sound, speaker configurations, and more. These commands allow fine-grained control over device behavior. ```javascript const variousDeviceSettings = { sidetoneLevel: 'Subcommand', sidetoneMute: 'Subcommand', singleCallConf: 'Subcommand', singleNumberReach: 'Subcommand', sleepModeEnable: 'Subcommand', sleepModeStatus: 'Subcommand', smartRinger: 'Subcommand', softphoneIntegration: 'Subcommand', soundMode: 'Subcommand', soundMode2: 'Subcommand', soundModeLoop: 'Subcommand', spatialSound: 'Subcommand', speaker: 'Subcommand', speakerOutConfig: 'Subcommand', speedNumber: 'Subcommand', speedNumber2: 'Subcommand', spkGain: 'Subcommand', spotifyOneTap: 'Subcommand', stitchMode: 'Subcommand', streamPriority: 'Subcommand', syncPktType: 'Subcommand', systemId: 'Subcommand', terminationSwitch: 'Subcommand', time: 'Subcommand', timeDisplayFormat: 'Subcommand', timezone: 'Subcommand', touchAudioFeedback: 'Subcommand', transitionStyle: 'Subcommand', undockOpenAudioLink: 'Subcommand', usbDeviceType: 'Subcommand', usbHidSettings: 'Subcommand', usbHostWhitelist: 'Subcommand', userButtons: 'Subcommand', userButtonsContexts: 'Subcommand', userButtonsDefault: 'Subcommand', userFactoryDefault: 'Subcommand', vibra: 'Subcommand', videoMode: 'Subcommand', videoOrientation: 'Subcommand', voiceDial: 'Subcommand', voiceIndicator: 'Subcommand', voiceMailNumber: 'Subcommand', voiceTags: 'Subcommand', whiteboardCorners: 'Subcommand', whiteNoiseLevel: 'Subcommand', windAdaptive: 'Subcommand', wizardScope: 'Subcommand', wlanMode: 'Subcommand', wlanPsk: 'Subcommand', wlanSsid: 'Subcommand' }; ``` -------------------------------- ### DFU Commands in JavaScript Source: https://sdk.jabra.com/javascript/docs/jabra-js/4.4.1/classes/Subcommand Manages firmware updates for Jabra devices using the Device Firmware Update (DFU) protocol. This includes functions to update firmware from files, over DFU, or via HID with slave updating, and to manage active partitions. ```javascript const dfuCommands = { activePartition: 'Subcommand', attachedDevices: 'Subcommand', firmwareUpdateFromFile: 'Subcommand', firmwareUpdateOverDfu: 'Subcommand', firmwareUpdateOverHidAndSlaveUpdating: 'Subcommand', swapPartition: 'Subcommand' }; ``` -------------------------------- ### CallControlFactory Constructor Source: https://sdk.jabra.com/javascript/docs/jabra-js/4.4.1/classes/CallControlFactory Initializes a new instance of the CallControlFactory class. This factory is used to create devices with call control functionality. ```APIDOC ## new CallControlFactory(coreApi: IApi): CallControlFactory ### Description Initializes a new instance of the CallControlFactory class. This factory is used to create devices with call control functionality. ### Method Constructor ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "coreApi": "IApi instance" } ``` ### Response #### Success Response (200) - **CallControlFactory** (object) - A new instance of CallControlFactory. #### Response Example ```json { "instance": "CallControlFactory object" } ``` ``` -------------------------------- ### getVersion Source: https://sdk.jabra.com/javascript/docs/jabra-js/4.4.1/interfaces/IApi Retrieves the version of the Jabra SDK. ```APIDOC ## GET /api/jabra/version ### Description Returns the Jabra SDK version. ### Method GET ### Endpoint /api/jabra/version ### Parameters None ### Request Example None ### Response #### Success Response (200) - **version** (string) - The Jabra SDK version string. #### Response Example ```json { "version": "4.4.1" } ``` ``` -------------------------------- ### Signal Incoming Call with ISingleCallControl Source: https://sdk.jabra.com/javascript/docs/jabra-js/4.4.1/interfaces/ISingleCallControl Implements the signalIncomingCall method for the ISingleCallControl interface. This function signals an incoming call, typically by starting the device ringer, and returns a Promise that resolves with a boolean indicating whether the call was accepted or rejected. It can optionally accept a timeout for automatic rejection and throws an error if the device is locked. ```typescript signalIncomingCall(ringTimeout?: number): Promise ``` -------------------------------- ### EasyCallControlFactory Class Source: https://sdk.jabra.com/javascript/docs/jabra-js/4.4.1/classes/EasyCallControlFactory The EasyCallControlFactory class is used to create instances of ISingleCallControl and IMultiCallControl, offering simplified call control functionality. It automates device signal handling and command sequences compared to the regular Call Control module. ```APIDOC ## Class EasyCallControlFactory Enables the creation of ISingleCallControl and IMultiCallControl objects which offer easy call control functionality on a specific connection that belongs on a specific device. Compared to the regular Call Control module, Easy Call Control automates device signal handling and command sequences. A CallControlFactory is initialized by passing in softphone information and the core IApi interface. It can then be used to create ICallControl instances. ### Constructors #### constructor ```typescript new EasyCallControlFactory(coreApi: IApi): EasyCallControlFactory ``` ##### Parameters - **coreApi** (IApi) - The core IApi interface. ##### Returns - EasyCallControlFactory ### Methods #### createMultiCallControl ```typescript createMultiCallControl(device: IDevice, initialState?: IMultiInitialState): Promise ``` Creates a IMultiCallControl instance for a given device, enabling multi-call-control functionality. ##### Parameters - **device** (IDevice) - An SDK device from which the call-control device will be constructed. - **initialState** (IMultiInitialState) - Optional. Sets the initial state of the created object. Use it when handling device changes. ##### Returns - Promise - A Promise which emits a new IMultiCallControl. ##### Remarks This includes APIs for setting a device on hold and handling multiple ongoing calls. If you do not need to handle multiple ongoing calls, we advise you to use the SingleCallControl interface instead - see method `createSingleCallControl`. #### createSingleCallControl ```typescript createSingleCallControl(device: IDevice, initialState?: ISingleInitialState): Promise ``` Creates a device with single-call-control functionality. ##### Parameters - **device** (IDevice) - An SDK device from which the call-control device will be constructed. - **initialState** (ISingleInitialState) - Optional. Sets the initial state of the created object. Use it when handling device changes. ##### Returns - Promise - A Promise which emits a new ISingleCallControl. ##### Remarks This is a simple interface only containing the basic functionality for handling easy call control. If you wish to handle multiple calls and being able to set a call on hold, we advise you to use the MultiCallControl interface instead - see method `createMultiCallControl`. #### supportsEasyCallControl ```typescript supportsEasyCallControl(potentialDevice: IDevice): boolean ``` Verifies whether a device supports easy call control or not. ##### Parameters - **potentialDevice** (IDevice) - The device to check for support. ##### Returns - boolean - `true` if the device has a connection that has support for any call control functionality, `false` otherwise. ``` -------------------------------- ### Device Commands Source: https://sdk.jabra.com/javascript/docs/jabra-js/4.4.1/classes/Subcommand This section details the various commands available for controlling and querying Jabra device functionalities. ```APIDOC ## Device Commands API ### Description Provides a comprehensive set of commands to manage Jabra device features, including audio, connectivity, pairing, and status. ### Method Various (typically POST or GET depending on the subcommand's nature) ### Endpoint `/websites/sdk_jabra_javascript_jabra-js_4_4_1/device` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body Each subcommand will have its own specific request body structure. Below are examples of common subcommands: **Example: `audioStreamStart`** ```json { "command": "device.audioStreamStart", "data": { "streamType": "music" } } ``` **Example: `connectReq`** ```json { "command": "device.connectReq", "data": { "address": "XX:XX:XX:XX:XX:XX" } } ``` **Example: `setPairingCommand`** ```json { "command": "device.setPairingCommand", "data": { "command": "pairSecure", "address": "XX:XX:XX:XX:XX:XX" } } ``` ### Request Example ```json { "command": "device.status", "data": {} } ``` ### Response #### Success Response (200) Responses vary based on the subcommand executed. A general success response might look like: ```json { "status": "success", "data": { ... } } ``` **Example: `status` response** ```json { "status": "success", "data": { "state": "connected", "batteryLevel": 85 } } ``` #### Error Response ```json { "status": "error", "message": "Specific error message" } ``` ``` -------------------------------- ### File Commands Source: https://sdk.jabra.com/javascript/docs/jabra-js/4.4.1/classes/Subcommand Commands for managing files on the Jabra device, including reading, writing, and deleting. ```APIDOC ## File Commands API ### Description Enables interaction with the file system of the Jabra device, allowing for file operations like reading, writing, and deletion. ### Method Various (typically POST) ### Endpoint `/websites/sdk_jabra_javascript_jabra-js_4_4_1/file` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body **Example: `read`** ```json { "command": "file.read", "data": { "filePath": "/logs/system.log" } } ``` **Example: `write`** ```json { "command": "file.write", "data": { "filePath": "/config/settings.json", "content": "{\"volume\": 50}" } } ``` **Example: `delete`** ```json { "command": "file.delete", "data": { "filePath": "/temp/old_data.tmp" } } ``` ### Request Example ```json { "command": "file.getDir", "data": { "directoryPath": "/" } } ``` ### Response #### Success Response (200) ```json { "status": "success", "data": { ... } } ``` **Example: `getDir` response** ```json { "status": "success", "data": { "files": [ "file1.txt", "subdir/" ] } } ``` **Example: `read` response** ```json { "status": "success", "data": { "content": "Log entry 1\nLog entry 2" } } ``` #### Error Response ```json { "status": "error", "message": "Specific error message" } ``` ```