All URIs are relative to https://www.handyfeeling.com/api/handy/v2
Method | HTTP request | Description |
---|---|---|
get_device_time | GET /hstp/time | Get the current time of the device. |
get_offset | GET /hstp/offset | Get the HSTP offset of the device. |
get_round_trip_delay | GET /hstp/rtd | Get the round-trip-delay-time (rtd) between the device and the server. |
set_offset | PUT /hstp/offset | Set the HSTP offset of the device. |
sync | GET /hstp/sync | Syncronize the connected device with the server clock. |
get_device_time(x_connection_key)
Get the current time of the device.
Get the current time of the device. When the device and the server time is synchronized, this will be the server time estimated by the device.
require 'time'
require 'handy_api'
api_instance = HandyAPI::HSTPApi.new
x_connection_key = 'x_connection_key_example' # String | Device connection key.
begin
# Get the current time of the device.
result = api_instance.get_device_time(x_connection_key)
p result
rescue HandyAPI::ApiError => e
puts "Error when calling HSTPApi->get_device_time: #{e}"
end
This returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> get_device_time_with_http_info(x_connection_key)
begin
# Get the current time of the device.
data, status_code, headers = api_instance.get_device_time_with_http_info(x_connection_key)
p status_code # => 2xx
p headers # => { ... }
p data # => <GetDeviceTime200Response>
rescue HandyAPI::ApiError => e
puts "Error when calling HSTPApi->get_device_time_with_http_info: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
x_connection_key | String | Device connection key. |
No authorization required
- Content-Type: Not defined
- Accept: application/json
get_offset(x_connection_key)
Get the HSTP offset of the device.
The purpose of the offset value is to provide a way to manually adjust the device/server clock synchronization.
One usecase is when playing scripts (see HSSP). Eg. if the script and video is not in perfect sync, a user could adjust the offset value to compensate.
Example:
If we assume that the current offset value of the device is 0, and the script is 100ms ahead of the video, setting the offset to -100ms could fix the synchronization issue.
If the script is 100ms behind the video, setting the offset to 100ms could do the same.
In most cases, the device/server clock synchronization is good enough. In some special cases a manual adjustment might be required to get perfect sync.
require 'time'
require 'handy_api'
api_instance = HandyAPI::HSTPApi.new
x_connection_key = 'x_connection_key_example' # String | Device connection key.
begin
# Get the HSTP offset of the device.
result = api_instance.get_offset(x_connection_key)
p result
rescue HandyAPI::ApiError => e
puts "Error when calling HSTPApi->get_offset: #{e}"
end
This returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> get_offset_with_http_info(x_connection_key)
begin
# Get the HSTP offset of the device.
data, status_code, headers = api_instance.get_offset_with_http_info(x_connection_key)
p status_code # => 2xx
p headers # => { ... }
p data # => <GetOffset200Response>
rescue HandyAPI::ApiError => e
puts "Error when calling HSTPApi->get_offset_with_http_info: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
x_connection_key | String | Device connection key. |
No authorization required
- Content-Type: Not defined
- Accept: application/json
get_round_trip_delay(x_connection_key)
Get the round-trip-delay-time (rtd) between the device and the server.
Get the round-trip-delay-time (rtd) between the device and the server. The rtd is calculated when the synchronization of the server and device time is triggered. See hstp/sync for more information.
require 'time'
require 'handy_api'
api_instance = HandyAPI::HSTPApi.new
x_connection_key = 'x_connection_key_example' # String | Device connection key.
begin
# Get the round-trip-delay-time (rtd) between the device and the server.
result = api_instance.get_round_trip_delay(x_connection_key)
p result
rescue HandyAPI::ApiError => e
puts "Error when calling HSTPApi->get_round_trip_delay: #{e}"
end
This returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> get_round_trip_delay_with_http_info(x_connection_key)
begin
# Get the round-trip-delay-time (rtd) between the device and the server.
data, status_code, headers = api_instance.get_round_trip_delay_with_http_info(x_connection_key)
p status_code # => 2xx
p headers # => { ... }
p data # => <GetRoundTripDelay200Response>
rescue HandyAPI::ApiError => e
puts "Error when calling HSTPApi->get_round_trip_delay_with_http_info: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
x_connection_key | String | Device connection key. |
No authorization required
- Content-Type: Not defined
- Accept: application/json
set_offset(x_connection_key, offset_update)
Set the HSTP offset of the device.
The purpose of the offset value is to provide a way to manually adjust the device/server clock synchronization.
One usecase is when playing scripts (see HSSP). Eg. if the script and video is not in perfect sync, a user could adjust the offset value to compensate.
Example:
If we assume that the current offset value of the device is 0, and the script is 100ms ahead of the video, setting the offset to -100ms could fix the synchronization issue.
If the script is 100ms behind the video, setting the offset to 100ms could do the same.
In most cases, the device/server clock synchronization is good enough, but in some special cases a manual adjustment might be required to achieve perfect synchronization.
require 'time'
require 'handy_api'
api_instance = HandyAPI::HSTPApi.new
x_connection_key = 'x_connection_key_example' # String | Device connection key.
offset_update = HandyAPI::OffsetUpdate.new # OffsetUpdate |
begin
# Set the HSTP offset of the device.
result = api_instance.set_offset(x_connection_key, offset_update)
p result
rescue HandyAPI::ApiError => e
puts "Error when calling HSTPApi->set_offset: #{e}"
end
This returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> set_offset_with_http_info(x_connection_key, offset_update)
begin
# Set the HSTP offset of the device.
data, status_code, headers = api_instance.set_offset_with_http_info(x_connection_key, offset_update)
p status_code # => 2xx
p headers # => { ... }
p data # => <SetHAMPVelocityPercent200Response>
rescue HandyAPI::ApiError => e
puts "Error when calling HSTPApi->set_offset_with_http_info: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
x_connection_key | String | Device connection key. | |
offset_update | OffsetUpdate |
SetHAMPVelocityPercent200Response
No authorization required
- Content-Type: application/json
- Accept: application/json
sync(x_connection_key, opts)
Syncronize the connected device with the server clock.
Syncronizes the device with the server clock and calculates the round-trip-delay between the device and the server.
require 'time'
require 'handy_api'
api_instance = HandyAPI::HSTPApi.new
x_connection_key = 'x_connection_key_example' # String | Device connection key.
opts = {
sync_count: 56, # Integer | The number of round-trip samples to use in synchronization.
outliers: 56 # Integer | The number of sample outliers to discard in synchronization.
}
begin
# Syncronize the connected device with the server clock.
result = api_instance.sync(x_connection_key, opts)
p result
rescue HandyAPI::ApiError => e
puts "Error when calling HSTPApi->sync: #{e}"
end
This returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> sync_with_http_info(x_connection_key, opts)
begin
# Syncronize the connected device with the server clock.
data, status_code, headers = api_instance.sync_with_http_info(x_connection_key, opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <Sync200Response>
rescue HandyAPI::ApiError => e
puts "Error when calling HSTPApi->sync_with_http_info: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
x_connection_key | String | Device connection key. | |
sync_count | Integer | The number of round-trip samples to use in synchronization. | [optional][default to 30] |
outliers | Integer | The number of sample outliers to discard in synchronization. | [optional][default to 6] |
No authorization required
- Content-Type: Not defined
- Accept: application/json