Skip to content

Commit

Permalink
Merge pull request #579 from particle-iot/feature/ch44595/asset-tracker
Browse files Browse the repository at this point in the history
feature/ch44595/asset-tracker
  • Loading branch information
busticated authored May 4, 2020
2 parents f6a8b1d + b87e2d0 commit c302784
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 51 deletions.
6 changes: 3 additions & 3 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
}
],
"dependencies": {
"binary-version-reader": "^0.7.4",
"binary-version-reader": "^0.8.2",
"chalk": "^2.4.2",
"cli-spinner": "^0.2.10",
"cli-table": "^0.3.1",
Expand Down
1 change: 1 addition & 0 deletions settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ var settings = {
23: 'B SoM',
24: 'X SoM',
25: 'B5 SoM',
26: 'Asset Tracker',
88: 'Duo',
103: 'Bluz'
},
Expand Down
1 change: 1 addition & 0 deletions src/cmd/cloud.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const PLATFORMS = extend(utilities.knownPlatforms(), {
'b-series': 23,
'x-series': 24,
'b5som': 25,
'tracker': 26,
'o': 82,
'd': 88,
'bl': 103,
Expand Down
1 change: 1 addition & 0 deletions src/cmd/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module.exports.platformsById = {
23: 'B SoM',
24: 'X SoM',
25: 'B5 SoM',
26: 'Asset Tracker',
31: 'Raspberry Pi',
88: 'Duo',
103: 'Bluz'
Expand Down
4 changes: 1 addition & 3 deletions src/cmd/serial.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,11 @@ module.exports = class SerialCommand {
}
const vid = deviceSpec.serial.vid;
const pid = deviceSpec.serial.pid;
const serialNumber = deviceSpec.serial.serialNumber;

const usbMatches = (port.vendorId === vid.toLowerCase() && port.productId === pid.toLowerCase());
const pnpMatches = !!(port.pnpId && (port.pnpId.indexOf('VID_' + vid.toUpperCase()) >= 0) && (port.pnpId.indexOf('PID_' + pid.toUpperCase()) >= 0));
const serialNumberMatches = port.serialNumber && port.serialNumber.indexOf(serialNumber) >= 0;

return !!(usbMatches || pnpMatches || serialNumberMatches);
return !!(usbMatches || pnpMatches);

});

Expand Down
117 changes: 73 additions & 44 deletions src/lib/deviceSpecs/specifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ const specs = {
serial: {
vid: '1d50',
pid: '607d',
serialNumber: 'Spark_Core',
deviceId: deviceIdFromSerialNumber
},
defaultProtocol: 'tcp',
Expand Down Expand Up @@ -123,7 +122,6 @@ const specs = {
serial: {
vid: '2b04',
pid: 'c006',
serialNumber: 'Particle_Photon',
deviceId: deviceIdFromSerialNumber
},
defaultProtocol: 'tcp',
Expand Down Expand Up @@ -201,7 +199,6 @@ const specs = {
serial: {
vid: '2b04',
pid: 'c008',
serialNumber: 'Particle_P1',
deviceId: deviceIdFromSerialNumber
},
defaultProtocol: 'tcp',
Expand Down Expand Up @@ -287,7 +284,6 @@ const specs = {
serial: {
vid: '2b04',
pid: 'c00a',
serialNumber: 'Particle_Electron',
deviceId: deviceIdFromSerialNumber
},
defaultProtocol: 'udp',
Expand Down Expand Up @@ -337,8 +333,7 @@ const specs = {
},
serial: {
vid: '2b04',
pid: 'c058',
serialNumber: 'RedBear_Duo'
pid: 'c058'
},
defaultProtocol: 'tcp',
productId: 88,
Expand Down Expand Up @@ -407,8 +402,7 @@ const specs = {
},
serial: {
vid: '2b04',
pid: 'c00c',
serialNumber: 'Particle_Argon'
pid: 'c00c'
},
defaultProtocol: 'udp',
productId: 12,
Expand Down Expand Up @@ -473,8 +467,7 @@ const specs = {
},
serial: {
vid: '2b04',
pid: 'c016',
serialNumber: 'Particle_Argon'
pid: 'c016'
},
defaultProtocol: 'udp',
productId: 22,
Expand Down Expand Up @@ -540,8 +533,7 @@ const specs = {
},
serial: {
vid: '2b04',
pid: 'c00d',
serialNumber: 'Particle_Boron'
pid: 'c00d'
},
defaultProtocol: 'udp',
productId: 13,
Expand Down Expand Up @@ -606,8 +598,7 @@ const specs = {
},
serial: {
vid: '2b04',
pid: 'c017',
serialNumber: 'Particle_Boron'
pid: 'c017'
},
defaultProtocol: 'udp',
productId: 23,
Expand Down Expand Up @@ -673,8 +664,7 @@ const specs = {
},
serial: {
vid: '2b04',
pid: 'c00e',
serialNumber: 'Particle_Xenon'
pid: 'c00e'
},
defaultProtocol: 'udp',
productId: 14,
Expand Down Expand Up @@ -739,8 +729,7 @@ const specs = {
},
serial: {
vid: '2b04',
pid: 'c018',
serialNumber: 'Particle_Xenon'
pid: 'c018'
},
defaultProtocol: 'udp',
productId: 24,
Expand Down Expand Up @@ -806,11 +795,75 @@ const specs = {
},
serial: {
vid: '2b04',
pid: 'c019',
serialNumber: 'Particle_B_SoM'
pid: 'c019'
},
defaultProtocol: 'udp',
productId: 25,
},
'2b04:d01a': {
productName: 'Asset Tracker',
tcpServerKey: {
address: '2082',
size: 512,
format: 'der',
alt: '1',
alg: 'rsa',
addressOffset: 384,
portOffset: 450
},
udpServerKey: {
address: '3298',
size: 320,
format: 'der',
alt: '1',
alg: 'ec',
variant: 'gen3',
addressOffset: 192,
portOffset: 258
},
tcpPrivateKey: {
address: '34',
size: 612,
format: 'der',
alt: '1',
alg: 'rsa'
},
udpPrivateKey: {
address: '3106',
size: 192,
format: 'der',
alt: '1',
alg: 'ec'
},
userFirmware: {
address: '0x000D4000',
alt: '0'
},
systemFirmwareOne: {
address: '0x00030000',
alt: '0'
},
otaRegion: {
address: '0x80289000',
alt: '2'
},
otaFlag: {
address: '1753',
alt: '1',
size: '1'
},
radioStack: {
address: '0x00001000',
alt: '0'
},
knownApps: {
},
serial: {
vid: '2b04',
pid: 'c01a'
},
defaultProtocol: 'udp',
productId: 26,
}
};

Expand All @@ -825,27 +878,3 @@ Object.keys(specs).forEach((id) => {

module.exports = specs;

// device spec "model"
// key: "vendor:device" ID
// var model = {
// tcpServerKey: {
// address: String,
// size: String,
// format: String,
// alt: String
// },
// tcpPrivateKey: {
// address: String,
// size: String,
// format: String,
// alt: String
// },
// factoryReset: {
// address: String,
// alt: String
// },
// userFirmware: {
// address: String,
// alt: String
// }
// };
1 change: 1 addition & 0 deletions src/lib/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ module.exports = {
'bsom': 23,
'xsom': 24,
'b5som': 25,
'tracker': 26,
'oak': 82,
'duo': 88,
'bluz': 103,
Expand Down

0 comments on commit c302784

Please sign in to comment.