本文整理汇总了C++中send_cmd函数的典型用法代码示例。如果您正苦于以下问题:C++ send_cmd函数的具体用法?C++ send_cmd怎么用?C++ send_cmd使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了send_cmd函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: send_cmd
void Client::send_rotate() {
_vars[0].i = me->id;
_vars[1].f = me->angle;
send_cmd( NW_CMD_ROTATE);
}
示例2: nt35510_init
static int32_t nt35510_init(struct lcd_spec *self)
{
Send_data send_cmd = self->info.mcu->ops->send_cmd;
Send_data send_data = self->info.mcu->ops->send_data;
LCD_PRINT("nt35510_init===\n");
mdelay(200);
//Power setting sequence
send_cmd(0xF000);
send_data(0x55);
send_cmd(0xF001);
send_data(0xAA);
send_cmd(0xF002);
send_data(0x52);
send_cmd(0xF003);
send_data(0x08);
send_cmd(0xF004);
send_data(0x01);
send_cmd(0xB000);
send_data(0x09);
send_cmd(0xB001);
send_data(0x09);
send_cmd(0xB002);
send_data(0x09);
send_cmd(0xB600);
send_data(0x34);
send_cmd(0xB601);
send_data(0x34);
send_cmd(0xB602);
send_data(0x34);
send_cmd(0xB100);
send_data(0x09);
send_cmd(0xB101);
send_data(0x09);
send_cmd(0xB102);
send_data(0x09);
send_cmd(0xB700);
send_data(0x24);
send_cmd(0xB701);
send_data(0x24);
send_cmd(0xB702);
send_data(0x24);
send_cmd(0xB300);
send_data(0x05);
send_cmd(0xB301);
send_data(0x05);
send_cmd(0xB302);
send_data(0x05);
send_cmd(0xB900);
send_data(0x24);
send_cmd(0xB901);
send_data(0x24);
send_cmd(0xB902);
send_data(0x24);
send_cmd(0xBF00);
send_data(0x01);
send_cmd(0xB500);
send_data(0x0B);
send_cmd(0xB501);
send_data(0x0B);
send_cmd(0xB502);
send_data(0x0B);
send_cmd(0xBA00);
send_data(0x24);
send_cmd(0xBA01);
send_data(0x24);
send_cmd(0xBA02);
send_data(0x24);
send_cmd(0xBC00);
send_data(0x00);
send_cmd(0xBC01);
send_data(0xA3);
send_cmd(0xBC02);
send_data(0x00);
send_cmd(0xBD00);
send_data(0x00);
send_cmd(0xBD01);
send_data(0xA3);
send_cmd(0xBD02);
send_data(0x00);
mdelay(120);
//Display parameter setting
send_cmd(0xF000);
send_data(0x55);
send_cmd(0xF001);
//.........这里部分代码省略.........
示例3: sync_error_callback
static void sync_error_callback(DictionaryResult dict_error, AppMessageResult app_message_error, void *context) {
APP_LOG(APP_LOG_LEVEL_DEBUG, "App Message Sync Error: %d", app_message_error);
if (app_message_error == 64) {send_cmd();}
}
示例4: ultimate2_cmd_serv_privmsg
void ultimate2_cmd_serv_privmsg(char *source, char *dest, char *msg)
{
send_cmd(source, "PRIVMSG $%s :%s", dest, msg);
}
示例5: ultimate2_cmd_ping
void ultimate2_cmd_ping(char *server)
{
send_cmd(ServerName, "PING %s :%s", ServerName, server);
}
示例6: ultimate2_cmd_squit
/* SQUIT */
void ultimate2_cmd_squit(char *servname, char *message)
{
send_cmd(NULL, "SQUIT %s :%s", servname, message);
}
示例7: ultimate2_cmd_privmsg
void ultimate2_cmd_privmsg(char *source, char *dest, char *buf)
{
send_cmd(source, "PRIVMSG %s :%s", dest, buf);
}
示例8: select_long_click_handler
static void select_long_click_handler(ClickRecognizerRef recognizer, void *context) {
send_cmd(WATCH_KEY_PRESSED, WATCH_KEY_HELD_SELECT);
}
示例9: down_long_click_handler
static void down_long_click_handler(ClickRecognizerRef recognizer, void *context) {
send_cmd(WATCH_KEY_PRESSED, WATCH_KEY_HELD_DOWN);
}
示例10: client_version_cb
static void
client_version_cb (hashlist_t * v, CONNECTION * con)
{
ASSERT (validate_connection (con));
send_cmd (con, MSG_CLIENT_VERSION_STATS, "\"%s\" %d", v->key, v->count);
}
示例11: up_single_click_handler
static void up_single_click_handler(ClickRecognizerRef recognizer, void *context) {
send_cmd(WATCH_KEY_PRESSED, WATCH_KEY_PRESSED_UP);
}
示例12: send_cmd
void SzbaseProt::on_param_changed( const std::string& pname )
{
if( sub_params.count( pname ) )
send_cmd( new NotifySnd( get_client_param_name (pname )) );
}
示例13: ultimate2_cmd_pong
/* PONG */
void ultimate2_cmd_pong(char *servname, char *who)
{
send_cmd(servname, "PONG %s", who);
}
示例14: wait_packets
int wait_packets(int sd)
{
int flags;
int ret;
int recv_len;
int len;
int err;
fd_set rfds;
struct nlmsgerr *nl_err;
struct timeval tv;
struct nlattr *na;
struct msgtemplate msg;
char *http_data;
struct sample_http_info *http_info;
long xxxx = 0;
long errcnt = 0;
unsigned int query_id = 0;
char url[MAX_URL_LEN] = {0};
int sec_flag = 0x0f0f;
#ifdef FIRST_SEND
printf("%s, first send for test !!!\n", __FUNCTION__);
err = send_cmd(sd, nl_family_id, SAMPLE_NETLINK_CMD_SECURITY_QUERY,
SAMPLE_NETLINK_ATTR_SECURITY_FLAG, (void*)&sec_flag,
sizeof(int), NLM_F_REQUEST);
if (err < 0) {
printf("Error sending result (%d:%s)\n",
errno, strerror(errno));
return -1;
}
#endif
flags = fcntl(sd, F_GETFL);
fcntl(sd, F_SETFL, flags | O_NONBLOCK);
err = 0;
do {
FD_ZERO(&rfds);
FD_SET(sd, &rfds);
/* Monitoring, no timeout */
ret = select(sd+1, &rfds, NULL, NULL, NULL);
if (ret < 0) {
if (errno == EINTR)
continue;
perror("select()");
err = ret;
break;
} else if (ret == 0) {
printf("No answer within %lu seconds.\n", tv.tv_sec);
err = -ETIMEDOUT;
break;
}
if (!FD_ISSET(sd, &rfds))
continue;
printf("\n\n========================================\n\n");
recv_len = recv(nl_sd, &msg, sizeof(msg), 0);
if (recv_len < 0) {
printf("nonfatal reply error: errno %d\n", recv_len);
err = errno;
errcnt++;
printf("fail cnt %d\n", errcnt);
/* TODO check why failed with high pressure. overwrite on rcv buffer? */
// break;
}
#ifdef __DEBUG_MSG__
if (msg.n.nlmsg_type == NLMSG_ERROR ||
!NLMSG_OK((&msg.n), recv_len)) {
nl_err = NLMSG_DATA(&msg);
printf("fatal reply error, errno %d\n", nl_err->error);
err = nl_err->error;
break;
}
#endif
recv_len = GENLMSG_PAYLOAD(&msg.n);
na = (struct nlattr *) GENLMSG_DATA(&msg);
printf("%s, recv genl msg, cmd=%d\n", __FUNCTION__, msg.g.cmd);
print_timestamp();
len = 0;
while (len < recv_len) {
len += NLA_ALIGN(na->nla_len);
switch (na->nla_type) {
case SAMPLE_NETLINK_TYPE_SEC_QID:
{
query_id = *(unsigned int *)NLA_DATA(na);
printf("HTTP query id:%d\n", query_id);
}
break;
case SAMPLE_NETLINK_TYPE_HTTP_INFO:
http_info = (struct http_info *)NLA_DATA(na);
#ifdef __DEBUG_MSG__
printf("%08x(%u) --> %08x(%u)\n",
ntohl(http_info->sip), ntohs(http_info->sport),
ntohl(http_info->dip), ntohs(http_info->dport));
#endif
break;
//.........这里部分代码省略.........
示例15: ultimate2_cmd_global
/* GLOBOPS */
void ultimate2_cmd_global(char *source, char *buf)
{
send_cmd(source, "GLOBOPS :%s", buf);
}