Meshtastic-Apple/Meshtastic/Model/PeripheralModel.swift

37 lines
1 KiB
Swift
Raw Normal View History

import Foundation
import CoreBluetooth
2021-10-14 20:36:06 -07:00
struct Peripheral: Identifiable {
2021-11-16 10:14:20 -08:00
var id: String
var num: Int64
2021-11-16 10:14:20 -08:00
var name: String
2021-12-16 14:13:54 -08:00
var shortName: String
var longName: String
var lastFourCode: String
2021-12-15 23:53:45 -08:00
var firmwareVersion: String
2021-11-16 10:14:20 -08:00
var rssi: Int
var bitrate: Float?
var channelUtilization: Float?
var airTime: Float?
2022-03-04 04:16:45 -08:00
var lastUpdate: Date
2021-11-16 10:14:20 -08:00
var subscribed: Bool
var peripheral: CBPeripheral
2021-11-29 15:59:06 -08:00
init(id: String, num: Int64, name: String, shortName: String, longName: String, lastFourCode: String, firmwareVersion: String, rssi: Int, bitrate: Float?, channelUtilization: Float?, airTime: Float?, lastUpdate: Date, subscribed: Bool, peripheral: CBPeripheral) {
2021-11-16 10:14:20 -08:00
self.id = id
self.num = num
2021-11-16 10:14:20 -08:00
self.name = name
2021-12-16 14:13:54 -08:00
self.shortName = shortName
self.longName = longName
self.lastFourCode = lastFourCode
2021-12-15 23:53:45 -08:00
self.firmwareVersion = firmwareVersion
2021-11-16 10:14:20 -08:00
self.rssi = rssi
self.bitrate = bitrate
self.channelUtilization = channelUtilization
self.airTime = airTime
2022-03-04 04:16:45 -08:00
self.lastUpdate = lastUpdate
2021-11-16 10:14:20 -08:00
self.subscribed = subscribed
self.peripheral = peripheral
}
}