Closed suda closed 9 years ago
We can also infer the connected device from the USB VID/PID.
@m-mcgowan, what if the device is not connected? Having an explicit command is important IMO.
There are many ways to go do this:
particle compile --photon xxxxx
particle compile --core xxx
particle compile my_photon xxx
or particle compile oh_yeah_white_core xxx
Ken, I agree with everything you said!
and that particle compile xxx
should fail if it can't autodetect from the connected device, since no other means of knowing the target was given.
(Paul, please note I did say 'also' above - not suggesting that autodetection is the only way. :-) )
Thinking of a particle compile device_type xxxxx
for now without USB detection. Thoughts?
detection is cool but still requires a Y/n
response in case the user wants to compile for other platform and that will quickly become a tedious hit enter
or no
chore. We can always add that later :)
From my own experience, I often just want to test compile and not flash so not having a connected device is common IMO. When a target is specified for flashing, that's when it should fail when type and actual target don't match.
currently, compile
and flash
are 2 separate commands and there's no coupling for what you mentioned: "When a target is specified for flashing, that's when it should fail when type and actual target don't match."
If you do a OTA Flash, the device name/id you use will tell the :cloud: which platform to compile for.
If you do a compile which returns a .bin
, we need to specify which platform like:
particle compile core xxx
So my proposal fix is:
particle compile DEVICE_TYPE xxxxx
and/or particle compile DEVICE_NAME xxx
+ particle compile DEVICE_ID xxx
The later 2 is more cubersome as device_id
is so long and both requires you to remember them. You would already know which device you want to compile for and get back a .bin
eg.
particle compile photon/core/electron tinker.ino
particle compile tinker.ino
--> errorparticle compile p xxx
--> target photonparticle compile c xxx
---> target coreparticle compile e xxx
--> target electronKen, I thought you could compile and flash in one command (I never used it so it was a guess on my part!). Glad you clarified! In regards to the other stuff, you agree completely.
Paul Kourany, P.Eng., PMP, ITIL IT Worx Services President
On Fri, Jun 12, 2015 at 12:33 PM, Kenneth Lim notifications@github.com wrote:
currently, compile and flash are 2 separate commands and there's no coupling for what you mentioned: "When a target is specified for flashing, that's when it should fail when type and actual target don't match."
If you do a OTA Flash, the device name/id you use will tell the [image: :cloud:] which platform to compile for.
If you do a compile which returns a .bin, we need to specify which platform like:
particle compile core xxx
— Reply to this email directly or view it on GitHub https://github.com/spark/particle-cli/issues/15#issuecomment-111549357.
you can compile and flash in one command, "compile" and "flash" take the same general arguments, just one has a target device
@emilyrose, can be closed with https://github.com/spark/particle-cli/commit/659fc2ca9594f17add5b83f93be6105b80a12186
thanks, @kennethlimcp!
compile
command should take an optionaldeviceID
,platformID
andproductID
parameters and pass them to the API.