iPod IWIP3G User Guide - Page 121
How To Create A Simple Frame
UPC - 649241862819
View all iPod IWIP3G manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 121 highlights
//HOW TO CREATE A SIMPLE FRAME char outbuf[128]; //Buffer for frame char* cmd = "SET"; //ASCII command int link = 0xff, pos=0; //0xFF for control channel int len = strlen(cmd); //Calc. length of ASCII command //Generate packet outbuf[pos++]=0xbf; //SOF outbuf[pos++]=link; //Link (0xFF=Control, 0x00 = connection 1, etc.) outbuf[pos++]=0; //Flags outbuf[pos++]=len; //Length //Insert data into correct position in the frame memmove(outbuf+pos cmd, len); pos += len; //Move to correct position outbuf[pos++]=link^0xff; //nlink 121
121
//HOW TO CREATE A SIMPLE FRAME
char outbuf[128];
//Buffer for frame
char* cmd = “SET”;
//ASCII command
int link = 0xff, pos=0;
//0xFF for control channel
int len = strlen(cmd);
//Calc. length of ASCII command
//Generate packet
outbuf[pos++]=0xbf;
//SOF
outbuf[pos++]=link;
//Link (0xFF=Control, 0x00 = connection 1, etc.)
outbuf[pos++]=0;
//Flags
outbuf[pos++]=len;
//Length
//Insert data into correct position in the frame
memmove(outbuf+pos cmd, len);
pos += len;
//Move to correct position
outbuf[pos++]=link^0xff;
//nlink