I won't comment on the use of the String class, you know the pitfalls. What is clientHTTPMagicMirror? which library is being used? is there a way to post params independently? what is postAttributeFirmware, firmwareCode etc ? They are likely Strings indeed ut don't post snippets ( Snippets R Us!) I found one possible lead with this code ( MAC Address to String - #6 by beic - Programming Questions - Arduino Forum) but I don't understand it well enough to know how to adjust it to input ESP.getEfuseMac() and get out a string called efuseMac.Īny help or pointers in the right direction would be appreciated. Unless someone can suggest another workaround, I think I need efuseMac and wifiMac to be strings as well. I'm no expert, but I believe this is concatenating a bunch of string to form the post. String payloadMagicMirror = clientHTTPMagicMirror.getString() The code for sending the data is: int returnCodeMagicMirror = clientHTTPMagicMirror.POST( postAttributeFirmware + firmwareCode + postAttributeEfuseMac + efuseMac + postAttributeWiFiMac + wifiMac + postAttributeSensorID + sensorID + postEnd ) My Arduino (technically an ESP32) sends some json data to my MagicMirror using HTTP POST. I'm pretty sure that someone is going to say, "Why are you doing this? You shouldn't use a string." So here's my situation: String hexValue = Convert.My basic question is how can I convert the units MAC address (from ESP.getEfuseMac() and/or WiFi.macAddress() ) into a string? Convert the integer value to a hexadecimal value in string form.Ĭonsole.WriteLine($"Hexadecimal value of Get the integral value of the character. Finally, it formats the number as its hexadecimal representation in a string. Then it calls ToInt32(Char) on each character to obtain its numeric value. First it parses the string to an array of characters. This example outputs the hexadecimal value of each character in a string. Obtain the char that corresponds to each value in a hexadecimal string.Ĭonvert a byte array to a hexadecimal string. Obtain the hexadecimal value of each character in a string. These examples show you how to perform the following tasks:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |