Arf Well-Known Member Licensed User Longtime User Sep 1, 2017 #1 Hi, I haven't done any B4i programming for a while and am having a brainfail. I'm trying to convert a MAC address string into bytes, but can't remember what the simplest way to do it is. Code: manager.WriteData("49535343-FE7D-4AE5-8FA9-9FAFD205E455", "49535343-8841-43F4-A8D4-ECBE34729BB3", Array As Byte(0xA5,0x5A,0x00,0x0D,0x65, StringToBytes("D88039F0D122"),0x64)) Obviouslt that doesn't work as there seems to be a BytesToString function but not the reverse function. Any tips gratefully received.
Hi, I haven't done any B4i programming for a while and am having a brainfail. I'm trying to convert a MAC address string into bytes, but can't remember what the simplest way to do it is. Code: manager.WriteData("49535343-FE7D-4AE5-8FA9-9FAFD205E455", "49535343-8841-43F4-A8D4-ECBE34729BB3", Array As Byte(0xA5,0x5A,0x00,0x0D,0x65, StringToBytes("D88039F0D122"),0x64)) Obviouslt that doesn't work as there seems to be a BytesToString function but not the reverse function. Any tips gratefully received.
Yvon Steinthal Active Member Licensed User Longtime User Sep 1, 2017 #2 Code: Dim listeitems as String = "Hello" Dim bc As ByteConverter Dim data() As Byte = bc.StringToBytes(listeitems,"UTF-8") Upvote 0
Code: Dim listeitems as String = "Hello" Dim bc As ByteConverter Dim data() As Byte = bc.StringToBytes(listeitems,"UTF-8")
Erel B4X founder Staff member Licensed User Longtime User Sep 2, 2017 #3 Or: Code: "49535343-8841-43F4-A8D4-ECBE34729BB3".GetBytes("UTF-8") Upvote 0