Meshtastic-Apple/MeshtasticClient/Helpers/ChannelHelper.swift

27 lines
635 B
Swift
Raw Normal View History

2022-06-06 22:24:35 -07:00
//
// ChannelHelper.swift
// MeshtasticClient
//
// Created by Garth Vander Houwen on 6/6/22.
//
//import Foundation
//
//
//private fun urlToChannels(url: Uri): AppOnlyProtos.ChannelSet {
// val urlStr = url.toString()
//
// val pathRegex = Regex("$prefix(.*)", RegexOption.IGNORE_CASE)
// val (base64) = pathRegex.find(urlStr)?.destructured
// ?: throw MalformedURLException("Not a meshtastic URL: ${urlStr.take(40)}")
// val bytes = Base64.decode(base64, base64Flags)
//
// return AppOnlyProtos.ChannelSet.parseFrom(bytes)
// }
//
//func urlToChannels(url: URL) {
//
// let urlString = url.absoluteString
//
//}