本文整理汇总了C++中SocketClient::SendBytes方法的典型用法代码示例。如果您正苦于以下问题:C++ SocketClient::SendBytes方法的具体用法?C++ SocketClient::SendBytes怎么用?C++ SocketClient::SendBytes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SocketClient
的用法示例。
在下文中一共展示了SocketClient::SendBytes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sendFacialExpressionAnimation
void sendFacialExpressionAnimation(SocketClient& sock, EmoStateHandle eState) {
std::ostringstream output;
IEE_FacialExpressionAlgo_t upperFaceType =
IS_FacialExpressionGetUpperFaceAction(eState);
IEE_FacialExpressionAlgo_t lowerFaceType =
IS_FacialExpressionGetLowerFaceAction(eState);
float upperFaceAmp = IS_FacialExpressionGetUpperFaceActionPower(eState);
float lowerFaceAmp = IS_FacialExpressionGetLowerFaceActionPower(eState);
if (IS_FacialExpressionIsBlink(eState)) {
output << "B,";
}
if (IS_FacialExpressionIsLeftWink(eState)) {
output << "l,";
}
if (IS_FacialExpressionIsRightWink(eState)) {
output << "r,";
}
if (upperFaceAmp > 0.0) {
switch (upperFaceType) {
case FE_SURPRISE: output << "b"; break;
case FE_FROWN: output << "f"; break;
default: break;
}
output << numberToString(static_cast<int>(upperFaceAmp*100.0f)) << ",";
}
if (lowerFaceAmp > 0.0) {
switch (lowerFaceType) {
case FE_CLENCH: output << "G"; break;
case FE_SMILE: output << "S"; break;
default: break;
}
output << numberToString(static_cast<int>(lowerFaceAmp*100.0f)) << ",";
}
std::string outString = output.str();
// Remove the last comma
if (outString.length()) {
outString.resize(outString.length()-1);
}
if (!outString.length()) {
outString = std::string("neutral");
}
sock.SendBytes(outString);
}
示例2: sendCognitivAnimation
void sendCognitivAnimation(SocketClient& sock, EmoStateHandle eState) {
std::ostringstream os;
EE_CognitivAction_t actionType = ES_CognitivGetCurrentAction(eState);
float actionPower = ES_CognitivGetCurrentActionPower(eState);
int intType = static_cast<int>(actionType);
int intPower = static_cast<int>(actionPower*100.0f);
os << intType << "," << intPower;
std::cout << os.str()<< std::endl;
sock.SendBytes(os.str());
}