File: device.coffee

Defined in: lib/resin/models

Method Summary

Method Details

~ (void) getAll(callback)

Get all devices

resin.models.devices.getAll (error, devices) ->    throw error if error?    console.log(devices)

Parameters:

  • callback ( Function ) callback(error, devices)

Throws:

  • ( NotAny ) — Will throw if no devices were found

~ (void) getAllByApplication(applicationId, callback)

Get all devices by application

resin.models.devices.getAllByApplication (error, devices) ->    throw error if error?    console.log(devices)

Parameters:

  • applicationId ( String, Number ) application id
  • callback ( Function ) callback(error, devices)

Throws:

  • ( NotAny ) — Will throw if no devices were found

~ (void) get(deviceId, callback)

Get a single device

resin.models.device.get 51, (error, device) ->    throw error if error?    console.log(device)

Parameters:

  • id ( String, Number ) device id
  • callback ( Function ) callback(error, device)

Throws:

  • ( NotFound ) — Will throw if device was not found

~ (void) remove(id, callback)

Remove device

resin.models.device.remove 51, (error) ->    throw error if error?

Parameters:

  • id ( String, Number ) device id
  • callback ( Function ) callback(error)

~ (void) identify(uuid, callback)

Identify device

resin.models.device.identify '23c73a12e3527df55c60b9ce647640c1b7da1b32d71e6a21369ac0f00db828', (error) ->    throw error if error?

Parameters:

  • uuid ( String ) device uuid
  • callback ( Function ) callback(error)

    Quickly fuzzy find classes, mixins, methods, file:

    Control the navigation frame:

    You can focus and blur the search input: