本文整理汇总了C++中INFO1函数的典型用法代码示例。如果您正苦于以下问题:C++ INFO1函数的具体用法?C++ INFO1怎么用?C++ INFO1使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了INFO1函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sprintf
bool AtDrv::setWiFiConfig(char *ssid, int type, const char * password, long timeout)
{
bool ret = false;
char wifiConfBuf[MAX_WIFI_CONF_BUF_SIZE];
char conSetting[MAX_TEMP_BUF_SIZE];
if(type == ENC_TYPE_NONE)
sprintf(conSetting, "%s,none,", ssid);
else if(type == ENC_TYPE_WEP_OPEN)
sprintf(conSetting, "%s,wep_open,%s", ssid, password);
else
sprintf(conSetting, "%s,auto,%s", ssid, password);
sprintf(wifiConfBuf, at_wifi_conf, conSetting);
clearSerialRxData();
INFO1(wifiConfBuf);
serialPort[0]->print(wifiConfBuf);
serialPort[0]->flush();
serialPort[0]->setTimeout(timeout);
if(!serialPort[0]->find(wifiConfBuf) || !serialPort[0]->find(at_ok)) {
INFO1("Fail to set wifi conf");
goto end;
}
ret = true;
end:
return ret;
}
示例2: INFO1
void AtDrv::getFwVersion(char fwVersion[], uint8_t bufLength, long timeout)
{
int bytes;
if(!isAtMode()) {
if(!switchToAtMode()) {
INFO1("Can't switch to at mode");
goto end;
}
}
clearSerialRxData();
INFO1(at_ver);
serialPort[0]->print(at_ver);
serialPort[0]->flush();
serialPort[0]->setTimeout(timeout);
// skip cmd response and '\n'
if(!serialPort[0]->find(at_ver) || !serialPort[0]->find("\n")) {
INFO1("fail to get firmware version");
goto end;
}
bytes = serialPort[0]->readBytesUntil('\r', fwVersion, bufLength);
fwVersion[bytes] = NULL;
end:
clearSerialRxData();
return;
}
示例3: format_get_plugin
int format_get_plugin (format_plugin_t *plugin)
{
int ret = -1;
if (plugin->_state)
{
INFO1 ("internal format details already created for %s", plugin->mount);
return 0;
}
switch (plugin->type)
{
case FORMAT_TYPE_OGG:
ret = format_ogg_get_plugin (plugin);
break;
case FORMAT_TYPE_AAC:
case FORMAT_TYPE_MPEG:
ret = format_mp3_get_plugin (plugin);
break;
case FORMAT_TYPE_EBML:
ret = format_ebml_get_plugin (plugin);
break;
default:
INFO1 ("unparsed format detected for %s", plugin->mount);
break;
}
return ret;
}
示例4: clearSerialRxData
void AtDrv::getLocalIp(uint8_t *ip, long timeout)
{
clearSerialRxData();
INFO1(at_get_ip);
serialPort[0]->print(at_get_ip);
serialPort[0]->print("\r\r");
serialPort[0]->flush();
serialPort[0]->setTimeout(timeout);
// skip cmd response
if(!serialPort[0]->find(at_get_ip)) {
INFO1("fail to get local IP");
ip[0] = ip[1] = ip[2] = ip[3] = 0;
goto end;
}
ip[0] = serialPort[0]->parseInt();
ip[1] = serialPort[0]->parseInt();
ip[2] = serialPort[0]->parseInt();
ip[3] = serialPort[0]->parseInt();
INFO("Local IP: %d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]);
end:
clearSerialRxData();
return;
}
示例5: slave
/** Receiver function */
int slave(int argc, char *argv[])
{
m_task_t task = NULL;
int res;
int id = -1;
xbt_assert1(sscanf(argv[1],"%d", &id),
"Invalid argument %s\n",argv[1]);
MSG_process_sleep(1); /* Make sure the master is done creating the mailboxes */
while(1) {
res = MSG_mailbox_get_task_ext(mb[id], &(task), NULL, -1);
xbt_assert0(res == MSG_OK, "MSG_task_get failed");
INFO1("Received \"%s\"", MSG_task_get_name(task));
if (!strcmp(MSG_task_get_name(task),"finalize")) {
MSG_task_destroy(task);
break;
}
INFO1("Processing \"%s\"", MSG_task_get_name(task));
MSG_task_execute(task);
INFO1("\"%s\" done", MSG_task_get_name(task));
MSG_task_destroy(task);
task = NULL;
}
INFO0("I'm done. See you!");
return 0;
} /* end_of_slave */
示例6: _handle_source_request
/* only called for native icecast source clients */
static void _handle_source_request (client_t *client, const char *uri)
{
INFO1("Source logging in at mountpoint \"%s\"", uri);
if (uri[0] != '/')
{
WARN0 ("source mountpoint not starting with /");
client_send_401 (client);
return;
}
switch (client_check_source_auth (client, uri))
{
case 0: /* authenticated from config file */
source_startup (client, uri, ICECAST_SOURCE_AUTH);
break;
case 1: /* auth pending */
break;
default: /* failed */
INFO1("Source (%s) attempted to login with invalid or missing password", uri);
client_send_401(client);
break;
}
}
示例7: _handle_source_request
static void _handle_source_request (client_t *client, char *uri, int auth_style)
{
source_t *source;
INFO1("Source logging in at mountpoint \"%s\"", uri);
if (uri[0] != '/')
{
WARN0 ("source mountpoint not starting with /");
client_send_401 (client);
return;
}
if (auth_style == ICECAST_SOURCE_AUTH) {
if (connection_check_source_pass (client->parser, uri) == 0)
{
/* We commonly get this if the source client is using the wrong
* protocol: attempt to diagnose this and return an error
*/
/* TODO: Do what the above comment says */
INFO1("Source (%s) attempted to login with invalid or missing password", uri);
client_send_401(client);
return;
}
}
source = source_reserve (uri);
if (source)
{
if (auth_style == SHOUTCAST_SOURCE_AUTH) {
source->shoutcast_compat = 1;
}
source->client = client;
source->parser = client->parser;
source->con = client->con;
if (connection_complete_source (source, 1) < 0)
{
source_clear_source (source);
source_free_source (source);
}
else
{
refbuf_t *ok = refbuf_new (PER_CLIENT_REFBUF_SIZE);
client->respcode = 200;
snprintf (ok->data, PER_CLIENT_REFBUF_SIZE,
"HTTP/1.0 200 OK\r\n\r\n");
ok->len = strlen (ok->data);
/* we may have unprocessed data read in, so don't overwrite it */
ok->associated = client->refbuf;
client->refbuf = ok;
fserve_add_client_callback (client, source_client_callback, source);
}
}
else
{
client_send_404 (client, "Mountpoint in use");
WARN1 ("Mountpoint %s in use", uri);
}
}
示例8: auth_new_listener
/* wrapper function for auth thread to authenticate new listener
* connection details
*/
static void auth_new_listener (auth_t *auth, auth_client *auth_user)
{
client_t *client = auth_user->client;
/* make sure there is still a client at this point, a slow backend request
* can be avoided if client has disconnected */
if (is_listener_connected (client) == 0)
{
DEBUG0 ("listener is no longer connected");
client->respcode = 400;
auth_release (client->auth);
client->auth = NULL;
return;
}
if (auth->authenticate)
{
if (auth->authenticate (auth_user) != AUTH_OK)
{
auth_release (client->auth);
client->auth = NULL;
return;
}
}
if (auth_postprocess_listener (auth_user) < 0)
{
auth_release (client->auth);
client->auth = NULL;
INFO1 ("client %lu failed", client->con->id);
}
}
示例9: _sig_die
void _sig_die(int signo)
{
INFO1("Caught signal %d, shutting down...", signo);
/* inform the server to start shutting down */
global.running = ICE_HALTING;
}
示例10: _handle_source_request
static void _handle_source_request(connection_t *con,
http_parser_t *parser, char *uri)
{
client_t *client;
source_t *source;
client = client_create(con, parser);
INFO1("Source logging in at mountpoint \"%s\"", uri);
if (uri[0] != '/')
{
WARN0 ("source mountpoint not starting with /");
client_send_401 (client);
return;
}
if (!connection_check_source_pass(parser, uri)) {
/* We commonly get this if the source client is using the wrong
* protocol: attempt to diagnose this and return an error
*/
/* TODO: Do what the above comment says */
INFO1("Source (%s) attempted to login with invalid or missing password", uri);
client_send_401(client);
return;
}
source = source_reserve (uri);
if (source)
{
source->client = client;
source->parser = parser;
source->con = con;
if (connection_complete_source (source) < 0)
{
source->client = NULL;
source_free_source (source);
}
else
thread_create ("Source Thread", source_client_thread,
source, THREAD_DETACHED);
}
else
{
client_send_404 (client, "Mountpoint in use");
WARN1 ("Mountpoint %s in use", uri);
}
}
示例11: get_ssl_certificate
static void get_ssl_certificate (ice_config_t *config)
{
SSL_METHOD *method;
long ssl_opts;
ssl_ok = 0;
SSL_load_error_strings(); /* readable error messages */
SSL_library_init(); /* initialize library */
method = SSLv23_server_method();
ssl_ctx = SSL_CTX_new (method);
ssl_opts = SSL_CTX_get_options (ssl_ctx);
SSL_CTX_set_options (ssl_ctx, ssl_opts|SSL_OP_NO_SSLv2);
do
{
if (config->cert_file == NULL)
break;
if (SSL_CTX_use_certificate_chain_file (ssl_ctx, config->cert_file) <= 0)
{
WARN1 ("Invalid cert file %s", config->cert_file);
break;
}
if (SSL_CTX_use_PrivateKey_file (ssl_ctx, config->cert_file, SSL_FILETYPE_PEM) <= 0)
{
WARN1 ("Invalid private key file %s", config->cert_file);
break;
}
if (!SSL_CTX_check_private_key (ssl_ctx))
{
ERROR1 ("Invalid %s - Private key does not match cert public key", config->cert_file);
break;
}
if (SSL_CTX_set_cipher_list(ssl_ctx, config->cipher_list) <= 0)
{
WARN1 ("Invalid cipher list: %s", config->cipher_list);
}
ssl_ok = 1;
INFO1 ("SSL certificate found at %s", config->cert_file);
INFO1 ("SSL using ciphers %s", config->cipher_list);
return;
} while (0);
INFO0 ("No SSL capability on any configured ports");
}
示例12: workers_adjust
void workers_adjust (int new_count)
{
INFO1 ("requested worker count %d", new_count);
while (worker_count != new_count)
{
if (worker_count < new_count)
worker_start ();
else if (worker_count > new_count)
worker_stop ();
}
}
示例13: sr
FDWEpollBackend::FDWEpollBackend(int nfds_)
:FDWBackend(nfds_), sr(0)
{
if ((epfd = epoll_create(nfds)) < 0)
throw InitError("failed to open epoll device");
epevents.reset(new struct epoll_event[nfds]);
std::memset(epevents.get(), 0, sizeof(struct epoll_event) * nfds);
INFO1("fdwatch epoll() based layer initialized (max %d sockets)", nfds);
}
示例14: admin_handle_general_request
static int admin_handle_general_request (client_t *client, const char *uri)
{
struct admin_command *cmd;
if ((client->flags & CLIENT_AUTHENTICATED) == 0)
{
INFO1("Bad or missing password on admin command request (%s)", uri);
return client_send_401 (client, NULL);
}
cmd = find_admin_command (admin_general, uri);
if (cmd == NULL)
{
INFO1 ("processing file %s", uri);
return command_stats (client, uri);
}
if (cmd->handle.general == NULL)
return client_send_400 (client, "unknown request");
return cmd->handle.general (client, cmd->response);
}