This PR introduces the ability to interact with Device OS via USB control requests even if the there isn't a corresponding high level method in particle-usb. For example, Device OS exposes a wifi.JoinNewNetworkRequest protobuf message, but it cannot be used because there is no corresponding high level method like joinNewWifiNetwork() implemented yet on particle-usb. In this situation, with this code, you can interact directly via the new sendProtobufRequest if need to.
Change summary
device.sendProtobufRequest() introduced
getSerialNumber implementation uses sendProtobufRequest under the hood. no longer depends on sendRequest
Test coverage for getSerialNumber and different mocking strategy that will allow us to add test coverage for all other high level methods like it. (device.js test coverage goes from 11% to 15%)
Utilizes the newly shipped device-os-protobuf@1.1.0 npm module; see release. this will allow elimination of the ctrl request id to message names that request.js implements and the git submodule to device-os-protobuf
Overview
This PR introduces the ability to interact with Device OS via USB control requests even if the there isn't a corresponding high level method in
particle-usb
. For example, Device OS exposes awifi.JoinNewNetworkRequest
protobuf message, but it cannot be used because there is no corresponding high level method likejoinNewWifiNetwork()
implemented yet onparticle-usb
. In this situation, with this code, you can interact directly via the newsendProtobufRequest
if need to.Change summary
device.sendProtobufRequest()
introducedgetSerialNumber
implementation usessendProtobufRequest
under the hood. no longer depends onsendRequest
getSerialNumber
and different mocking strategy that will allow us to add test coverage for all other high level methods like it. (device.js test coverage goes from 11% to 15%)request.js
implements and the git submodule todevice-os-protobuf
See sc-95109 for more context/details.
Script used to validate photon, p1, boron enterListeningMode still works
out of scope
This PR is deliberately small. Hoping to align, address feedback, merge on this first, then pursue this work in other PRs:
git submodule
tofirmware-protobuf
, etc sc-95947