Add ability to specify device address for wifi p2p

This commit is contained in:
Mygod
2020-06-04 22:11:17 -04:00
parent 0965581cc4
commit e6e2362a79
4 changed files with 24 additions and 3 deletions

View File

@@ -72,6 +72,8 @@ inline class MacAddressCompat(val addr: Long) : Parcelable {
fun MacAddress.toCompat() = fromBytes(toByteArray())
}
fun validate() = require(addr and ((1L shl 48) - 1).inv() == 0L)
fun toList() = ByteBuffer.allocate(8).run {
order(ByteOrder.LITTLE_ENDIAN)
putLong(addr)