Meshtastic-Apple/MeshtasticApple/Helpers/ChannelHelper.swift
2022-06-09 22:11:54 -07:00

26 lines
634 B
Swift

//
// ChannelHelper.swift
// MeshtasticApple
//
// 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
//
//}