You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// The message that should be sent at the end of the connection initiation. The connection initiation is the sequence of packets that is sent at the very beginning of a connection and they contain messages that represent the state of the device at the moment of conection.
@@ -298,3 +307,125 @@ public struct TransitionPositionChanged: Serializable {
298
307
299
308
publicvardebugDescription:String{return"Change transition position of ME\(mixEffect+1) to \(position)"}
300
309
}
310
+
311
+
publicstructLockRequest:Serializable{
312
+
publicstaticvartitle=MessageTitle(string:"LOCK")
313
+
publicletstore:UInt16
314
+
publicletstate:UInt16
315
+
316
+
publicinit(with bytes:ArraySlice<UInt8>)throws{
317
+
store =UInt16(from: bytes)
318
+
state =UInt16(from:bytes[relative:2..<4])
319
+
}
320
+
321
+
publicvardebugDescription:String{return"Lock store \(store) to \(String(state, radix:16))"}
322
+
323
+
publicvardataBytes:[UInt8]{
324
+
return store.bytes + state.bytes
325
+
}
326
+
}
327
+
328
+
publicstructLockPositionRequest:Message{
329
+
publicstaticvartitle=MessageTitle(string:"PLCK")
330
+
publicletstore:UInt16
331
+
publicletindex:UInt16
332
+
publiclettype:UInt16
333
+
334
+
publicinit(with bytes:ArraySlice<UInt8>)throws{
335
+
store =UInt16(from: bytes)
336
+
index =UInt16(from:bytes[relative:2..<4])
337
+
type =UInt16(from:bytes[relative:4..<6])
338
+
print(bytes)
339
+
}
340
+
341
+
publicvardebugDescription:String{return"Lock request \(store): for index \(index), type \(type)"}
342
+
}
343
+
344
+
publicstructLockChange:Serializable{
345
+
publicstaticvartitle=MessageTitle(string:"LKST")
346
+
publicletstore:UInt16
347
+
publicletisLocked:Bool
348
+
349
+
publicinit(with bytes:ArraySlice<UInt8>)throws{
350
+
store =.init(from: bytes)
351
+
isLocked =bytes[relative:2]==1
352
+
}
353
+
354
+
publicinit(store:UInt16, isLocked:Bool){
355
+
self.store = store
356
+
self.isLocked = isLocked
357
+
}
358
+
359
+
publicvardataBytes:[UInt8]{
360
+
return store.bytes +[isLocked ?1:0,0]
361
+
}
362
+
363
+
publicvardebugDescription:String{return"Lock for store \(store) is \(isLocked ?"established":"released")"}
0 commit comments