You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

utils.ts 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /**
  2. * Telephony usage actions based on HID Usage tables for Universal Serial Bus (page 112.).
  3. *
  4. */
  5. export const TELEPHONY_DEVICE_USAGE_PAGE = 11;
  6. /** Telephony usages
  7. * - used to parse HIDDevice UsageId collections
  8. ** - outputReports has mute and offHook
  9. ** - inputReports exists hookSwitch and phoneMute.
  10. **/
  11. export const DEVICE_USAGE = {
  12. /* outputReports. */
  13. mute: {
  14. usageId: 0x080009,
  15. usageName: 'Mute'
  16. },
  17. offHook: {
  18. usageId: 0x080017,
  19. usageName: 'Off Hook'
  20. },
  21. ring: {
  22. usageId: 0x080018,
  23. usageName: 'Ring'
  24. },
  25. hold: {
  26. usageId: 0x080020,
  27. usageName: 'Hold'
  28. },
  29. /* inputReports. */
  30. hookSwitch: {
  31. usageId: 0x0b0020,
  32. usageName: 'Hook Switch'
  33. },
  34. phoneMute: {
  35. usageId: 0x0b002f,
  36. usageName: 'Phone Mute'
  37. }
  38. };
  39. /**
  40. * Filter with telephony devices based on HID Usage tables for Universal Serial Bus (page 17).
  41. *
  42. * @type {{ filters: { usagePage: string }; exclusionFilters: {}; }}
  43. */
  44. export const requestTelephonyHID = {
  45. filters: [ {
  46. usagePage: TELEPHONY_DEVICE_USAGE_PAGE
  47. } ],
  48. exclusionFilters: []
  49. };