I am wondering if anyone knows of a way to use the CLI to determine the platform type. Let’s say you connect a Boron to the USB port. Is there a way to know it’s a Boron? And then let’s say you connect a P2 to the USB port. Is there a way to know if its a P2 using the CLI?
I am looking at a way to automate our programming based on the platform type.
You can try particle serial identify.
But even without CLI you can find out via the USB VID/PID combination.
Vendor ID 2B04 stands for Particle and Product ID C0xy denotes the product where xy reflects the hex value of platform ID as found here (e.g. C006 indicates a Photon, C00D would be Boron)
The types are only given if I have 2 or more devices connected at a time to only select as options. When I select a device as an option I get the below.
If I only have one device connected I also get the below.
That’s odd. Maybe particle serial inspect will work better.
Alternatively you could go with my other suggestion and let Windows tell you what it knows about the attached devices. For this you won’t even need to put the device into a particular mode as it will list the USB endpoints provided by Particle devices.
wmic path CIM_LogicalDevice where "DeviceID like 'USB\\VID_2B04%'" get DeviceID, Name
(giving you multiple responses for one device - you can refine the where clause tho’)