### Table of Contents - [CellularDevice][1] - [Parameters][2] - [CloudConnectionStatus][3] - [DISCONNECTED][4] - [CONNECTING][5] - [CONNECTED][6] - [DISCONNECTING][7] - [ServerProtocol][8] - [TCP][9] - [UDP][10] - [CloudDevice][11] - [Parameters][12] - [config][13] - [Parameters][14] - [PollingPolicy][15] - [DEFAULT][16] - [Parameters][17] - [DeviceBase][18] - [Parameters][19] - [open][20] - [Parameters][21] - [close][22] - [Parameters][23] - [sendControlRequest][24] - [Parameters][25] - [reset][26] - [isOpen][27] - [id][28] - [firmwareVersion][29] - [type][30] - [platformId][31] - [vendorId][32] - [productId][33] - [isInDfuMode][34] - [usbDevice][35] - [quirks][36] - [BOOTLOADER][37] - [SYSTEM_PART][38] - [USER_PART][39] - [MONO_FIRMWARE][40] - [NCP_FIRMWARE][41] - [RADIO_STACK][42] - [FirmwareModule][43] - [FirmwareModuleStore][44] - [FirmwareModuleDisplayNames][45] - [DeviceMode][46] - [NORMAL][47] - [LISTENING][48] - [LogLevel][49] - [ALL][50] - [TRACE][51] - [INFO][52] - [WARN][53] - [ERROR][54] - [NONE][55] - [Device][56] - [getSerialNumber][57] - [Parameters][58] - [getDeviceId][59] - [Parameters][60] - [reset][61] - [Parameters][62] - [factoryReset][63] - [Parameters][64] - [enterDfuMode][65] - [Parameters][66] - [enterSafeMode][67] - [Parameters][68] - [enterListeningMode][69] - [Parameters][70] - [leaveListeningMode][71] - [Parameters][72] - [getDeviceMode][73] - [Parameters][74] - [startNyanSignal][75] - [Parameters][76] - [stopNyanSignal][77] - [Parameters][78] - [updateFirmware][79] - [Parameters][80] - [getFirmwareModule][81] - [Parameters][82] - [getAssetInfo][83] - [Parameters][84] - [getFirmwareModuleInfo][85] - [Parameters][86] - [hasModularFirmware][87] - [setFactoryFirmware][88] - [Parameters][89] - [getFactoryFirmware][90] - [readConfigData][91] - [Parameters][92] - [writeConfigData][93] - [Parameters][94] - [getConfigDataSize][95] - [readEeprom][96] - [Parameters][97] - [writeEeprom][98] - [Parameters][99] - [clearEeprom][100] - [getEepromSize][101] - [addLogHandler][102] - [Parameters][103] - [removeLogHandler][104] - [Parameters][105] - [getLogHandlers][106] - [unprotectDevice][107] - [Parameters][108] - [getProtectionState][109] - [getEnv][110] - [Properties][111] - [getEnv][112] - [Properties][113] - [getEnv][114] - [clearEnv][115] - [Properties][116] - [clearEnv][117] - [sendProtobufRequest][118] - [Parameters][119] - [UnprotectDeviceResult][120] - [Properties][121] - [GetProtectionStateResult][122] - [Properties][123] - [sinon][124] - [DfuError][125] - [Parameters][126] - [DfuseCommand][127] - [open][128] - [close][129] - [leave][130] - [enterSafeMode][131] - [clearSecurityModeOverride][132] - [getProtectionState][133] - [setAltSetting][134] - [Parameters][135] - [doDownload][136] - [Parameters][137] - [\_sendDnloadRequest][138] - [Parameters][139] - [\_getStatus][140] - [\_pollUntil][141] - [Parameters][142] - [\_clearStatus][143] - [\_parseMemoryDescriptor][144] - [Parameters][145] - [\_dfuseCommand][146] - [Parameters][147] - [\_getSegment][148] - [Parameters][149] - [\_getSectorStart][150] - [Parameters][151] - [\_getSectorEnd][152] - [Parameters][153] - [\_erase][154] - [Parameters][155] - [DeviceError][156] - [Parameters][157] - [NotFoundError][158] - [Parameters][159] - [NotAllowedError][160] - [Parameters][161] - [StateError][162] - [Parameters][163] - [TimeoutError][164] - [Parameters][165] - [MemoryError][166] - [Parameters][167] - [ProtocolError][168] - [Parameters][169] - [UsbError][170] - [Parameters][171] - [InternalError][172] - [Parameters][173] - [RequestError][174] - [Parameters][175] - [UsbStallError][176] - [Parameters][177] - [DeviceProtectionError][178] - [Parameters][179] - [UnsupportedDfuseCommandError][180] - [Parameters][181] - [Gen3Device][182] - [Parameters][183] - [LinuxDevice][184] - [getDeviceMode][185] - [NetworkStatus][186] - [convertInterfaceAddress][187] - [Parameters][188] - [convertIpv4Address][189] - [Parameters][190] - [convertIpv6Address][191] - [Parameters][192] - [NetworkDevice][193] - [Parameters][194] - [getDevices][195] - [Parameters][196] - [openDeviceById][197] - [Parameters][198] - [openNativeUsbDevice][199] - [Parameters][200] - [getEdlDevices][201] - [fromProtobufEnum][202] - [Parameters][203] - [extractBits][204] - [Parameters][205] - [Result][206] - [messageForResultCode][207] - [Parameters][208] - [DEVICE_CLASSES][209] - [setDevicePrototype][210] - [Parameters][211] - [WifiAntenna][212] - [WifiSecurity][213] - [WifiCipher][214] - [EapMethod][215] - [WifiDeviceLegacy][216] - [Parameters][217] - [WiFiSecurity][218] - [WifiDevice][219] - [Parameters][220] ## CellularDevice [src/cellular-device.js:13-71][221] Cellular device. This class is not meant to be instantiated directly. Use [getDevices][195] and [openDeviceById][197] to create device instances. ### Parameters - `base` ## CloudConnectionStatus [src/cloud-device.js:13-22][222] Cloud connection status. Type: [String][223] ### DISCONNECTED [src/cloud-device.js:15-15][224] Disconnected. ### CONNECTING [src/cloud-device.js:17-17][225] Connecting. ### CONNECTED [src/cloud-device.js:19-19][226] Connected. ### DISCONNECTING [src/cloud-device.js:21-21][227] Disconnecting. ## ServerProtocol [src/cloud-device.js:29-34][228] Server protocol types. Type: [String][223] ### TCP [src/cloud-device.js:31-31][229] TCP. ### UDP [src/cloud-device.js:33-33][230] UDP. ## CloudDevice [src/cloud-device.js:44-380][231] Cloud-enabled device. This class is not meant to be instantiated directly. Use [getDevices][195] and [openDeviceById][197] to create device instances. ### Parameters - `base` ## config [src/config.js:31-33][232] Set global options. ### Parameters - `options` **[Object][233]?** Options. - `options.requestTimeout` **[Number][234]** Default request timeout (milliseconds). (optional, default `60000`) - `options.log` **[Object][233]?** Logger instance. The logger is expected to have the following methods: `trace(String)`, `info(String)`, `warn(String)`, `error(String)`. Returns **[Object][233]** Current options. ## PollingPolicy [src/device-base.js:58-61][235] Predefined polling policies. Type: [Function][236] ### DEFAULT [src/device-base.js:60-60][237] Default polling policy. #### Parameters - `n` ## DeviceBase [src/device-base.js:86-751][238] **Extends EventEmitter** Base class for a Particle USB device. This class is not meant to be instantiated directly. Use [getDevices][195] and [openDeviceById][197] to create device instances. ### Parameters - `dev` - `info` ### open [src/device-base.js:121-175][239] Open the device. #### Parameters - `options` **[Object][233]?** Options. - `options.concurrentRequests` **[Number][234]?** Maximum number of requests that can be sent to the device concurrently. Requests that exceed this limit are queued. By default, this parameter is set to the maximum number of concurrent requests supported by the device. Returns **[Promise][240]** ### close [src/device-base.js:187-216][241] Close the device. #### Parameters - `options` **[Object][233]?** Options. - `options.processPendingRequests` **[Boolean][242]** Whether to complete processing of the pending requests before closing the device. (optional, default `true`) - `options.timeout` **[Number][234]?** Timeout for processing pending requests (milliseconds). By default, the device is kept open until all requests are processed. Returns **[Promise][240]** ### sendControlRequest [src/device-base.js:232-285][243] Send a control request to the device. #### Parameters - `type` **[Number][234]** Request type. - `data` **([Buffer][244] \| [String][223])** Request data. - `options` **[Object][233]?** Request options. - `options.pollingPolicy` **([Function][236] \| [Number][234])** Request polling policy. This parameter specifies how frequently the device will be polled to determine the result of the request. The argument can either be a function that returns the number of milliseconds to wait before polling the device again or a number that specifies a fixed interval. (optional, default `PollingPolicy.DEFAULT`) - `options.timeout` **[Number][234]?** Request timeout. The default timeout can be configured via [config][13]. Returns **[Promise][240]<[Object][233]>** Response object. ### reset [src/device-base.js:294-299][245] Perform the system reset. This method only works in DFU mode. Returns **[Promise][240]** ### isOpen [src/device-base.js:304-306][246] Set to `true` if the device is open. ### id [src/device-base.js:313-315][247] Device ID. This property is set to `null` if the device is closed. ### firmwareVersion [src/device-base.js:322-324][248] Device OS system version. This property is set to `null` if the device is closed or the version could not be determined. ### type [src/device-base.js:329-331][249] Device type (photon, boron, tracker, etc) ### platformId [src/device-base.js:336-338][250] Platform ID ### vendorId [src/device-base.js:343-345][251] USB vendor ID. ### productId [src/device-base.js:350-352][252] USB product ID. ### isInDfuMode [src/device-base.js:357-359][253] Set to `true` if this device is in the DFU mode. ### usbDevice [src/device-base.js:364-366][254] Internal USB device handle. ### quirks [src/device-base.js:371-373][255] Device USB quirks ## BOOTLOADER [src/device.js:14-14][256] Bootloader module. ## SYSTEM_PART [src/device.js:16-16][257] System part module. ## USER_PART [src/device.js:18-18][258] User part module. ## MONO_FIRMWARE [src/device.js:20-20][259] Monolithic firmware module. ## NCP_FIRMWARE [src/device.js:22-22][260] Network co-processor firmware module ## RADIO_STACK [src/device.js:24-24][261] Radio stack module ## FirmwareModule [src/device.js:32-43][262] Firmware module types. Type: [String][223] ## FirmwareModuleStore [src/device.js:50-55][263] Firmware module store. Type: [String][223] ## FirmwareModuleDisplayNames [src/device.js:74-85][264] Firmware module readable names Type: [String][223] ## DeviceMode [src/device.js:92-97][265] Device modes. Type: [String][223] ### NORMAL [src/device.js:94-94][266] Device is in normal mode. ### LISTENING [src/device.js:96-96][267] Device is in listening mode. ## LogLevel [src/device.js:104-117][268] Logging levels. Type: [String][223] ### ALL [src/device.js:106-106][269] Enables logging of all messages. ### TRACE [src/device.js:108-108][270] Enables logging of trace messages. ### INFO [src/device.js:110-110][271] Enables logging of info messages. ### WARN [src/device.js:112-112][272] Enables logging of warning messages. ### ERROR [src/device.js:114-114][273] Enables logging of error messages. ### NONE [src/device.js:116-116][274] Disables logging of any messages. ## Device [src/device.js:166-1273][275] **Extends DeviceBase** Basic functionality supported by most of Particle devices. This class is not meant to be instantiated directly. Use [getDevices][195] and [openDeviceById][197] to create device instances. ### getSerialNumber [src/device.js:178-185][276] Get the device's serial number. Supported platforms: - Gen 3 (since Device OS 0.9.0) - Gen 2 (since Device OS 1.5.0) #### Parameters - `options` **[Object][233]?** Options. (optional, default `{}`) - `options.timeout` **[Number][234]?** Timeout (milliseconds). (optional, default `globalOptions.requestTimeout`) Returns **[Promise][240]<[String][223]>** ### getDeviceId [src/device.js:198-205][277] Get the device's id. Supported platforms: - Gen 3 (since Device OS 0.9.0) - Gen 2 (since Device OS 1.5.0) #### Parameters - `options` **[Object][233]?** Options. (optional, default `{}`) - `options.timeout` **[Number][234]?** Timeout (milliseconds). (optional, default `globalOptions.requestTimeout`) Returns **[Promise][240]<[String][223]>** ### reset [src/device.js:225-239][278] Perform the system reset. Note: The only safe operation that can be performed on the device instance after the device resets is closing it via [DeviceBase#close][279]. Supported platforms: - Gen 3 (since Device OS 0.9.0) - Gen 2 (since Device OS 0.8.0) The `force` option is supported since Device OS 2.0.0. #### Parameters - `options` **[Object][233]?** Options. (optional, default `{}`) - `options.force` **[Boolean][242]?** Reset the device immediately, even if it is busy performing some blocking operation, such as writing to flash. (optional, default `false`) - `options.timeout` **[Number][234]?** Timeout (milliseconds). (optional, default `globalOptions.requestTimeout`) Returns **[Promise][240]** ### factoryReset [src/device.js:255-257][280] Perform the factory reset. Note: The only safe operation that can be performed on the device instance after the device resets is closing it via [DeviceBase#close][279]. Supported platforms: - Gen 3 (since Device OS 0.9.0) - Gen 2 (since Device OS 0.8.0) #### Parameters - `options` **[Object][233]?** Options. (optional, default `{}`) - `options.timeout` **[Number][234]?** Timeout (milliseconds). (optional, default `globalOptions.requestTimeout`) Returns **[Promise][240]** ### enterDfuMode [src/device.js:276-298][281] Reset and enter the DFU mode. Note: The only safe operation that can be performed on the device instance after the device resets is closing it via [DeviceBase#close][279]. Supported platforms: - Gen 3 (since Device OS 0.9.0) - Gen 2 (since Device OS 0.8.0) #### Parameters - `options` **[Object][233]?** Options. (optional, default `{}`) - `options.noReconnectWait` **[Boolean][242]?** After entering DFU mode, do not attempt to connect to the device to make sure it's in DFU mode. This can be useful in a web browser because connecting to the device in DFU mode may prompt the user to authorize access to the device. (optional, default `false`) - `options.timeout` **[Number][234]?** Timeout (milliseconds). (optional, default `globalOptions.requestTimeout`) Returns **[Promise][240]** ### enterSafeMode [src/device.js:315-320][282] Reset and enter the safe mode. Note: The only safe operation that can be performed on the device instance after the device resets is closing it via [DeviceBase#close][279]. Supported platforms: - Gen 3 (since Device OS 0.9.0) - Gen 2 (since Device OS 0.8.0) #### Parameters - `options` **[Object][233]?** Options. (optional, default `{}`) - `options.timeout` **[Number][234]?** Timeout (milliseconds). (optional, default `globalOptions.requestTimeout`) Returns **[Promise][240]** ### enterListeningMode [src/device.js:333-357][283] Enter listening mode. Supported platforms: - Gen 3 (since Device OS 0.9.0) - Gen 2 (since Device OS 0.8.0) #### Parameters - `options` **[Object][233]?** Options. (optional, default `{}`) - `options.timeout` **[Number][234]?** Timeout (milliseconds). (optional, default `globalOptions.requestTimeout`) Returns **[Promise][240]** Resolves when either device is confirmed to be in listening mode, throws an error, or timeout exceeded. ### leaveListeningMode [src/device.js:370-372][284] Leave the listening mode. Supported platforms: - Gen 3 (since Device OS 0.9.0) - Gen 2 (since Device OS 0.8.0) #### Parameters - `options` **[Object][233]?** Options. (optional, default `{}`) - `options.timeout` **[Number][234]?** Timeout (milliseconds). (optional, default `globalOptions.requestTimeout`) Returns **[Promise][240]** ### getDeviceMode [src/device.js:385-388][285] Get the device mode. Supported platforms: - Gen 3 (since Device OS 0.9.0) - Gen 2 (since Device OS 1.1.0) #### Parameters - `options` **[Object][233]?** Options. (optional, default `{}`) - `options.timeout` **[Number][234]?** Timeout (milliseconds). (optional, default `globalOptions.requestTimeout`) Returns **[Promise][240]<[DeviceMode][286]>** ### startNyanSignal [src/device.js:401-403][287] Start the Nyan LED indication. Supported platforms: - Gen 3 (since Device OS 0.9.0) - Gen 2 (since Device OS 0.8.0) #### Parameters - `options` **[Object][233]?** Options. (optional, default `{}`) - `options.timeout` **[Number][234]?** Timeout (milliseconds). (optional, default `globalOptions.requestTimeout`) Returns **[Promise][240]** ### stopNyanSignal [src/device.js:416-418][288] Stop the Nyan LED indication. Supported platforms: - Gen 3 (since Device OS 0.9.0) - Gen 2 (since Device OS 0.8.0) #### Parameters - `options` **[Object][233]?** Options. (optional, default `{}`) - `options.timeout` **[Number][234]?** Timeout (milliseconds). (optional, default `globalOptions.requestTimeout`) Returns **[Promise][240]** ### updateFirmware [src/device.js:433-460][289] Perform the firmware update. Supported platforms: - Gen 3 (since Device OS 0.9.0) - Gen 2 (since Device OS 0.8.0) #### Parameters - `data` **[Buffer][244]** Firmware data. - `options` **[Object][233]?** Options. (optional, default `{}`) - `options.timeout` **[Number][234]?** Timeout (milliseconds). (optional, default `DEFAULT_FIRMWARE_UPDATE_TIMEOUT`) - `options.progress` **[Function][236]?** User's callback function to log progress of the flashing process. Returns **[Promise][240]** ### getFirmwareModule [src/device.js:475-489][290] Get firmware module data. #### Parameters - `module` **[String][223]** Module type. - `index` **[Number][234]?** Module index. Returns **[Promise][240]<[Buffer][244]>** **Meta** - **deprecated**: This method is not guaranteed to work with recent versions of Device OS and it will be removed in future versions of this library. Supported platforms: - Gen 2 (since Device OS 0.8.0, deprecated in 2.0.0) ### getAssetInfo [src/device.js:500-525][291] Get asset info. Supported platforms: - Gen 3+ (since Device OS 5.6.0) #### Parameters - `$0` **[Object][233]** (optional, default `{}`) - `$0.timeout` (optional, default `globalOptions.timeout`) Returns **[Promise][240]<[Array][292]>** List of asssets available on the device. ### getFirmwareModuleInfo [src/device.js:538-599][293] Get firmware module info. Supported platforms: - Gen 3 (since Device OS 0.9.0) - Gen 2 (since Device OS 0.8.0) - New format since 5.6.0 (old format in 'modules_deprecated') #### Parameters - `$0` **[Object][233]** (optional, default `{}`) - `$0.timeout` (optional, default `globalOptions.requestTimeout`) Returns **[Promise][240]<[Array][292]>** List of modules installed into the device and their dependencies ### hasModularFirmware [src/device.js:612-614][294] Check if the device runs a modular firmware. Returns **[Promise][240]<[Boolean][242]>** **Meta** - **deprecated**: This method is not guaranteed to work with recent versions of Device OS and it will be removed in future versions of this library. Supported platforms: - Gen 2 (since Device OS 0.8.0, deprecated in 2.0.0) ### setFactoryFirmware [src/device.js:628-635][295] Set factory firmware. #### Parameters - `data` **[Buffer][244]** Firmware data. Returns **[Promise][240]** **Meta** - **deprecated**: This method is not guaranteed to work with recent versions of Device OS and it will be removed in future versions of this library. Supported platforms: - Gen 2 (since Device OS 0.8.0, deprecated in 2.0.0) ### getFactoryFirmware [src/device.js:648-659][296] Get factory firmware. Returns **[Promise][240]<[Buffer][244]>** **Meta** - **deprecated**: This method is not guaranteed to work with recent versions of Device OS and it will be removed in future versions of this library. Supported platforms: - Gen 2 (since Device OS 0.8.0, deprecated in 2.0.0) ### readConfigData [src/device.js:674-681][297] Read configuration data. #### Parameters - `address` **[Number][234]** Address. - `size` **[Number][234]** Data size. Returns **[Promise][240]<[Buffer][244]>** **Meta** - **deprecated**: This method is not guaranteed to work with recent versions of Device OS and it will be removed in future versions of this library. Supported platforms: - Gen 2 (since Device OS 0.8.0, deprecated in 2.0.0) ### writeConfigData [src/device.js:696-703][298] Write configuration data. #### Parameters - `address` **[Number][234]** Address. - `data` **[Buffer][244]** Data. Returns **[Promise][240]** **Meta** - **deprecated**: This method is not guaranteed to work with recent versions of Device OS and it will be removed in future versions of this library. Supported platforms: - Gen 2 (since Device OS 0.8.0, deprecated in 2.0.0) ### getConfigDataSize [src/device.js:716-723][299] Get size of the configuration data. Returns **[Promise][240]<[Number][234]>** **Meta** - **deprecated**: This method is not guaranteed to work with recent versions of Device OS and it will be removed in future versions of this library. Supported platforms: - Gen 2 (since Device OS 0.8.0, deprecated in 2.0.0) ### readEeprom [src/device.js:738-745][300] Read from EEPROM. #### Parameters - `address` **[Number][234]** Address. - `size` **[Number][234]** Data size. Returns **[Promise][240]<[Buffer][244]>** **Meta** - **deprecated**: This method is not guaranteed to work with recent versions of Device OS and it will be removed in future versions of this library. Supported platforms: - Gen 2 (since Device OS 0.8.0, deprecated in 2.0.0) ### writeEeprom [src/device.js:760-767][301] Write to EEPROM. #### Parameters - `address` **[Number][234]** Address. - `data` **[Buffer][244]** Data. Returns **[Promise][240]** **Meta** - **deprecated**: This method is not guaranteed to work with recent versions of Device OS and it will be removed in future versions of this library. Supported platforms: - Gen 2 (since Device OS 0.8.0, deprecated in 2.0.0) ### clearEeprom [src/device.js:780-787][302] Clear EEPROM. Returns **[Promise][240]** **Meta** - **deprecated**: This method is not guaranteed to work with recent versions of Device OS and it will be removed in future versions of this library. Supported platforms: - Gen 2 (since Device OS 0.8.0, deprecated in 2.0.0) ### getEepromSize [src/device.js:800-807][303] Get size of the EEPROM. Returns **[Promise][240]<[Number][234]>** **Meta** - **deprecated**: This method is not guaranteed to work with recent versions of Device OS and it will be removed in future versions of this library. Supported platforms: - Gen 2 (since Device OS 0.8.0, deprecated in 2.0.0) ### addLogHandler [src/device.js:824-879][304] Add a log handler. #### Parameters - `options` **[Object][233]** Options. - `options.id` **[String][223]** Handler ID. - `options.stream` **[String][223]** Output stream: `Serial`, `Serial1`, `USBSerial1`, etc. - `options.format` **[String][223]?** Message format: `default`, `json`. - `options.level` **[String][223]?** Default logging level: `trace`, `info`, `warn`, `error`, `none`, `all`. - `options.filters` **[Array][292]?** Category filters. - `options.baudRate` **[Number][234]?** Baud rate. Returns **[Promise][240]** **Meta** - **deprecated**: This method is not guaranteed to work with recent versions of Device OS and it will be removed in future versions of this library. ### removeLogHandler [src/device.js:891-893][305] Remove a log handler. #### Parameters - `options` **[Object][233]** Options. - `options.id` **[String][223]** Handler ID. Returns **[Promise][240]** **Meta** - **deprecated**: This method is not guaranteed to work with recent versions of Device OS and it will be removed in future versions of this library. ### getLogHandlers [src/device.js:903-908][306] Get the list of active log handlers. Returns **[Promise][240]<[Array][292]<[Object][233]>>** **Meta** - **deprecated**: This method is not guaranteed to work with recent versions of Device OS and it will be removed in future versions of this library. ### unprotectDevice [src/device.js:928-980][307] Request the device to temporarily disable device protection. #### Parameters - `param` **[Object][233]** Parameters. - `param.action` **[String][223]** `prepare`, `confirm` or `reset`. - `param.serverNonce` **[Buffer][244]?** Server nonce. Mandatory if `action` is `prepare`. - `param.serverSignature` **[Buffer][244]?** Server signature. Mandatory if `action` is `confirm`. - `param.serverPublicKeyFingerprint` **[Buffer][244]?** Fingerprint of the server public key. Mandatory if `action` is `confirm`. Returns **[Promise][240]<[UnprotectDeviceResult][308]>** ### getProtectionState [src/device.js:993-1004][309] Check if device protection is enabled. Returns **[GetProtectionStateResult][310]** ### getEnv [src/device.js:1030-1044][311] Type: [Object][233] #### Properties - `value` **[String][223]** Variable value. - `isApp` **[Boolean][242]** If `true`, this is an application variable. ### getEnv [src/device.js:1030-1044][311] Type: [Object][233] #### Properties - `env` **[Object][233]<[string][223], EnvValue>** Environment variables. - `snapshot` **[Object][233]?** Snapshot info. - `snapshot.hash` **[String][223]** Snapshot hash. ### getEnv [src/device.js:1030-1044][311] Get all defined environment variables. Supported platforms: - Gen 3 (since Device OS 6.4.0) - Gen 4 (since Device OS 6.4.0) Returns **[Promise][240]<GetEnvResult>** ### clearEnv [src/device.js:1061-1066][312] Type: [Object][233] #### Properties - `needReset` **[Boolean][242]** If `true`, a system reset is needed to apply the changes. ### clearEnv [src/device.js:1061-1066][312] Clear all defined environment variables. Supported platforms: - Gen 3 (since Device OS 6.4.0) - Gen 4 (since Device OS 6.4.0) Returns **[Promise][240]<ClearEnvResult>** ### sendProtobufRequest [src/device.js:1076-1099][313] Sends a protobuf encoded request to Device and decodes response. Use higher level methods like getSerialNumber() than this if possible. #### Parameters - `protobufMessageName` **[String][223]** The protobuf message name, see DeviceOSProtobuf.getDefinitions() for valid values. - `protobufMessageData` **[Object][233]** data that will be encoded into the protobuf request before sending to device (optional, default `{}`) - `opts` **any** See sendControlRequest(), same options are here. - Throws **[RequestError][314]** thrown when message isn't supported by device or other USB related failures Returns **[Object][233]** Depends on schema defined by `req.reply` ## UnprotectDeviceResult [src/device.js:928-980][315] Type: [Object][233] ### Properties - `protected` **[Boolean][242]** If `true`, device protection is enabled. - `deviceNonce` **[Buffer][244]?** Device nonce. - `deviceSignatute` **[Buffer][244]?** Device signature. - `devicePublicKeyFingerprint` **[Buffer][244]?** Fingerprint of the device public key. ## GetProtectionStateResult [src/device.js:993-1004][316] Type: [Object][233] ### Properties - `protected` **[Boolean][242]** If `true`, device protection is enabled. - `overridden` **[Boolean][242]** If `true`, device protection was disabled temporarily. ## sinon [src/device.test.js:7-7][317] We deliberately don't use fakeUSB in these tests because it mocks out src/device.js which is the object under test in this file. Instead, we take a different mocking strategy that also mocks out USB hardware, but doesn't mock src/device.js. ## DfuError [src/dfu.js:26-31][318] **Extends DeviceError** A generic DFU error. ### Parameters - `args` **...any** ## DfuseCommand [src/dfu.js:129-137][319] DFU with ST Microsystems extensions. AN3156: USB DFU protocol used in the STM32 bootloader. ## open [src/dfu.js:168-176][320] Open DFU interface. Returns **[Promise][240]** ## close [src/dfu.js:183-187][321] Close DFU interface. Returns **[Promise][240]** ## leave [src/dfu.js:194-205][322] Leave DFU mode. Returns **[Promise][240]** ## enterSafeMode [src/dfu.js:212-219][323] Enter safe mode. Returns **[Promise][240]** ## clearSecurityModeOverride [src/dfu.js:226-230][324] Re-enable device protection. Returns **[Promise][240]** ## getProtectionState [src/dfu.js:238-259][325] Get the protection state of the device. A device with protection enabled will have all segments not readable and not writeable. Returns **[Promise][240]** Object with property 'protected' ## setAltSetting [src/dfu.js:267-302][326] Set the alternate interface for DFU and initialize memory information. ### Parameters - `setting` **[number][234]** The alternate interface index to set. Returns **[Promise][240]** ## doDownload [src/dfu.js:315-386][327] Perform DFU download of binary data to the device. ### Parameters - `options` **[Object][233]** Options. - `options.startAddr` **[number][234]** The starting address to write the data. - `options.data` **[Buffer][244]** The binary data to write. - `options.noErase` **[boolean][242]?** Skip erasing the device memory. - `options.leave` **[boolean][242]?** Leave DFU mode after download. - `options.progress` **[function][236]?** Callback function used to log progress. Returns **[Promise][240]** ## \_sendDnloadRequest [src/dfu.js:426-434][328] Sends a download request to the DFU device with the specified request and value. This request is sent via nodeusb or webusb ### Parameters - `data` - `wValue` **[number][234]** The value to be sent as part of the request. - `req` **[Buffer][244]** The request data buffer to be sent to the device. ## \_getStatus [src/dfu.js:463-499][329] Retrieves the status from the DFU (Device Firmware Upgrade) device. - Throws **[DfuError][330]** If parsing the DFU_GETSTATUS response fails or the status/state is invalid. Returns **[Promise][240]<[object][233]>** A Promise that resolves with the status object containing status, pollTimeout, and state. ## \_pollUntil [src/dfu.js:507-523][331] Poll until the given statePredicate is true or the device goes into dfuERROR state. ### Parameters - `statePredicate` **[function][236]** The function to check the device state. Returns **[object][233]** The DFU status object after polling. ## \_clearStatus [src/dfu.js:528-536][332] Sends the DFU_CLRSTATUS request to the DFU device to clear any error status. ## \_parseMemoryDescriptor [src/dfu.js:544-586][333] Parse the memory descriptor string and create a memory map. ### Parameters - `desc` **[string][223]** The memory descriptor string. Returns **[object][233]** Memory map information. ## \_dfuseCommand [src/dfu.js:596-633][334] Send a DfuSe command to the DFU device. ### Parameters - `command` **[number][234]** The DfuSe command to send. - `param` **[number][234]** Optional. The parameter for the command. - `len` **[number][234]** Optional. The length of the command payload. Returns **[Promise][240]** ## \_getSegment [src/dfu.js:641-653][335] Get the memory segment that contains the given address. ### Parameters - `addr` **[number][234]** The address to find the corresponding memory segment. Returns **([object][233] | null)** The memory segment containing the address, or null if not found. ## \_getSectorStart [src/dfu.js:662-673][336] Get the start address of the sector containing the given address. ### Parameters - `addr` **[number][234]** The address to find the corresponding sector start address. - `segment` **[object][233]** Optional. The memory segment containing the address. If not provided, it will be looked up. Returns **[number][234]** The start address of the sector. ## \_getSectorEnd [src/dfu.js:682-693][337] Get the end address of the sector containing the given address. ### Parameters - `addr` **[number][234]** The address to find the corresponding sector end address. - `segment` **[object][233]** Optional. The memory segment containing the address. If not provided, it will be looked up. Returns **[number][234]** The end address of the sector. ## \_erase [src/dfu.js:703-741][338] Erases the memory of the DFU device starting from the specified address and for the given length. This method erases memory sectors that are marked as erasable in the memory map. ### Parameters - `startAddr` **[number][234]** The starting address of the memory range to be erased. - `length` **[number][234]** The length of the memory range to be erased in bytes. - `progress` - Throws **[Error][339]** If the start address or the length is outside the memory map bounds, or if erasing fails. ## DeviceError [src/error.js:5-10][340] **Extends Error** Generic device error. This is a base class for all errors reported by the library. ### Parameters - `args` **...any** ## NotFoundError [src/error.js:15-20][341] **Extends DeviceError** An error reported when a requested resource cannot be found. ### Parameters - `args` **...any** ## NotAllowedError [src/error.js:25-30][342] **Extends DeviceError** An error reported when a requested operation is not permitted. ### Parameters - `args` **...any** ## StateError [src/error.js:35-40][343] **Extends DeviceError** An error reported when an object is not in an appropriate state to perform an operation. ### Parameters - `args` **...any** ## TimeoutError [src/error.js:45-50][344] **Extends DeviceError** Timeout error. ### Parameters - `args` **...any** ## MemoryError [src/error.js:55-60][345] **Extends DeviceError** An error reported when a device has no enough memory to perform an operation. ### Parameters - `args` **...any** ## ProtocolError [src/error.js:65-70][346] **Extends DeviceError** Protocol error. ### Parameters - `args` **...any** ## UsbError [src/error.js:75-80][347] **Extends DeviceError** USB error. ### Parameters - `args` **...any** ## InternalError [src/error.js:85-90][348] **Extends DeviceError** Internal error. ### Parameters - `args` **...any** ## RequestError [src/error.js:95-101][349] **Extends DeviceError** Request error. ### Parameters - `result` - `args` **...any** ## UsbStallError [src/error.js:106-111][350] **Extends UsbError** USB stall error. ### Parameters - `args` **...any** ## DeviceProtectionError [src/error.js:116-122][351] **Extends DeviceError** Device Protection error. ### Parameters - `result` - `args` **...any** ## UnsupportedDfuseCommandError [src/error.js:127-132][352] **Extends DeviceError** An error reported when the issued DfuSe command is not supported by the device. ### Parameters - `args` **...any** ## Gen3Device [src/gen3-device.js:12-32][353] Gen 3 device. This class is not meant to be instantiated directly. Use [getDevices][195] and [openDeviceById][197] to create device instances. ### Parameters - `base` ## LinuxDevice [src/linux-device.js:11-20][354] **Extends DeviceBase** Base class for Linux devices. This class is not meant to be instantiated directly. Use [getDevices][195] and [openDeviceById][197] to create device instances. ### getDeviceMode [src/linux-device.js:17-19][355] Get the device mode. Returns **[Promise][240]<[DeviceMode][286]>** ## NetworkStatus [src/network-device.js:15-18][356] Network status. ## convertInterfaceAddress [src/network-device.js:59-66][357] Converts a given interface IP address into a string ### Parameters - `ifaceAddr` **[object][233]** Object with address and prefixLength keys Returns **[string][223]** address in ${ip}/${prefixLength} format ## convertIpv4Address [src/network-device.js:74-80][358] Converts an IPv4 to a string ### Parameters - `addr` **[object][233]** Object with the IP encoded as int32 in the address key Returns **[string][223]** address in dotted-decimal format ## convertIpv6Address [src/network-device.js:88-94][359] Converts an IPv6 to a string ### Parameters - `addr` **[object][233]** Object with the IP encoded as a buffer in the address key Returns **[string][223]** address in colon-separated format ## NetworkDevice [src/network-device.js:104-256][360] Network device. This class is not meant to be instantiated directly. Use [getDevices][195] and [openDeviceById][197] to create device instances. ### Parameters - `base` ## getDevices [src/particle-usb.js:24-26][361] Enumerate Particle USB devices attached to the host. ### Parameters - `options` **[Object][233]** Options. - `options.types` **[Array][292]<[String][223]>?** Device types (photon, boron, tracker, etc). By default, this function enumerates devices of all platforms supported by the library. - `options.includeDfu` **[Boolean][242]** Whether to include devices in DFU mode. (optional, default `true`) Returns **[Promise][240]<[Array][292]<[Device][362]>>** ## openDeviceById [src/particle-usb.js:35-37][363] Open a Particle USB device with the specified ID. ### Parameters - `id` **[String][223]** Device ID. - `options` **[Object][233]?** Options (see [DeviceBase#open][364]). Returns **[Promise][240]<[Device][362]>** ## openNativeUsbDevice [src/particle-usb.js:46-48][365] Open a Particle USB device from a native browser or node USB device handle ### Parameters - `nativeUsbDevice` **[Object][233]** A WebUSB (browser) or node-usb USB device - `options` **[Object][233]?** Options (see [DeviceBase#open][364]). Returns **[Promise][240]<[Device][362]>** ## getEdlDevices [src/particle-usb.js:55-57][366] Get devices in Qualcomm EDL mode. Returns **[Promise][240]<[Array][292]<EdlDevice>>** ## fromProtobufEnum [src/protobuf-util.js:12-47][367] Get an object that maps values from a Protobuf enum value to a string value and vice versa, using the provided mapping. ### Parameters - `pbEnum` **[Object][233]** Protobuf enum object, imported from @particle/device-os-protobuf - `map` **[Object][233]** Object where the keys are application strings and values are Protobuf strings - `unknownVal` **[String][223]?** Value to return when the Protobuf value is unknown. Defaults to UNKNOWN Returns **Readonly<{fromProtobuf: ((function (any): (any | [string][223])) | any), toProtobuf: (function (any): any)}>** Object with toProtobuf and fromProtobuf functions ## extractBits [src/protobuf-util.js:135-151][368] Checks for each bit in a value and returns an array of strings for each bit that is set ### Parameters - `value` The value to check - `mapping` A mapping created by fromProtobufEnum Returns **[Array][292]<[String][223]>** Array of strings for each bit that is set ## Result [src/result.js:138-141][369] Request result codes. Type: [Number][234] ## messageForResultCode [src/result.js:149-151][370] Return a message for the result code. ### Parameters - `result` **[Number][234]** Result code. Returns **[String][223]** Error message. ## DEVICE_CLASSES [src/set-device-prototype.js:22-47][371] This constant has a structure like this: // photon: klass {}, // electron: klass {}, // p2: klass {}, // ... // } ## setDevicePrototype [src/set-device-prototype.js:58-70][372] Determines the the class and inheritance hierarchy of a Particle USB device based on it's platform characteristics \* ### Parameters - `usbDevice` **any** An object with a .type field that is a string like "p1", "argon", "p2", etc representing the short name of the device platform. Returns **any** an instance of a class like WifiDevice, CellularDevice with the correct inheritance hierachy ## [src/wifi-device-legacy.js:8-8][373] All of the functionality in this class is deprecated. However, it can still be used on Paticle Photon devices running Device OS systems firmware from 0.8.0 to pre 2.0.0. ## WifiAntenna [src/wifi-device-legacy.js:16-20][374] WiFi antenna types. ## WifiSecurity [src/wifi-device-legacy.js:25-33][375] WiFi security types. ## WifiCipher [src/wifi-device-legacy.js:38-42][376] WiFi cipher types. ## EapMethod [src/wifi-device-legacy.js:47-50][377] EAP methods. ## WifiDeviceLegacy [src/wifi-device-legacy.js:91-199][378] Wi-Fi device. This class is not meant to be instantiated directly. Use [getDevices][195] and [openDeviceById][197] to create device instances. ### Parameters - `base` ## WiFiSecurity [src/wifi-device.js:12-20][379] Wi-Fi security types. Type: [String][223] ## WifiDevice [src/wifi-device.js:30-235][380] Wi-Fi device. This class is not meant to be instantiated directly. Use [getDevices][195] and [openDeviceById][197] to create device instances. ### Parameters - `base` [1]: #cellulardevice [2]: #parameters [3]: #cloudconnectionstatus [4]: #disconnected [5]: #connecting [6]: #connected [7]: #disconnecting [8]: #serverprotocol [9]: #tcp [10]: #udp [11]: #clouddevice [12]: #parameters-1 [13]: #config [14]: #parameters-2 [15]: #pollingpolicy [16]: #default [17]: #parameters-3 [18]: #devicebase [19]: #parameters-4 [20]: #open [21]: #parameters-5 [22]: #close [23]: #parameters-6 [24]: #sendcontrolrequest [25]: #parameters-7 [26]: #reset [27]: #isopen [28]: #id [29]: #firmwareversion [30]: #type [31]: #platformid [32]: #vendorid [33]: #productid [34]: #isindfumode [35]: #usbdevice [36]: #quirks [37]: #bootloader [38]: #system_part [39]: #user_part [40]: #mono_firmware [41]: #ncp_firmware [42]: #radio_stack [43]: #firmwaremodule [44]: #firmwaremodulestore [45]: #firmwaremoduledisplaynames [46]: #devicemode [47]: #normal [48]: #listening [49]: #loglevel [50]: #all [51]: #trace [52]: #info [53]: #warn [54]: #error [55]: #none [56]: #device [57]: #getserialnumber [58]: #parameters-8 [59]: #getdeviceid [60]: #parameters-9 [61]: #reset-1 [62]: #parameters-10 [63]: #factoryreset [64]: #parameters-11 [65]: #enterdfumode [66]: #parameters-12 [67]: #entersafemode [68]: #parameters-13 [69]: #enterlisteningmode [70]: #parameters-14 [71]: #leavelisteningmode [72]: #parameters-15 [73]: #getdevicemode [74]: #parameters-16 [75]: #startnyansignal [76]: #parameters-17 [77]: #stopnyansignal [78]: #parameters-18 [79]: #updatefirmware [80]: #parameters-19 [81]: #getfirmwaremodule [82]: #parameters-20 [83]: #getassetinfo [84]: #parameters-21 [85]: #getfirmwaremoduleinfo [86]: #parameters-22 [87]: #hasmodularfirmware [88]: #setfactoryfirmware [89]: #parameters-23 [90]: #getfactoryfirmware [91]: #readconfigdata [92]: #parameters-24 [93]: #writeconfigdata [94]: #parameters-25 [95]: #getconfigdatasize [96]: #readeeprom [97]: #parameters-26 [98]: #writeeeprom [99]: #parameters-27 [100]: #cleareeprom [101]: #geteepromsize [102]: #addloghandler [103]: #parameters-28 [104]: #removeloghandler [105]: #parameters-29 [106]: #getloghandlers [107]: #unprotectdevice [108]: #parameters-30 [109]: #getprotectionstate [110]: #getenv [111]: #properties [112]: #getenv-1 [113]: #properties-1 [114]: #getenv-2 [115]: #clearenv [116]: #properties-2 [117]: #clearenv-1 [118]: #sendprotobufrequest [119]: #parameters-31 [120]: #unprotectdeviceresult [121]: #properties-3 [122]: #getprotectionstateresult [123]: #properties-4 [124]: #sinon [125]: #dfuerror [126]: #parameters-32 [127]: #dfusecommand [128]: #open-1 [129]: #close-1 [130]: #leave [131]: #entersafemode-1 [132]: #clearsecuritymodeoverride [133]: #getprotectionstate-1 [134]: #setaltsetting [135]: #parameters-33 [136]: #dodownload [137]: #parameters-34 [138]: #_senddnloadrequest [139]: #parameters-35 [140]: #_getstatus [141]: #_polluntil [142]: #parameters-36 [143]: #_clearstatus [144]: #_parsememorydescriptor [145]: #parameters-37 [146]: #_dfusecommand [147]: #parameters-38 [148]: #_getsegment [149]: #parameters-39 [150]: #_getsectorstart [151]: #parameters-40 [152]: #_getsectorend [153]: #parameters-41 [154]: #_erase [155]: #parameters-42 [156]: #deviceerror [157]: #parameters-43 [158]: #notfounderror [159]: #parameters-44 [160]: #notallowederror [161]: #parameters-45 [162]: #stateerror [163]: #parameters-46 [164]: #timeouterror [165]: #parameters-47 [166]: #memoryerror [167]: #parameters-48 [168]: #protocolerror [169]: #parameters-49 [170]: #usberror [171]: #parameters-50 [172]: #internalerror [173]: #parameters-51 [174]: #requesterror [175]: #parameters-52 [176]: #usbstallerror [177]: #parameters-53 [178]: #deviceprotectionerror [179]: #parameters-54 [180]: #unsupporteddfusecommanderror [181]: #parameters-55 [182]: #gen3device [183]: #parameters-56 [184]: #linuxdevice [185]: #getdevicemode-1 [186]: #networkstatus [187]: #convertinterfaceaddress [188]: #parameters-57 [189]: #convertipv4address [190]: #parameters-58 [191]: #convertipv6address [192]: #parameters-59 [193]: #networkdevice [194]: #parameters-60 [195]: #getdevices [196]: #parameters-61 [197]: #opendevicebyid [198]: #parameters-62 [199]: #opennativeusbdevice [200]: #parameters-63 [201]: #getedldevices [202]: #fromprotobufenum [203]: #parameters-64 [204]: #extractbits [205]: #parameters-65 [206]: #result [207]: #messageforresultcode [208]: #parameters-66 [209]: #device_classes [210]: #setdeviceprototype [211]: #parameters-67 [212]: #wifiantenna [213]: #wifisecurity [214]: #wificipher [215]: #eapmethod [216]: #wifidevicelegacy [217]: #parameters-68 [218]: #wifisecurity-1 [219]: #wifidevice [220]: #parameters-69 [221]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/cellular-device.js#L13-L71 "Source code on GitHub" [222]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/cloud-device.js#L13-L22 "Source code on GitHub" [223]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String [224]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/cloud-device.js#L15-L15 "Source code on GitHub" [225]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/cloud-device.js#L17-L17 "Source code on GitHub" [226]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/cloud-device.js#L19-L19 "Source code on GitHub" [227]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/cloud-device.js#L21-L21 "Source code on GitHub" [228]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/cloud-device.js#L29-L34 "Source code on GitHub" [229]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/cloud-device.js#L31-L31 "Source code on GitHub" [230]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/cloud-device.js#L33-L33 "Source code on GitHub" [231]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/cloud-device.js#L44-L380 "Source code on GitHub" [232]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/config.js#L31-L33 "Source code on GitHub" [233]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object [234]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number [235]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device-base.js#L58-L61 "Source code on GitHub" [236]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function [237]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device-base.js#L60-L60 "Source code on GitHub" [238]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device-base.js#L86-L751 "Source code on GitHub" [239]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device-base.js#L121-L175 "Source code on GitHub" [240]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise [241]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device-base.js#L187-L216 "Source code on GitHub" [242]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean [243]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device-base.js#L232-L285 "Source code on GitHub" [244]: https://nodejs.org/api/buffer.html [245]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device-base.js#L294-L299 "Source code on GitHub" [246]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device-base.js#L304-L306 "Source code on GitHub" [247]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device-base.js#L313-L315 "Source code on GitHub" [248]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device-base.js#L322-L324 "Source code on GitHub" [249]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device-base.js#L329-L331 "Source code on GitHub" [250]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device-base.js#L336-L338 "Source code on GitHub" [251]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device-base.js#L343-L345 "Source code on GitHub" [252]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device-base.js#L350-L352 "Source code on GitHub" [253]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device-base.js#L357-L359 "Source code on GitHub" [254]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device-base.js#L364-L366 "Source code on GitHub" [255]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device-base.js#L371-L373 "Source code on GitHub" [256]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L14-L14 "Source code on GitHub" [257]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L16-L16 "Source code on GitHub" [258]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L18-L18 "Source code on GitHub" [259]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L20-L20 "Source code on GitHub" [260]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L22-L22 "Source code on GitHub" [261]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L24-L24 "Source code on GitHub" [262]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L32-L43 "Source code on GitHub" [263]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L50-L55 "Source code on GitHub" [264]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L74-L85 "Source code on GitHub" [265]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L92-L97 "Source code on GitHub" [266]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L94-L94 "Source code on GitHub" [267]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L96-L96 "Source code on GitHub" [268]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L104-L117 "Source code on GitHub" [269]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L106-L106 "Source code on GitHub" [270]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L108-L108 "Source code on GitHub" [271]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L110-L110 "Source code on GitHub" [272]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L112-L112 "Source code on GitHub" [273]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L114-L114 "Source code on GitHub" [274]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L116-L116 "Source code on GitHub" [275]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L166-L1273 "Source code on GitHub" [276]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L178-L185 "Source code on GitHub" [277]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L198-L205 "Source code on GitHub" [278]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L225-L239 "Source code on GitHub" [279]: #devicebaseclose [280]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L255-L257 "Source code on GitHub" [281]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L276-L298 "Source code on GitHub" [282]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L315-L320 "Source code on GitHub" [283]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L333-L357 "Source code on GitHub" [284]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L370-L372 "Source code on GitHub" [285]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L385-L388 "Source code on GitHub" [286]: #devicemode [287]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L401-L403 "Source code on GitHub" [288]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L416-L418 "Source code on GitHub" [289]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L433-L460 "Source code on GitHub" [290]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L475-L489 "Source code on GitHub" [291]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L500-L525 "Source code on GitHub" [292]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array [293]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L538-L599 "Source code on GitHub" [294]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L612-L614 "Source code on GitHub" [295]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L628-L635 "Source code on GitHub" [296]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L648-L659 "Source code on GitHub" [297]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L674-L681 "Source code on GitHub" [298]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L696-L703 "Source code on GitHub" [299]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L716-L723 "Source code on GitHub" [300]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L738-L745 "Source code on GitHub" [301]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L760-L767 "Source code on GitHub" [302]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L780-L787 "Source code on GitHub" [303]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L800-L807 "Source code on GitHub" [304]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L824-L879 "Source code on GitHub" [305]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L891-L893 "Source code on GitHub" [306]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L903-L908 "Source code on GitHub" [307]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L928-L980 "Source code on GitHub" [308]: #unprotectdeviceresult [309]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L993-L1004 "Source code on GitHub" [310]: #getprotectionstateresult [311]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L1030-L1044 "Source code on GitHub" [312]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L1061-L1066 "Source code on GitHub" [313]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L1076-L1099 "Source code on GitHub" [314]: #requesterror [315]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L910-L916 "Source code on GitHub" [316]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.js#L982-L986 "Source code on GitHub" [317]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/device.test.js#L7-L7 "Source code on GitHub" [318]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/dfu.js#L26-L31 "Source code on GitHub" [319]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/dfu.js#L129-L137 "Source code on GitHub" [320]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/dfu.js#L168-L176 "Source code on GitHub" [321]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/dfu.js#L183-L187 "Source code on GitHub" [322]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/dfu.js#L194-L205 "Source code on GitHub" [323]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/dfu.js#L212-L219 "Source code on GitHub" [324]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/dfu.js#L226-L230 "Source code on GitHub" [325]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/dfu.js#L238-L259 "Source code on GitHub" [326]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/dfu.js#L267-L302 "Source code on GitHub" [327]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/dfu.js#L315-L386 "Source code on GitHub" [328]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/dfu.js#L426-L434 "Source code on GitHub" [329]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/dfu.js#L463-L499 "Source code on GitHub" [330]: #dfuerror [331]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/dfu.js#L507-L523 "Source code on GitHub" [332]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/dfu.js#L528-L536 "Source code on GitHub" [333]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/dfu.js#L544-L586 "Source code on GitHub" [334]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/dfu.js#L596-L633 "Source code on GitHub" [335]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/dfu.js#L641-L653 "Source code on GitHub" [336]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/dfu.js#L662-L673 "Source code on GitHub" [337]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/dfu.js#L682-L693 "Source code on GitHub" [338]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/dfu.js#L703-L741 "Source code on GitHub" [339]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error [340]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/error.js#L5-L10 "Source code on GitHub" [341]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/error.js#L15-L20 "Source code on GitHub" [342]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/error.js#L25-L30 "Source code on GitHub" [343]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/error.js#L35-L40 "Source code on GitHub" [344]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/error.js#L45-L50 "Source code on GitHub" [345]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/error.js#L55-L60 "Source code on GitHub" [346]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/error.js#L65-L70 "Source code on GitHub" [347]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/error.js#L75-L80 "Source code on GitHub" [348]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/error.js#L85-L90 "Source code on GitHub" [349]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/error.js#L95-L101 "Source code on GitHub" [350]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/error.js#L106-L111 "Source code on GitHub" [351]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/error.js#L116-L122 "Source code on GitHub" [352]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/error.js#L127-L132 "Source code on GitHub" [353]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/gen3-device.js#L12-L32 "Source code on GitHub" [354]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/linux-device.js#L11-L20 "Source code on GitHub" [355]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/linux-device.js#L17-L19 "Source code on GitHub" [356]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/network-device.js#L15-L18 "Source code on GitHub" [357]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/network-device.js#L59-L66 "Source code on GitHub" [358]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/network-device.js#L74-L80 "Source code on GitHub" [359]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/network-device.js#L88-L94 "Source code on GitHub" [360]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/network-device.js#L104-L256 "Source code on GitHub" [361]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/particle-usb.js#L24-L26 "Source code on GitHub" [362]: #device [363]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/particle-usb.js#L35-L37 "Source code on GitHub" [364]: #devicebaseopen [365]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/particle-usb.js#L46-L48 "Source code on GitHub" [366]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/particle-usb.js#L55-L57 "Source code on GitHub" [367]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/protobuf-util.js#L12-L47 "Source code on GitHub" [368]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/protobuf-util.js#L135-L151 "Source code on GitHub" [369]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/result.js#L138-L141 "Source code on GitHub" [370]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/result.js#L149-L151 "Source code on GitHub" [371]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/set-device-prototype.js#L22-L47 "Source code on GitHub" [372]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/set-device-prototype.js#L58-L70 "Source code on GitHub" [373]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/wifi-device-legacy.js#L8-L8 "Source code on GitHub" [374]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/wifi-device-legacy.js#L16-L20 "Source code on GitHub" [375]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/wifi-device-legacy.js#L25-L33 "Source code on GitHub" [376]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/wifi-device-legacy.js#L38-L42 "Source code on GitHub" [377]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/wifi-device-legacy.js#L47-L50 "Source code on GitHub" [378]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/wifi-device-legacy.js#L91-L199 "Source code on GitHub" [379]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/wifi-device.js#L12-L20 "Source code on GitHub" [380]: https://github.com/particle-iot/particle-usb/blob/08dfd40b745cd59b49a65ba40021846e619f61f6/src/wifi-device.js#L30-L235 "Source code on GitHub"