Audiovox P965 Scheda Tecnica Pagina 127

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 280
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 126
API In CPP
124
if (littleEndian) {
encodedLengthData[0] = lengthData[2] | 0xc0;
encodedLengthData[1] = lengthData[1];
encodedLengthData[2] = lengthData[0];
} else {
encodedLengthData[0] = lengthData[1] | 0xc0;
encodedLengthData[1] = lengthData[2];
encodedLengthData[2] = lengthData[3];
}
write (fdSock, encodedLengthData, 3);
} else if (messageLength < 0x10000000) { // write 4 bytes (untested)
DEBUG ? printf("messageLength < 0x10000000.\n") : 0;
if (littleEndian) {
encodedLengthData[0] = lengthData[3] | 0xe0;
encodedLengthData[1] = lengthData[2];
encodedLengthData[2] = lengthData[1];
encodedLengthData[3] = lengthData[0];
} else {
encodedLengthData[0] = lengthData[0] | 0xe0;
encodedLengthData[1] = lengthData[1];
encodedLengthData[2] = lengthData[2];
encodedLengthData[3] = lengthData[3];
}
write (fdSock, encodedLengthData, 4);
} else { // this should never happen
printf("Length of word is %d\n", messageLength);
printf("Word is too long.\n");
}
delete [] encodedLengthData;
}
/********************************************************************
* Write a word to the socket
********************************************************************/
void MikrotikAPI::WriteWord(const string &strWord)
{
DEBUG ? printf("Word to write is %s\n", strWord.c_str()) : 0;
WriteLength(strWord.length());
write(fdSock, strWord.c_str(), strWord.length());
}
/********************************************************************
* Write a Sentence (multiple words) to the socket
Vedere la pagina 126
1 2 ... 122 123 124 125 126 127 128 129 130 131 132 ... 279 280

Commenti su questo manuale

Nessun commento