mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Linting fixes
This commit is contained in:
parent
d45034cb64
commit
f4bcad2c68
6 changed files with 13 additions and 18 deletions
|
|
@ -158,7 +158,7 @@ extension UserDefaults {
|
|||
|
||||
@UserDefault(.firmwareVersion, defaultValue: "0.0.0")
|
||||
static var firmwareVersion: String
|
||||
|
||||
|
||||
@UserDefault(.environmentEnableWeatherKit, defaultValue: true)
|
||||
static var environmentEnableWeatherKit: Bool
|
||||
|
||||
|
|
|
|||
|
|
@ -590,7 +590,7 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate
|
|||
return
|
||||
}
|
||||
do {
|
||||
let logRecord = try LogRecord(serializedData: characteristic.value!)
|
||||
let logRecord = try LogRecord(serializedBytes: characteristic.value!)
|
||||
var message = logRecord.source.isEmpty ? logRecord.message : "[\(logRecord.source)] \(logRecord.message)"
|
||||
switch logRecord.level {
|
||||
case .debug:
|
||||
|
|
@ -627,7 +627,7 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate
|
|||
var decodedInfo = FromRadio()
|
||||
|
||||
do {
|
||||
decodedInfo = try FromRadio(serializedData: characteristic.value!)
|
||||
decodedInfo = try FromRadio(serializedBytes: characteristic.value!)
|
||||
|
||||
} catch {
|
||||
Logger.services.error("💥 \(error.localizedDescription, privacy: .public) \(characteristic.value!, privacy: .public)")
|
||||
|
|
@ -870,7 +870,7 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate
|
|||
}
|
||||
}
|
||||
case .neighborinfoApp:
|
||||
if let neighborInfo = try? NeighborInfo(serializedData: decodedInfo.packet.decoded.payload) {
|
||||
if let neighborInfo = try? NeighborInfo(serializedBytes: decodedInfo.packet.decoded.payload) {
|
||||
// MeshLogger.log("🕸️ MESH PACKET received for Neighbor Info App UNHANDLED")
|
||||
MeshLogger.log("🕸️ MESH PACKET received for Neighbor Info App UNHANDLED \(neighborInfo)")
|
||||
}
|
||||
|
|
@ -902,7 +902,7 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate
|
|||
let fetchNodeInfoRequest = NodeInfoEntity.fetchRequest()
|
||||
fetchNodeInfoRequest.predicate = NSPredicate(format: "num == %lld", Int64(connectedPeripheral.num))
|
||||
do {
|
||||
let fetchedNodeInfo = try context.fetch(fetchNodeInfoRequest) ?? []
|
||||
let fetchedNodeInfo = try context.fetch(fetchNodeInfoRequest)
|
||||
if fetchedNodeInfo.count == 1 {
|
||||
// Subscribe to Mqtt Client Proxy if enabled
|
||||
if fetchedNodeInfo[0].mqttConfig != nil && fetchedNodeInfo[0].mqttConfig?.enabled ?? false && fetchedNodeInfo[0].mqttConfig?.proxyToClientEnabled ?? false {
|
||||
|
|
@ -1132,7 +1132,7 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate
|
|||
return success
|
||||
}
|
||||
|
||||
@MainActor
|
||||
@MainActor
|
||||
public func getPositionFromPhoneGPS(destNum: Int64) -> Position? {
|
||||
var positionPacket = Position()
|
||||
if #available(iOS 17.0, macOS 14.0, *) {
|
||||
|
|
@ -1265,7 +1265,6 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate
|
|||
}
|
||||
if connectedPeripheral?.peripheral.state ?? CBPeripheralState.disconnected == CBPeripheralState.connected {
|
||||
connectedPeripheral.peripheral.writeValue(binaryData, for: TORADIO_characteristic, type: .withResponse)
|
||||
|
||||
let logString = String.localizedStringWithFormat("mesh.log.sharelocation %@".localized, String(fromNodeNum))
|
||||
Logger.services.debug("📍 \(logString)")
|
||||
return true
|
||||
|
|
@ -1516,14 +1515,14 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate
|
|||
let decodedString = base64UrlString.base64urlToBase64()
|
||||
if let decodedData = Data(base64Encoded: decodedString) {
|
||||
do {
|
||||
let channelSet: ChannelSet = try ChannelSet(serializedData: decodedData)
|
||||
let channelSet: ChannelSet = try ChannelSet(serializedBytes: decodedData)
|
||||
for cs in channelSet.settings {
|
||||
if addChannels {
|
||||
// We are trying to add a channel so lets get the last index
|
||||
let fetchMyInfoRequest = MyInfoEntity.fetchRequest()
|
||||
fetchMyInfoRequest.predicate = NSPredicate(format: "myNodeNum == %lld", Int64(connectedPeripheral.num))
|
||||
do {
|
||||
let fetchedMyInfo = try context.fetch(fetchMyInfoRequest) ?? []
|
||||
let fetchedMyInfo = try context.fetch(fetchMyInfoRequest)
|
||||
if fetchedMyInfo.count == 1 {
|
||||
i = Int32(fetchedMyInfo[0].channels?.count ?? -1)
|
||||
myInfo = fetchedMyInfo[0]
|
||||
|
|
@ -3001,7 +3000,7 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate
|
|||
}
|
||||
|
||||
func storeAndForwardPacket(packet: MeshPacket, connectedNodeNum: Int64, context: NSManagedObjectContext) {
|
||||
if let storeAndForwardMessage = try? StoreAndForward(serializedData: packet.decoded.payload) {
|
||||
if let storeAndForwardMessage = try? StoreAndForward(serializedBytes: packet.decoded.payload) {
|
||||
// Handle each of the store and forward request / response messages
|
||||
switch storeAndForwardMessage.rr {
|
||||
case .unset:
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ struct MapViewSwiftUI: UIViewRepresentable {
|
|||
overlay.minimumZ = UserDefaults.mapTileServer.zoomRange.startIndex
|
||||
overlay.maximumZ = UserDefaults.mapTileServer.zoomRange.endIndex
|
||||
mapView.addOverlay(overlay, level: UserDefaults.mapTilesAboveLabels ? .aboveLabels : .aboveRoads)
|
||||
|
||||
|
||||
case .satellite:
|
||||
mapView.mapType = .satellite
|
||||
case .hybrid:
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ struct UserMessageList: View {
|
|||
@EnvironmentObject var appState: AppState
|
||||
@EnvironmentObject var bleManager: BLEManager
|
||||
@Environment(\.managedObjectContext) var context
|
||||
|
||||
|
||||
// Keyboard State
|
||||
@FocusState var messageFieldFocused: Bool
|
||||
// View State Items
|
||||
|
|
|
|||
|
|
@ -3,16 +3,12 @@ import OSLog
|
|||
import SwiftUI
|
||||
|
||||
struct DeleteNodeButton: View {
|
||||
|
||||
var bleManager: BLEManager
|
||||
|
||||
var context: NSManagedObjectContext
|
||||
|
||||
var connectedNode: NodeInfoEntity
|
||||
|
||||
var node: NodeInfoEntity
|
||||
|
||||
@Environment(\.dismiss) private var dismiss
|
||||
|
||||
@State private var isPresentingAlert = false
|
||||
|
||||
var body: some View {
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ struct MeshMap: View {
|
|||
}
|
||||
.onChange(of: router.navigationState) {
|
||||
guard case .map(let selectedNodeNum) = router.navigationState else { return }
|
||||
//TODO: handle deep link for waypoints
|
||||
// TODO: handle deep link for waypoints
|
||||
}
|
||||
.onChange(of: (selectedMapLayer)) { newMapLayer in
|
||||
switch selectedMapLayer {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue