add model option to bambu ssdp broadcast
This commit is contained in:
parent
cc8bca0993
commit
a678925d42
1 changed files with 6 additions and 5 deletions
|
|
@ -11,9 +11,9 @@
|
||||||
|
|
||||||
let args = process.argv.slice(2);
|
let args = process.argv.slice(2);
|
||||||
|
|
||||||
if (args.length % 3 !== 0) {
|
if (args.length % 4 !== 0) {
|
||||||
console.log([
|
console.log([
|
||||||
'usage: ssdp [name] [host] [serial-no]',
|
'usage: ssdp [name] [host] [serial-no] [model]',
|
||||||
'where:',
|
'where:',
|
||||||
' name = name of printer to appear in slicer',
|
' name = name of printer to appear in slicer',
|
||||||
' host = host name or IP address of printer',
|
' host = host name or IP address of printer',
|
||||||
|
|
@ -39,14 +39,15 @@ socket.bind(1900, () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
while (args.length) {
|
while (args.length) {
|
||||||
const [name, host, serial] = args;
|
const [name, host, serial, model] = args;
|
||||||
args = args.slice(3);
|
args = args.slice(4);
|
||||||
|
|
||||||
console.log([
|
console.log([
|
||||||
`Broadcasting Bambu Printer`,
|
`Broadcasting Bambu Printer`,
|
||||||
`Name: ${name}`,
|
`Name: ${name}`,
|
||||||
`Host: ${host}`,
|
`Host: ${host}`,
|
||||||
`Serial: ${serial}`,
|
`Serial: ${serial}`,
|
||||||
|
`Model: ${model}`,
|
||||||
].join('\n'));
|
].join('\n'));
|
||||||
|
|
||||||
// SSDP discovery message
|
// SSDP discovery message
|
||||||
|
|
@ -58,7 +59,7 @@ while (args.length) {
|
||||||
NT: urn:bambulab-com:device:3dprinter:1
|
NT: urn:bambulab-com:device:3dprinter:1
|
||||||
USN: ${serial}
|
USN: ${serial}
|
||||||
Cache-Control: max-age=1800
|
Cache-Control: max-age=1800
|
||||||
DevModel.bambu.com: C11
|
DevModel.bambu.com: ${model}
|
||||||
DevName.bambu.com: ${name}
|
DevName.bambu.com: ${name}
|
||||||
DevSignal.bambu.com: -66
|
DevSignal.bambu.com: -66
|
||||||
DevConnect.bambu.com: lan
|
DevConnect.bambu.com: lan
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue