Channel editor updates

This commit is contained in:
Garth Vander Houwen 2023-01-08 18:36:35 -08:00
parent 630986487c
commit 5b56125628
3 changed files with 7 additions and 3 deletions

View file

@ -978,7 +978,6 @@ class BLEManager: NSObject, CBPeripheralDelegate, ObservableObject {
meshPacket.from = 0 //UInt32(fromUser.num)
meshPacket.id = UInt32.random(in: UInt32(UInt8.max)..<UInt32.max)
meshPacket.priority = MeshPacket.Priority.reliable
meshPacket.wantAck = true
var dataMessage = DataMessage()
dataMessage.payload = try! adminPacket.serializedData()

View file

@ -1025,7 +1025,11 @@ func adminAppPacket (packet: MeshPacket, context: NSManagedObjectContext) {
}
else if adminMessage.payloadVariant == AdminMessage.OneOf_PayloadVariant.getChannelResponse(adminMessage.getChannelResponse) {
print("I am a channel response")
if let channel = try? Channel(serializedData: packet.decoded.payload) {
print("got a channel over the admin channel")
//channelPacket(channel: channel, fromNum: Int64(packet.from), context: context)
}
}
}

View file

@ -257,7 +257,8 @@ struct Channels: View {
self.isPresentingEditView = false
channelName = ""
hasChanges = false
// Would rather send a getChannel but I can't seem to tell what admin message it is
// Would rather send a getChannel but I can't seem serialize it properly yet
//bleManager.getChannel(channel: channel, fromUser: node!.user!, toUser: node!.user!)
bleManager.sendWantConfig()
}
} label: {