Please don't use "Copy for forum" format. It may be that I have found the answer, but not understood what I was seeing, given my, shall we say, not overwhelming experience in C. Sensors.requestTemperaturesByAddress(device) Īpologies for the long post, but this has been frustrating me mightily and I can't seem to find the answer. ![]() Input from STDIN will be parsed for MAC addresses (that is, the script will: make an effort to only convert tokens which look like MAC addresses whilst: passing through all other input). If both STDIN and arguments are supplied, STDIN is processed first. addy should be 0x28, 0x2D, 0xF4, 0x21, 0x05, 0x00, 0x00, 0x91, but not seen as string. MAC address(es) can be supplied by STDIN, and/or script arguments. I had sucess with the string route.īe that as it may (happy for pointers on that.) my problem is I have the address as a string, but when I get to the "DeviceAddress device = I can't seem to get it to work doing that way. Configuring the MAC addresses to be filtered. The simplest and most honest answer to that is my experience in C amounts to not too much more than the code below. You can e-mail your comments about product documentation to. num strtol (dummy, &ptr, 16) sprintf is not necessary (use it if you want to copy number into a string). string hex macAddress.Replace (':', '') uint64 macAsNumber Convert.ToUInt64 (hex, 16) The number can then be converted to a string in whatever format is desired. Use base 16 instead of 10, because you want to convert to hexadecimal. I have the comms part working, although some will probably ask why the received message is going to a string not a char array. If any other representation is desired, one can remove the colons with string.Replace and then parse the number using Convert.ToUInt64. The string may be 1 address, or up to 10. ![]() Arduino then needs to parse the string is receives, read the temperature from the DS18B20 that corresponds to the address parsed, then build up a string of temps and addresses to return to the database program so it can review and store them. sipcalc 192.168.1.0/22 -ipv4 : 192.168.1.0/22 - 0 CIDR Host address - 192.168.1.0 Host address (decimal) - 3232235776 Host address (hex) - C0A80100. This has probably been asked many times, but I have had no luck finding as answer to my problem in all the discussions I have read (which I've been doing most of today.).Įthernet enabled arduino that is sent a message containing a list of addresses (delimited by !) from an initiating database program.
0 Comments
Leave a Reply. |