Liking cljdoc? Tell your friends :D

chromex.app.hid

clj

Use the chrome.hid API to interact with connected HID devices. This API provides access to HID operations from within the context of an app. Using this API, apps can function as drivers for hardware devices.

Errors generated by this API are reported by setting 'runtime.lastError' and executing the function's regular callback. The callback's regular parameters will be undefined in this case.

Use the chrome.hid API to interact with connected HID devices.
This API provides access to HID operations from within the context of an app.
Using this API, apps can function as drivers for hardware devices.

Errors generated by this API are reported by setting
'runtime.lastError' and executing the function's regular callback. The
callback's regular parameters will be undefined in this case.

  * available since Chrome 38
  * https://developer.chrome.com/apps/hid
raw docstring

api-tableclj

source

connectclj/smacro

(connect device-id)

Open a connection to an HID device for communication.

|device-id| - The 'HidDeviceInfo.deviceId' of the device to open.

This function returns a core.async channel of type promise-chan which eventually receives a result value. Signature of the result value put on the channel is [connection] where:

|connection| - https://developer.chrome.com/apps/hid#property-callback-connection.

In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.

https://developer.chrome.com/apps/hid#method-connect.

Open a connection to an HID device for communication.

  |device-id| - The 'HidDeviceInfo.deviceId' of the device to open.

This function returns a core.async channel of type `promise-chan` which eventually receives a result value.
Signature of the result value put on the channel is [connection] where:

  |connection| - https://developer.chrome.com/apps/hid#property-callback-connection.

In case of an error the channel closes without receiving any value and relevant error object can be obtained via
chromex.error/get-last-error.

https://developer.chrome.com/apps/hid#method-connect.
sourceraw docstring

connect*cljs

(connect* config device-id)
source

disconnectclj/smacro

(disconnect connection-id)

Disconnect from a device. Invoking operations on a device after calling this is safe but has no effect.

|connection-id| - The connectionId returned by 'connect'.

This function returns a core.async channel of type promise-chan which eventually receives a result value. Signature of the result value put on the channel is [].

In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.

https://developer.chrome.com/apps/hid#method-disconnect.

Disconnect from a device. Invoking operations on a device after calling this is safe but has no effect.

  |connection-id| - The connectionId returned by 'connect'.

This function returns a core.async channel of type `promise-chan` which eventually receives a result value.
Signature of the result value put on the channel is [].

In case of an error the channel closes without receiving any value and relevant error object can be obtained via
chromex.error/get-last-error.

https://developer.chrome.com/apps/hid#method-disconnect.
sourceraw docstring

disconnect*cljs

(disconnect* config connection-id)
source

gen-callclj

source

gen-wrapclj/smacro

(gen-wrap kind item-id config & args)
source

get-devicesclj/smacro

(get-devices options)

Enumerate connected HID devices.

|options| - The properties to search for on target devices.

This function returns a core.async channel of type promise-chan which eventually receives a result value. Signature of the result value put on the channel is [devices] where:

|devices| - https://developer.chrome.com/apps/hid#property-callback-devices.

In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.

https://developer.chrome.com/apps/hid#method-getDevices.

Enumerate connected HID devices.

  |options| - The properties to search for on target devices.

This function returns a core.async channel of type `promise-chan` which eventually receives a result value.
Signature of the result value put on the channel is [devices] where:

  |devices| - https://developer.chrome.com/apps/hid#property-callback-devices.

In case of an error the channel closes without receiving any value and relevant error object can be obtained via
chromex.error/get-last-error.

https://developer.chrome.com/apps/hid#method-getDevices.
sourceraw docstring

get-devices*cljs

(get-devices* config options)
source

get-user-selected-devicesclj/smacro

(get-user-selected-devices)
(get-user-selected-devices options)

Presents a device picker to the user and returns 'HidDeviceInfo' objects for the devices selected. If the user cancels the picker devices will be empty. A user gesture is required for the dialog to display. Without a user gesture, the callback will run as though the user cancelled. If multiple filters are provided devices matching any filter will be displayed.

|options| - Configuration of the device picker dialog box.

This function returns a core.async channel of type promise-chan which eventually receives a result value. Signature of the result value put on the channel is [devices] where:

|devices| - https://developer.chrome.com/apps/hid#property-callback-devices.

In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.

https://developer.chrome.com/apps/hid#method-getUserSelectedDevices.

Presents a device picker to the user and returns 'HidDeviceInfo' objects for the devices selected. If the user cancels the
picker devices will be empty. A user gesture is required for the dialog to display. Without a user gesture, the callback
will run as though the user cancelled. If multiple filters are provided devices matching any filter will be displayed.

  |options| - Configuration of the device picker dialog box.

This function returns a core.async channel of type `promise-chan` which eventually receives a result value.
Signature of the result value put on the channel is [devices] where:

  |devices| - https://developer.chrome.com/apps/hid#property-callback-devices.

In case of an error the channel closes without receiving any value and relevant error object can be obtained via
chromex.error/get-last-error.

https://developer.chrome.com/apps/hid#method-getUserSelectedDevices.
sourceraw docstring

get-user-selected-devices*cljs

(get-user-selected-devices* config options)
source

on-device-added*cljs

(on-device-added* config channel & args)
source

on-device-removed*cljs

(on-device-removed* config channel & args)
source

receiveclj/smacro

(receive connection-id)

Receive the next input report from the device.

|connection-id| - The connectionId returned by 'connect'.

This function returns a core.async channel of type promise-chan which eventually receives a result value. Signature of the result value put on the channel is [report-id data] where:

|report-id| - The report ID or 0 if none. |data| - The report data, the report ID prefix (if present) is removed.

In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.

https://developer.chrome.com/apps/hid#method-receive.

Receive the next input report from the device.

  |connection-id| - The connectionId returned by 'connect'.

This function returns a core.async channel of type `promise-chan` which eventually receives a result value.
Signature of the result value put on the channel is [report-id data] where:

  |report-id| - The report ID or 0 if none.
  |data| - The report data, the report ID prefix (if present) is removed.

In case of an error the channel closes without receiving any value and relevant error object can be obtained via
chromex.error/get-last-error.

https://developer.chrome.com/apps/hid#method-receive.
sourceraw docstring

receive*cljs

(receive* config connection-id)
source

receive-feature-reportclj/smacro

(receive-feature-report connection-id report-id)

Request a feature report from the device.

|connection-id| - The connectionId returned by 'connect'. |report-id| - The report ID, or 0 if none.

This function returns a core.async channel of type promise-chan which eventually receives a result value. Signature of the result value put on the channel is [data] where:

|data| - The report data, including a report ID prefix if one is sent by the device.

In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.

https://developer.chrome.com/apps/hid#method-receiveFeatureReport.

Request a feature report from the device.

  |connection-id| - The connectionId returned by 'connect'.
  |report-id| - The report ID, or 0 if none.

This function returns a core.async channel of type `promise-chan` which eventually receives a result value.
Signature of the result value put on the channel is [data] where:

  |data| - The report data, including a report ID prefix if one is sent by the device.

In case of an error the channel closes without receiving any value and relevant error object can be obtained via
chromex.error/get-last-error.

https://developer.chrome.com/apps/hid#method-receiveFeatureReport.
sourceraw docstring

receive-feature-report*cljs

(receive-feature-report* config connection-id report-id)
source

sendclj/smacro

(send connection-id report-id data)

Send an output report to the device.Note: Do not include a report ID prefix in data. It will be added if necessary.

|connection-id| - The connectionId returned by 'connect'. |report-id| - The report ID to use, or 0 if none. |data| - The report data.

This function returns a core.async channel of type promise-chan which eventually receives a result value. Signature of the result value put on the channel is [].

In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.

https://developer.chrome.com/apps/hid#method-send.

Send an output report to the device.Note: Do not include a report ID prefix in data. It will be added if necessary.

  |connection-id| - The connectionId returned by 'connect'.
  |report-id| - The report ID to use, or 0 if none.
  |data| - The report data.

This function returns a core.async channel of type `promise-chan` which eventually receives a result value.
Signature of the result value put on the channel is [].

In case of an error the channel closes without receiving any value and relevant error object can be obtained via
chromex.error/get-last-error.

https://developer.chrome.com/apps/hid#method-send.
sourceraw docstring

send*cljs

(send* config connection-id report-id data)
source

send-feature-reportclj/smacro

(send-feature-report connection-id report-id data)

Send a feature report to the device.Note: Do not include a report ID prefix in data. It will be added if necessary.

|connection-id| - The connectionId returned by 'connect'. |report-id| - The report ID to use, or 0 if none. |data| - The report data.

This function returns a core.async channel of type promise-chan which eventually receives a result value. Signature of the result value put on the channel is [].

In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.

https://developer.chrome.com/apps/hid#method-sendFeatureReport.

Send a feature report to the device.Note: Do not include a report ID prefix in data. It will be added if necessary.

  |connection-id| - The connectionId returned by 'connect'.
  |report-id| - The report ID to use, or 0 if none.
  |data| - The report data.

This function returns a core.async channel of type `promise-chan` which eventually receives a result value.
Signature of the result value put on the channel is [].

In case of an error the channel closes without receiving any value and relevant error object can be obtained via
chromex.error/get-last-error.

https://developer.chrome.com/apps/hid#method-sendFeatureReport.
sourceraw docstring

send-feature-report*cljs

(send-feature-report* config connection-id report-id data)
source

tap-all-eventsclj/smacro

(tap-all-events chan)

Taps all valid non-deprecated events in chromex.app.hid namespace.

Taps all valid non-deprecated events in chromex.app.hid namespace.
sourceraw docstring

tap-on-device-added-eventsclj/smacro

(tap-on-device-added-events channel & args)

Event generated when a device is added to the system. Events are only broadcast to apps and extensions that have permission to access the device. Permission may have been granted at install time or when the user accepted an optional permission (see 'permissions.request').

Events will be put on the |channel| with signature [::on-device-added [device]] where:

|device| - https://developer.chrome.com/apps/hid#property-onDeviceAdded-device.

Note: |args| will be passed as additional parameters into Chrome event's .addListener call.

https://developer.chrome.com/apps/hid#event-onDeviceAdded.

Event generated when a device is added to the system. Events are only broadcast to apps and extensions that have permission
to access the device. Permission may have been granted at install time or when the user accepted an optional permission
(see 'permissions.request').

Events will be put on the |channel| with signature [::on-device-added [device]] where:

  |device| - https://developer.chrome.com/apps/hid#property-onDeviceAdded-device.

Note: |args| will be passed as additional parameters into Chrome event's .addListener call.

https://developer.chrome.com/apps/hid#event-onDeviceAdded.
sourceraw docstring

tap-on-device-removed-eventsclj/smacro

(tap-on-device-removed-events channel & args)

Event generated when a device is removed from the system. See 'onDeviceAdded' for which events are delivered.

Events will be put on the |channel| with signature [::on-device-removed [device-id]] where:

|device-id| - The deviceId property of the device passed to 'onDeviceAdded'.

Note: |args| will be passed as additional parameters into Chrome event's .addListener call.

https://developer.chrome.com/apps/hid#event-onDeviceRemoved.

Event generated when a device is removed from the system. See 'onDeviceAdded' for which events are delivered.

Events will be put on the |channel| with signature [::on-device-removed [device-id]] where:

  |device-id| - The deviceId property of the device passed to 'onDeviceAdded'.

Note: |args| will be passed as additional parameters into Chrome event's .addListener call.

https://developer.chrome.com/apps/hid#event-onDeviceRemoved.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close