First, arduwino, a huge thanks. It's pretty motivating to have someone peering over my shoulder, watching me push forward. That may not be your intent, but it's certainly happening. If you're ever in the DC area, let me know. The first round is on me, at the very least.
OK, my paycheck hits tomorrow, the Processing book is going to be coming home (either on electron or paper).
I'm starting to look further under the hood, and I can't understand something in Udp.h (or any of the other files).
After getting a little bit of sleep, I want to look at UDP again (If this is my ADD acting up again, it's incredibly insidious). UDP is going to be key for another project that I want to work with, and is the pathway I eventually want to reach with this current project.
It looks like commands are duplicated. Further, it looks like the commands in it should let me do what I want to do.
Code: Select all
#ifndef udp_h
#define udp_h
#define UDP_TX_PACKET_MAX_SIZE 24
class UdpClass {
private:
uint8_t _sock; // socket ID for Wiz5100
uint16_t _port; // local port to listen on
public:
void begin(uint16_t); // initialize, start listening on specified port
int available(); // has data been received?
// C-style buffer-oriented functions
uint16_t sendPacket(uint8_t *, uint16_t, uint8_t *, uint16_t); //send a packet to specified peer
uint16_t sendPacket(const char[], uint8_t *, uint16_t); //send a string as a packet to specified peer
int readPacket(uint8_t *, uint16_t); // read a received packet
int readPacket(uint8_t *, uint16_t, uint8_t *, uint16_t *); // read a received packet, also return sender's ip and port
// readPacket that fills a character string buffer
int readPacket(char *, uint16_t, uint8_t *, uint16_t &);
};
extern UdpClass Udp;
#endif
Take a look at the "uint16_t sendPacket" lines (there's two of 'em).
It looks like one forces me to send a const char[]. The one above it seems duplicated except for the information it passes to the method(?), BUT it seems like the information it is passing to the method, it passes twice.
First, why the two, almost identical, lines?
Second, can I force the issue somehow?
Finally, I'm poor. Like "Not making the rent" poor.
At what point am I going to brick one of these things? If I comment out one of the lines of code in the program above, do I risk this?
I'm not pushing liability on anyone, or shirking my responsibility. I'm the one hacking away at this thing. I'm just hoping someone can tell me the relative risk here. I know I'm probably more likely to brick my gear screwing up my anti-static discipline when I unplug the Arduino.