Liking cljdoc? Tell your friends :D

chromex.app.bluetooth-socket

clj

Use the chrome.bluetoothSocket API to send and receive data to Bluetooth devices using RFCOMM and L2CAP connections.

Use the chrome.bluetoothSocket API to send and receive data
to Bluetooth devices using RFCOMM and L2CAP connections.

  * available since Chrome 37
  * https://developer.chrome.com/apps/bluetoothSocket
raw docstring

api-tableclj

source

closeclj/smacro

(close socket-id)

Disconnects and destroys the socket. Each socket created should be closed after use. The socket id is no longer valid as soon at the function is called. However, the socket is guaranteed to be closed only when the callback is invoked.

|socket-id| - The socket identifier.

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/bluetoothSocket#method-close.

Disconnects and destroys the socket. Each socket created should be closed after use. The socket id is no longer valid as
soon at the function is called. However, the socket is guaranteed to be closed only when the callback is invoked.

  |socket-id| - The socket identifier.

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/bluetoothSocket#method-close.
sourceraw docstring

close*cljs

(close* config socket-id)
source

connectclj/smacro

(connect socket-id address uuid)

Connects the socket to a remote Bluetooth device. When the connect operation completes successfully, onReceive events are raised when data is received from the peer. If a network error occur while the runtime is receiving packets, a onReceiveError event is raised, at which point no more onReceive event will be raised for this socket until the setPaused(false) method is called.

|socket-id| - The socket identifier. |address| - The address of the Bluetooth device. |uuid| - The UUID of the service to connect to.

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/bluetoothSocket#method-connect.

Connects the socket to a remote Bluetooth device. When the connect operation completes successfully, onReceive events are
raised when data is received from the peer. If a network error occur while the runtime is receiving packets, a
onReceiveError event is raised, at which point no more onReceive event will be raised for this socket until the
setPaused(false) method is called.

  |socket-id| - The socket identifier.
  |address| - The address of the Bluetooth device.
  |uuid| - The UUID of the service to connect to.

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/bluetoothSocket#method-connect.
sourceraw docstring

connect*cljs

(connect* config socket-id address uuid)
source

createclj/smacro

(create)
(create properties)

Creates a Bluetooth socket.

|properties| - The socket properties (optional).

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 [create-info] where:

|create-info| - The result of the socket creation.

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/bluetoothSocket#method-create.

Creates a Bluetooth socket.

  |properties| - The socket properties (optional).

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 [create-info] where:

  |create-info| - The result of the socket creation.

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/bluetoothSocket#method-create.
sourceraw docstring

create*cljs

(create* config properties)
source

disconnectclj/smacro

(disconnect socket-id)

Disconnects the socket. The socket identifier remains valid.

|socket-id| - The socket identifier.

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/bluetoothSocket#method-disconnect.

Disconnects the socket. The socket identifier remains valid.

  |socket-id| - The socket identifier.

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/bluetoothSocket#method-disconnect.
sourceraw docstring

disconnect*cljs

(disconnect* config socket-id)
source

gen-callclj

source

gen-wrapclj/smacro

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

get-infoclj/smacro

(get-info socket-id)

Retrieves the state of the given socket.

|socket-id| - The socket identifier.

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 [socket-info] where:

|socket-info| - Object containing the socket information.

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/bluetoothSocket#method-getInfo.

Retrieves the state of the given socket.

  |socket-id| - The socket identifier.

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 [socket-info] where:

  |socket-info| - Object containing the socket information.

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/bluetoothSocket#method-getInfo.
sourceraw docstring

get-info*cljs

(get-info* config socket-id)
source

get-socketsclj/smacro

(get-sockets)

Retrieves the list of currently opened sockets owned by the application.

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 [sockets] where:

|sockets| - https://developer.chrome.com/apps/bluetoothSocket#property-callback-sockets.

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/bluetoothSocket#method-getSockets.

Retrieves the list of currently opened sockets owned by the application.

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 [sockets] where:

  |sockets| - https://developer.chrome.com/apps/bluetoothSocket#property-callback-sockets.

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/bluetoothSocket#method-getSockets.
sourceraw docstring

get-sockets*cljs

(get-sockets* config)
source

listen-using-l2capclj/smacro

(listen-using-l2cap socket-id uuid)
(listen-using-l2cap socket-id uuid options)

Listen for connections using the L2CAP protocol.

|socket-id| - The socket identifier. |uuid| - Service UUID to listen on. |options| - Optional additional options for the service.

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/bluetoothSocket#method-listenUsingL2cap.

Listen for connections using the L2CAP protocol.

  |socket-id| - The socket identifier.
  |uuid| - Service UUID to listen on.
  |options| - Optional additional options for the service.

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/bluetoothSocket#method-listenUsingL2cap.
sourceraw docstring

listen-using-l2cap*cljs

(listen-using-l2cap* config socket-id uuid options)
source

listen-using-rfcommclj/smacro

(listen-using-rfcomm socket-id uuid)
(listen-using-rfcomm socket-id uuid options)

Listen for connections using the RFCOMM protocol.

|socket-id| - The socket identifier. |uuid| - Service UUID to listen on. |options| - Optional additional options for the service.

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/bluetoothSocket#method-listenUsingRfcomm.

Listen for connections using the RFCOMM protocol.

  |socket-id| - The socket identifier.
  |uuid| - Service UUID to listen on.
  |options| - Optional additional options for the service.

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/bluetoothSocket#method-listenUsingRfcomm.
sourceraw docstring

listen-using-rfcomm*cljs

(listen-using-rfcomm* config socket-id uuid options)
source

on-accept*cljs

(on-accept* config channel & args)
source

on-accept-error*cljs

(on-accept-error* config channel & args)
source

on-receive*cljs

(on-receive* config channel & args)
source

on-receive-error*cljs

(on-receive-error* config channel & args)
source

sendclj/smacro

(send socket-id data)

Sends data on the given Bluetooth socket.

|socket-id| - The socket identifier. |data| - The data to send.

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 [bytes-sent] where:

|bytes-sent| - The number of bytes sent.

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/bluetoothSocket#method-send.

Sends data on the given Bluetooth socket.

  |socket-id| - The socket identifier.
  |data| - The data to send.

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 [bytes-sent] where:

  |bytes-sent| - The number of bytes sent.

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/bluetoothSocket#method-send.
sourceraw docstring

send*cljs

(send* config socket-id data)
source

set-pausedclj/smacro

(set-paused socket-id paused)

Enables or disables a connected socket from receiving messages from its peer, or a listening socket from accepting new connections. The default value is 'false'. Pausing a connected socket is typically used by an application to throttle data sent by its peer. When a connected socket is paused, no onReceiveevent is raised. When a socket is connected and un-paused, onReceive events are raised again when messages are received. When a listening socket is paused, new connections are accepted until its backlog is full then additional connection requests are refused. onAccept events are raised only when the socket is un-paused.

|socket-id| - https://developer.chrome.com/apps/bluetoothSocket#property-setPaused-socketId. |paused| - https://developer.chrome.com/apps/bluetoothSocket#property-setPaused-paused.

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/bluetoothSocket#method-setPaused.

Enables or disables a connected socket from receiving messages from its peer, or a listening socket from accepting new
connections. The default value is 'false'. Pausing a connected socket is typically used by an application to throttle data
sent by its peer. When a connected socket is paused, no onReceiveevent is raised. When a socket is connected and un-paused,
onReceive events are raised again when messages are received. When a listening socket is paused, new connections are
accepted until its backlog is full then additional connection requests are refused. onAccept events are raised only when
the socket is un-paused.

  |socket-id| - https://developer.chrome.com/apps/bluetoothSocket#property-setPaused-socketId.
  |paused| - https://developer.chrome.com/apps/bluetoothSocket#property-setPaused-paused.

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/bluetoothSocket#method-setPaused.
sourceraw docstring

set-paused*cljs

(set-paused* config socket-id paused)
source

tap-all-eventsclj/smacro

(tap-all-events chan)

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

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

tap-on-accept-error-eventsclj/smacro

(tap-on-accept-error-events channel & args)

Event raised when a network error occurred while the runtime was waiting for new connections on the given socket. Once this event is raised, the socket is set to paused and no more onAccept events are raised for this socket.

Events will be put on the |channel| with signature [::on-accept-error [info]] where:

|info| - The event data.

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

https://developer.chrome.com/apps/bluetoothSocket#event-onAcceptError.

Event raised when a network error occurred while the runtime was waiting for new connections on the given socket. Once this
event is raised, the socket is set to paused and no more onAccept events are raised for this socket.

Events will be put on the |channel| with signature [::on-accept-error [info]] where:

  |info| - The event data.

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

https://developer.chrome.com/apps/bluetoothSocket#event-onAcceptError.
sourceraw docstring

tap-on-accept-eventsclj/smacro

(tap-on-accept-events channel & args)

Event raised when a connection has been established for a given socket.

Events will be put on the |channel| with signature [::on-accept [info]] where:

|info| - The event data.

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

https://developer.chrome.com/apps/bluetoothSocket#event-onAccept.

Event raised when a connection has been established for a given socket.

Events will be put on the |channel| with signature [::on-accept [info]] where:

  |info| - The event data.

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

https://developer.chrome.com/apps/bluetoothSocket#event-onAccept.
sourceraw docstring

tap-on-receive-error-eventsclj/smacro

(tap-on-receive-error-events channel & args)

Event raised when a network error occured while the runtime was waiting for data on the socket. Once this event is raised, the socket is set to paused and no more onReceive events are raised for this socket.

Events will be put on the |channel| with signature [::on-receive-error [info]] where:

|info| - The event data.

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

https://developer.chrome.com/apps/bluetoothSocket#event-onReceiveError.

Event raised when a network error occured while the runtime was waiting for data on the socket. Once this event is raised,
the socket is set to paused and no more onReceive events are raised for this socket.

Events will be put on the |channel| with signature [::on-receive-error [info]] where:

  |info| - The event data.

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

https://developer.chrome.com/apps/bluetoothSocket#event-onReceiveError.
sourceraw docstring

tap-on-receive-eventsclj/smacro

(tap-on-receive-events channel & args)

Event raised when data has been received for a given socket.

Events will be put on the |channel| with signature [::on-receive [info]] where:

|info| - The event data.

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

https://developer.chrome.com/apps/bluetoothSocket#event-onReceive.

Event raised when data has been received for a given socket.

Events will be put on the |channel| with signature [::on-receive [info]] where:

  |info| - The event data.

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

https://developer.chrome.com/apps/bluetoothSocket#event-onReceive.
sourceraw docstring

updateclj/smacro

(update socket-id properties)

Updates the socket properties.

|socket-id| - The socket identifier. |properties| - The properties to update.

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/bluetoothSocket#method-update.

Updates the socket properties.

  |socket-id| - The socket identifier.
  |properties| - The properties to update.

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/bluetoothSocket#method-update.
sourceraw docstring

update*cljs

(update* config socket-id properties)
source

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

× close