particle-iot / particle-cli

Command Line Interface for Particle Cloud and devices
Apache License 2.0
212 stars 92 forks source link

Compile doesn't allow specifying platform ID #15

Closed suda closed 9 years ago

suda commented 9 years ago

compile command should take an optional deviceID, platformID and productID parameters and pass them to the API.

m-mcgowan commented 9 years ago

We can also infer the connected device from the USB VID/PID.

pkourany commented 9 years ago

@m-mcgowan, what if the device is not connected? Having an explicit command is important IMO.

kennethlimcp commented 9 years ago

There are many ways to go do this:

pkourany commented 9 years ago

Ken, I agree with everything you said!

m-mcgowan commented 9 years ago

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. :-) )

kennethlimcp commented 9 years ago

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 :)

pkourany commented 9 years ago

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.

kennethlimcp commented 9 years ago

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.

pkourany commented 9 years ago

Ken, 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.

dmiddlecamp commented 9 years ago

you can compile and flash in one command, "compile" and "flash" take the same general arguments, just one has a target device

kennethlimcp commented 9 years ago

@emilyrose, can be closed with https://github.com/spark/particle-cli/commit/659fc2ca9594f17add5b83f93be6105b80a12186

KarbonDallas commented 9 years ago

thanks, @kennethlimcp!