Forum Index » macOS Development » Communicating with Jabra device using node-hid in javascript   XML
 
Author Message
brenthompson



Joined: 24/07/2018 10:22:12
Messages: 3
Offline

Hi,

I've been pulling my hair out trying to get 'node-hid' (https://github.com/node-hid/node-hid) to communicate with a 9450 headset.

I can open the device and get back a handle. When I initiate events (say a hook flash) on the device I get back UInt8Array data with contents like [4, 4, 0], [4, 5 0]. I cannot figure out how to map that to the telephony page events, i.e. 0x20.

I'm attempting to start the device ringing by

const ringerOn = [ 0x0B, 0x09, 0x01]; // Telephony page, usage = ringer, 1 = ringer on

const numOnBytes = deviceHandle.write(ringerOn);
console.log(wrote ${ringerOn}, ringer on bytes: ${numOnBytes}`)

but nothing happens.

What's missing??
JabraJohn1



Joined: 23/04/2018 04:54:57
Messages: 50
Offline

hi, apologies for the delay - holiday period here at Jabra. whilst we track down a support engineer it's probably a good idea to look at the Jabra HID spec document which can be found at : https://developer.jabra.com/site/global/sdks/web/index.gsp - it might help. we'll get back to you asap. thanks for your patience.

JabraJohn1



Joined: 23/04/2018 04:54:57
Messages: 50
Offline

we also have a newer device that we are eventually moving the pro 94xx family to. Its called Jabra Engage. The node.js SDK to support this newer device will be released in Q3.
JabraJohn1



Joined: 23/04/2018 04:54:57
Messages: 50
Offline

Some tips from our developers:

If using GN HID
1. Open device handle with path whose usage=65280(0xFF00) using new HID.HID(path)
2. write to device using open handled using device.write( [0x04, 0x04, 0x00] ). Note, first byte should be report id, it could change per device.

If using standard HID
1. Open device handle with path whose usage=11(0x0B) using new HID.HID(path)
2. write to device using open handled using device.write( [0x02, 0x04, 0x00] ). Note, first byte should be report id, it could change per device.

Users should be advised to use npm package 'jabra' for such task. This is wrapper for our c/c++ sdk and provide all call control feature in released version. https://www.npmjs.com/package/jabra
brenthompson



Joined: 24/07/2018 10:22:12
Messages: 3
Offline

Thanks, however I still don't think that's quite enough info for me to proceed.

I have no issue connecting / opening the device and getting a handle back.

Regarding your sample command:

"If using standard HID ... 2. write to device using open handled using device.write( [0x02, 0x04, 0x00] ). Note, first byte should be report id, it could change per device."

a few questions:

1- the first byte - 0x02 - should be the report id, it could change per device.

OK, so how do I know what value of report id I should be using for a given device?

2- what do 0x04 and 0x00 represent in this case

3- what does this command do, and how do I map it to https://developer.jabra.com/site/global/sdks/web/documentation/index.gsp

To ask another way, what data would I send in to device.write([]) to cause the 9540 phone to start ringing, and then stop?
What command would I issue to cause the device to go on/off mute?

When the device sends me a uint8array containing 4, 2, 0, how do I decode that using the information on this page: https://developer.jabra.com/site/global/sdks/web/documentation/index.gsp

Thanks,

 
 
Go to: