Skip to content

Most visited

Recently visited

navigation

LowpanDriver

LowpanDriver

public abstract class LowpanDriver
extends Object

java.lang.Object
   ↳ com.google.android.things.userdriver.LowpanDriver


Driver to implement LoWPAN device.

User defined drivers should extend this class.

The frame format used for this class is draft-rquattle-spinel-unified-00, available here: https://tools.ietf.org/html/draft-rquattle-spinel-unified-00

Summary

Constants

int ERROR_GARBAGE

Garbage-received error code.

int ERROR_IOFAIL

Input/Output-failure error code.

int ERROR_TOOBIG

Frame-too-big error code.

Public constructors

LowpanDriver()

Public methods

abstract void reset()

Physically resets the NCP.

abstract void sendFrame(byte[] frame)

Sends Spinel frames to the NCP.

abstract void start(LowpanDriverCallback callback)

Starts the LoWPAN driver and makes it ready for use.

abstract void stop()

Stops the LoWPAN driver, optionally putting it in a low-power state.

Inherited methods

From class java.lang.Object

Constants

ERROR_GARBAGE

int ERROR_GARBAGE

Garbage-received error code.

This error code is emitted via onError(int) in response to the receipt of an invalid frame from the NCP which could not be recovered. For example, the frame may be invalid due to a bad CRC or because it was too long. This error is informative for the upper layers and not fatal.

See also:

Constant Value: 5 (0x00000005)

ERROR_IOFAIL

int ERROR_IOFAIL

Input/Output-failure error code.

This error code is emitted via onError(int) in response to any sort of non-recoverable I/O failure, and may be emitted at any time. Once this error is emitted, the driver is considered stopped: a call to start(LowpanDriverCallback) is required to begin using the interface again.

See also:

Constant Value: 4 (0x00000004)

ERROR_TOOBIG

int ERROR_TOOBIG

Frame-too-big error code.

This error code is emitted via onError(int) in response to @{link #sendFrame(byte[])} being called with an argument which is too large.

See also:

Constant Value: 3 (0x00000003)

Public constructors

LowpanDriver

LowpanDriver ()

Public methods

reset

void reset ()

Physically resets the NCP. Implemented by the driver.

sendFrame

void sendFrame (byte[] frame)

Sends Spinel frames to the NCP. Implemented by the driver.

Parameters
frame byte: Frame received from NCP.

start

void start (LowpanDriverCallback callback)

Starts the LoWPAN driver and makes it ready for use.

Implemented by the driver. onStarted() MUST be called at some point during or after this method is called.

The driver can signal a failure to start by calling onError(int) on callback instead of onStarted().

Parameters
callback LowpanDriverCallback

See also:

stop

void stop ()

Stops the LoWPAN driver, optionally putting it in a low-power state.

Implemented by the driver. May be restarted by calling start(LowpanDriverCallback).

See also:

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience. (Dec 2017 Android Platform & Tools Survey)