Options
All
  • Public
  • Public/Protected
  • All
Menu

iotile-device

A Typescript library for interacting with IOTile Devices

Index

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

Object literals

Type aliases

ConnectionHookCallback

ConnectionHookCallback: function
ngdoc

overview

name

iotile.device

description

Introduction

The iotile.device module contains all services and classes needed for interacting with IOTile Devices, including receiving data from them, sending commands to them, updating their firmware and querying their status. It is designed to be dropped into an otherwise IOTile unaware angular application and provide a small API that encapsulates all necessary interactions with IOTile Devices.

The main point of entry in the iotile.device module is the IOTileAdapter service, which is the only public service provided by iotile.device. The IOTileAdapter service provides a way to scan for, connect to, receive data from, control and update IOTile Devices.

Type declaration

MobilePlatform

MobilePlatform: "ios" | "android"

NotificationCallback

NotificationCallback: function

Type declaration

    • (ArrayBuffer: ArrayBuffer): void
    • Parameters

      • ArrayBuffer: ArrayBuffer

      Returns void

PreconnectionHookCallback

PreconnectionHookCallback: function

Type declaration

PrestreamingHook

PrestreamingHook: function

Type declaration

RPCResponse

RPCResponse: Promise<(string | number)[]> | (string | number)[]

Variables

Const COMBINED_REPORT_STREAMER

COMBINED_REPORT_STREAMER: number = 255

Const HighspeedDataCharacteristic

HighspeedDataCharacteristic: "2006" = "2006"

Let IOTileServiceName

IOTileServiceName: string = "00002000-3FF7-53BA-E611-132C0FF60F63"

Const REPORT_HEADER_SIZE

REPORT_HEADER_SIZE: number = 20

Let RSSI

RSSI: number = -50

Const ReceiveHeaderCharacteristic

ReceiveHeaderCharacteristic: "2001" = "2001"

Const ReceivePayloadCharacteristic

ReceivePayloadCharacteristic: "2002" = "2002"

Const SYSTEM_REPORT_STREAMER

SYSTEM_REPORT_STREAMER: number = 1

Const SendHeaderCharacteristic

SendHeaderCharacteristic: "2003" = "2003"

Const SendPayloadCharacteristic

SendPayloadCharacteristic: "2004" = "2004"

Const StreamingCharacteristic

StreamingCharacteristic: "2005" = "2005"

Const TracingCharacteristic

TracingCharacteristic: "2007" = "2007"

Const USER_REPORT_STREAMER

USER_REPORT_STREAMER: number = 0

Let VOLTAGE

VOLTAGE: number = 3.8

Const catAdapter

catAdapter: Category = new Category("IOTileAdapter", catService)

Const catBLEOptimizer

catBLEOptimizer: Category = new Category("BLEOptimizer", catService)

Const catMockBLE

catMockBLE: Category = new Category("MockBLE", catService)

Const catService

catService: Category = new Category("iotile.device")

Functions

buildIndividualReport

  • buildIndividualReport(uuid: number, streamID: number, value: number): ArrayBuffer
  • Parameters

    • uuid: number
    • streamID: number
    • value: number

    Returns ArrayBuffer

createHashListReport

  • createHashListReport(uuid: number, reportID: number, streamer: number, sentTime: number, readings: Reading[]): ArrayBuffer | SharedArrayBuffer
  • Parameters

    • uuid: number
    • reportID: number
    • streamer: number
    • sentTime: number
    • readings: Reading[]

    Returns ArrayBuffer | SharedArrayBuffer

createIndividualReport

  • createIndividualReport(uuid: number, stream: string, value: number, sentTime: any, rawTime: any): ArrayBuffer

createReading

  • createReading(stream: string, timestamp: any, value: number, id: any): object

createSequentialReport

  • createSequentialReport(uuid: number, stream: string, count: number, streamer: number, start?: undefined | number): ArrayBuffer | SharedArrayBuffer

expectIndividual

  • expectIndividual(inReport: any, uuid: number, stream: string, value: number, sentTime: any, rawTime: any): void

expectSequential

  • expectSequential(inReport: any, uuid: number, stream: string, count: number, streamer: number): void

feedInPieces

  • feedInPieces(report: ArrayBuffer, handler: function, size: number): void
  • Parameters

    • report: ArrayBuffer
    • handler: function
        • (ArrayBuffer: ArrayBuffer): void
        • Parameters

          • ArrayBuffer: ArrayBuffer

          Returns void

    • size: number

    Returns void

findByDeviceID

packError

  • packError(subsystem: number, errorCode: number): number
  • Pack a 32-bit error code the same way an embedded device does it.

    Parameters

    • subsystem: number

      The subsystem ID that this error came from

    • errorCode: number

      The actual error code

    Returns number

rpc

  • rpc(address: number, rpcID: number, argFormat: string, respFormat: string): (Anonymous function)
  • Decorator factory that marks a function as a callable RPC with the given metadata.

    Parameters

    • address: number

      The address at which the RPC should appear

    • rpcID: number

      The 16-bit ID of the RPC

    • argFormat: string

      A format string compatible with unpackArrayBuffer to unpack arguments

    • respFormat: string

      A format string compatbile with packArrayBuffer to pack the return value

    Returns (Anonymous function)

setupMockBLE

  • setupMockBLE(config: any): void

tileRPC

  • tileRPC(rpcID: number, argFormat: string, respFormat: string): (Anonymous function)
  • Decorator factory that marks a function as a callable RPC with the given metadata.

    This function does not explicitly encode the RPC's address so it is suitable to use within a VirtualTile declaration that does not know its address in advance.

    Parameters

    • rpcID: number

      The 16-bit ID of the RPC

    • argFormat: string

      A format string compatible with unpackArrayBuffer to unpack arguments

    • respFormat: string

      A format string compatbile with packArrayBuffer to pack the return value

    Returns (Anonymous function)

Object literals

Const ANDROID_STRATEGY

ANDROID_STRATEGY: object

steps

steps: object[] = [{preupdateWait: 300,update: {minInterval: 7.5,maxInterval: 10,timeout: 1000}},{preupdateWait: 0,update: {minInterval: 7.5,maxInterval: 15,timeout: 1000}},{preupdateWait: 0,update: {minInterval: 7.5,maxInterval: 30,timeout: 1000}}]

Const IOS_STRATEGY

IOS_STRATEGY: object

steps

steps: object[] = [{preupdateWait: 180,update: {minInterval: 15,maxInterval: 15,timeout: 1000}}]

Const UPDATE_STRATEGIES

UPDATE_STRATEGIES: object

__computed

__computed: PlatformStrategy = ANDROID_STRATEGY

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc