mirror of
https://github.com/jwetzell/acn-js.git
synced 2026-09-10 07:49:26 +00:00
add sdt connect, connect accept, connect refuse data decoding
This commit is contained in:
@@ -17,9 +17,9 @@ not sure how far I will take this but messing around with E1.17 ACN protocol
|
|||||||
- [x] ACK
|
- [x] ACK
|
||||||
- [ ] CHANNEL_PARAMS
|
- [ ] CHANNEL_PARAMS
|
||||||
- [ ] LEAVE
|
- [ ] LEAVE
|
||||||
- [ ] CONNECT
|
- [x] CONNECT
|
||||||
- [ ] CONNECT_ACCEPT
|
- [x] CONNECT_ACCEPT
|
||||||
- [ ] CONNECT_REFUSE
|
- [x] CONNECT_REFUSE
|
||||||
- [ ] DISCONNECT
|
- [ ] DISCONNECT
|
||||||
- [ ] DISCONNECTING
|
- [ ] DISCONNECTING
|
||||||
- dmp
|
- dmp
|
||||||
|
|||||||
@@ -120,6 +120,16 @@ export type SDTNakData = {
|
|||||||
lastMissedSequence: number;
|
lastMissedSequence: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type SDTConnectData = {
|
||||||
|
protocolID: number;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type SDTConnectAcceptData = SDTConnectData;
|
||||||
|
export type SDTConnectRefuseData = {
|
||||||
|
protocolID: number;
|
||||||
|
refuseCode: number;
|
||||||
|
};
|
||||||
|
|
||||||
export type SDTGetSessionsData = {
|
export type SDTGetSessionsData = {
|
||||||
componentID: string;
|
componentID: string;
|
||||||
};
|
};
|
||||||
@@ -136,6 +146,9 @@ export type SessionDataTransportPDU = {
|
|||||||
| SDTLeavingData
|
| SDTLeavingData
|
||||||
| SDTGetSessionsData
|
| SDTGetSessionsData
|
||||||
| SDTNakData
|
| SDTNakData
|
||||||
|
| SDTConnectData
|
||||||
|
| SDTConnectAcceptData
|
||||||
|
| SDTConnectRefuseData
|
||||||
| Uint8Array;
|
| Uint8Array;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
import {
|
import {
|
||||||
Protocols,
|
Protocols,
|
||||||
SDTAckData,
|
SDTAckData,
|
||||||
|
SDTConnectAcceptData,
|
||||||
|
SDTConnectData,
|
||||||
|
SDTConnectRefuseData,
|
||||||
SDTGetSessionsData,
|
SDTGetSessionsData,
|
||||||
SDTJoinAcceptData,
|
SDTJoinAcceptData,
|
||||||
SDTJoinData,
|
SDTJoinData,
|
||||||
@@ -135,6 +138,9 @@ function decodeData(
|
|||||||
| SDTLeavingData
|
| SDTLeavingData
|
||||||
| SDTGetSessionsData
|
| SDTGetSessionsData
|
||||||
| SDTNakData
|
| SDTNakData
|
||||||
|
| SDTConnectData
|
||||||
|
| SDTConnectAcceptData
|
||||||
|
| SDTConnectRefuseData
|
||||||
| Uint8Array {
|
| Uint8Array {
|
||||||
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
||||||
switch (vector) {
|
switch (vector) {
|
||||||
@@ -235,6 +241,18 @@ function decodeData(
|
|||||||
lastMissedSequence: view.getUint32(28),
|
lastMissedSequence: view.getUint32(28),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
case SessionDataTransportVectors.CONNECT:
|
||||||
|
case SessionDataTransportVectors.CONNECT_ACCEPT: {
|
||||||
|
return {
|
||||||
|
protocolID: view.getUint32(0),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
case SessionDataTransportVectors.CONNECT_REFUSE: {
|
||||||
|
return {
|
||||||
|
protocolID: view.getUint32(0),
|
||||||
|
refuseCode: view.getUint8(4),
|
||||||
|
};
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
console.error(`unhandled SDT vector: ${vector}`);
|
console.error(`unhandled SDT vector: ${vector}`);
|
||||||
return bytes;
|
return bytes;
|
||||||
|
|||||||
Reference in New Issue
Block a user