| Tipro API Communicate with Tipro devices

Typedefs | Functions
TiproTelephony.h File Reference

Go to the source code of this file.

## Typedefs
typedef unsigned short | USHORT
typedef void * | PVOID
typedef unsigned long | ULONG
typedef int(* | tfnCallback) (USHORT, USHORT, USHORT, USHORT, bool)
typedef int(* | tfnThreadStatus) (USHORT, int, int, int)

## Functions
int | TiproTelephony_DetectDevices ()
| Scans all USB ports and updates the list of connected telephony devices. This function should be called before using other telephony commands or when new device is connected to the system. More...
int | TiproTelephony_GetNumOfDetectedDevices ()
| Returns number of connected telephony devices. More...
int | TiproTelephony_RegisterCallback (USHORT hidIx, tfnCallback fnKeyCallback, tfnThreadStatus fnKeyStatusCallback)
| Register callback function for returning pressed/released keys and status of the thread. More...
int | TiproTelephony_Stop (const USHORT nLocalIx)
| Stops reporting keys of telephony device. More...
int | TiproTelephony_StopAll ()
| Stops reporting keys of all telephony devices. More...
int | TiproTelephony_GetDevicePath (USHORT hidIx, PVOID pString, ULONG lBufferLen)
| Returns telephony device path that can be used to access the device directly. More...
int | TiproTelephony_GetDeviceProductString (USHORT hidIx, PVOID pString, ULONG lBufferLen)
| Returns telephony device product string. More...
int | TiproTelephony_GetDeviceVidPid (USHORT hidIx, USHORT *nVID, USHORT *nPID)
| Returns telephony device vendor ID and product ID. More...
int | TiproTelephony_GetDeviceManufacturerString (USHORT hidIx, PVOID pString, ULONG lBufferLen)
| Returns telephony device manufacturer string. More...

## Detailed Description

TiproTelephony

This file includes functions for communication with Tipro HID telephony devices.

You can recive HID telephony events - key presses and releases - by defining a callback function.

Tipro

suppo.nosp@m.rt@t.nosp@m.ipro..nosp@m.si

Copyright 2021

## Function Documentation

## ◆ TiproTelephony_DetectDevices()

int TiproTelephony_DetectDevices | ( |  | ) |

Scans all USB ports and updates the list of connected telephony devices. This function should be called before using other telephony commands or when new device is connected to the system.

Returns
  Command status: 0-OK, else error code

## ◆ TiproTelephony_GetDeviceManufacturerString()

int TiproTelephony_GetDeviceManufacturerString | ( | USHORT | hidIx,
|  | PVOID | pString,
|  | ULONG | lBufferLen
| ) |  |

Returns telephony device manufacturer string.

Parameters

  [in] | hidIx | Telephony device index
  [out] | pString | Pointer to user defined buffer (wchar_t *) where the string will be returned to
  [in] | lBufferLen | Length of a supplied buffer

Returns
  Command status: 0-OK, else error code

## ◆ TiproTelephony_GetDevicePath()

int TiproTelephony_GetDevicePath | ( | USHORT | hidIx,
|  | PVOID | pString,
|  | ULONG | lBufferLen
| ) |  |

Returns telephony device path that can be used to access the device directly.

Parameters

  [in] | hidIx | Telephony device index
  [out] | pString | Pointer to user defined buffer (char *) where the path will be returned to
  [in] | lBufferLen | Length of a supplied buffer

Returns
  Command status: 0-OK, else error code

## ◆ TiproTelephony_GetDeviceProductString()

int TiproTelephony_GetDeviceProductString | ( | USHORT | hidIx,
|  | PVOID | pString,
|  | ULONG | lBufferLen
| ) |  |

Returns telephony device product string.

Parameters

  [in] | hidIx | Telephony device index
  [out] | pString | Pointer to user defined buffer (wchar_t *) where the string will be returned to
  [in] | lBufferLen | Length of a supplied buffer

Returns
  Command status: 0-OK, else error code

## ◆ TiproTelephony_GetDeviceVidPid()

int TiproTelephony_GetDeviceVidPid | ( | USHORT | hidIx,
|  | USHORT * | nVID,
|  | USHORT * | nPID
| ) |  |

Returns telephony device vendor ID and product ID.

Parameters

  [in] | hidIx | Telephony device index
  [out] | nVID | Vendor ID number
  [out] | nPID | Product ID number

Returns
  Command status: 0-OK, else error code

## ◆ TiproTelephony_GetNumOfDetectedDevices()

int TiproTelephony_GetNumOfDetectedDevices | ( |  | ) |

Returns number of connected telephony devices.

Returns
  Command status: 0-OK, else error code

## ◆ TiproTelephony_RegisterCallback()

int TiproTelephony_RegisterCallback | ( | USHORT | hidIx,
|  | tfnCallback | fnKeyCallback,
|  | tfnThreadStatus | fnKeyStatusCallback
| ) |  |

Register callback function for returning pressed/released keys and status of the thread.

Parameters

  hidIx | Telephony device index
  fnKeyCallback | Key callback function fnCallback(USHORT nID, USHORT nUsagePage, USHORT nLinkUsage, USHORT nUsage, bool bPressed); Parameters: nID; // ID of the telephony device (supporting more then one telephony devices on the same PC) nUsagePage; // top collection usage page (for now always 0x0b = Telephony) nLinkUsage; // usage of the specific link collection (0x01 = Phone, 0x06 = Key Pad, 0x07 = Progrmable Button) nUsage; // usage at the specific collection bPressed; // key pressed = TRUE or released = FALSE
  fnKeyStatusCallback | Status callback function fnKeyStatusCallback(USHORT nID, int nStatus, int nErrCode, int nRFUParam) Parameters: nID; // ID of the telephony device (supporting more then one telephony devices on the same PC) nStatus; // Status of the thread ( to be defined later... for instance 0x00 = Stopped, 0x01 = Running ... ) nErrCode; // ErrCode for reported status ( to be defined later ) nRFUParam; // Reserved for future use ( to be defined later ) fnKeyStatusCallback can be NULL if not needed

Returns
  Command status: 0-OK, else error code

## ◆ TiproTelephony_Stop()

int TiproTelephony_Stop | ( | const USHORT | nLocalIx | ) |

Stops reporting keys of telephony device.

Parameters

  [in] | hidIx | Telephony device index

Returns
  Command status: 0-OK, else error code

## ◆ TiproTelephony_StopAll()

int TiproTelephony_StopAll | ( |  | ) |

Stops reporting keys of all telephony devices.

Returns
  Command status: 0-OK, else error code