Skip to content

Commit

Permalink
Allow changing ip
Browse files Browse the repository at this point in the history
  • Loading branch information
nab138 committed May 12, 2024
1 parent 26496a7 commit 03e442e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/GestureRecognizers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ extension RootViewController {
NSLog("Disconnected from NetworkTables, reason: \(reason), code: \(code)")
})
self.NTClient.connect()
self.NTClient.subscribe(key: "/SmartDashboard/Field/Robot", periodic: 0.001)
}))
self.present(alert, animated: true, completion: nil)
}
Expand Down
6 changes: 3 additions & 3 deletions src/NetworkTables/NT4Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,11 @@ class NT4Client: WebSocketDelegate {
}

private func handleMsgPackMessage(msg: [Any?]){
NSLog("Type of msg[3]: \(type(of: msg[3]!))")
NSLog("Type of msg[1]: \(type(of: msg[1]!))")

guard let unsignedTimestamp = msg[1]! as? UInt32 else {
let unsignedTimestamp = (msg[1] as? UInt32) ?? 0
if unsignedTimestamp == 0 {
NSLog("Failed to decode timestamp")
return
}
let timestamp = Int64(unsignedTimestamp)
let data = msg[3]!
Expand Down

0 comments on commit 03e442e

Please sign in to comment.